sw/inc/IMark.hxx | 2 ++ sw/source/core/crsr/bookmark.cxx | 5 +++++ sw/source/uibase/docvw/edtwin.cxx | 6 ++++++ 3 files changed, 13 insertions(+)
New commits: commit a157f82649e33f05c40aba7fc152733f38fe3f67 Author: Oliver Specht <oliver.spe...@cib.de> AuthorDate: Mon Sep 23 11:38:56 2024 +0200 Commit: Gabor Kelemen <gabor.kelemen.ext...@allotropia.de> CommitDate: Wed Oct 16 13:12:11 2024 +0200 tdf#159286 FORMTEXT selection changed As long as FORMTEXT has default content of 5 en spaces a click selects the content. If the content has changed then the cursor is placed at the mouse position. Change-Id: If0e7717d04d29887b63ec20ed6b82c625400421a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173812 Reviewed-by: Gabor Kelemen <gabor.kelemen.ext...@allotropia.de> Tested-by: Gabor Kelemen <gabor.kelemen.ext...@allotropia.de> Tested-by: Jenkins diff --git a/sw/inc/IMark.hxx b/sw/inc/IMark.hxx index 3ad7e78213b3..d9619f4a4dba 100644 --- a/sw/inc/IMark.hxx +++ b/sw/inc/IMark.hxx @@ -279,6 +279,8 @@ namespace sw::mark OUString GetContent() const override; void ReplaceContent(const OUString& sNewContent) override; + bool HasDefaultContent() const; + private: sw::DocumentContentOperationsManager* m_pDocumentContentOperationsManager; }; diff --git a/sw/source/core/crsr/bookmark.cxx b/sw/source/core/crsr/bookmark.cxx index 32ec60c3c83c..dfdff72931b6 100644 --- a/sw/source/core/crsr/bookmark.cxx +++ b/sw/source/core/crsr/bookmark.cxx @@ -672,6 +672,11 @@ namespace sw::mark } Invalidate(); } + bool TextFieldmark::HasDefaultContent() const + { + return GetContent() == vEnSpaces; + } + NonTextFieldmark::NonTextFieldmark(const SwPaM& rPaM) : Fieldmark(rPaM) diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx index 71ef81ca9d24..0b5c7828600a 100644 --- a/sw/source/uibase/docvw/edtwin.cxx +++ b/sw/source/uibase/docvw/edtwin.cxx @@ -5139,6 +5139,12 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) rCheckboxFm.Invalidate(); rSh.InvalidateWindows( SwRect(m_rView.GetVisArea()) ); } + else if ( fieldBM->GetFieldname( ) == ODF_FORMTEXT && + static_cast< const TextFieldmark* > ( aContentAtPos.aFnd.pFieldmark )->HasDefaultContent() ) + { + rSh.GotoFieldmark( aContentAtPos.aFnd.pFieldmark ); + } + } } else if ( IsAttrAtPos::InetAttr == aContentAtPos.eContentAtPos )