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.extern@allotropia.de> Tested-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de> Tested-by: Jenkins
This commit is contained in:
committed by
Gabor Kelemen
parent
8b4161616b
commit
a157f82649
@@ -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;
|
||||
};
|
||||
|
||||
@@ -672,6 +672,11 @@ namespace sw::mark
|
||||
}
|
||||
Invalidate();
|
||||
}
|
||||
bool TextFieldmark::HasDefaultContent() const
|
||||
{
|
||||
return GetContent() == vEnSpaces;
|
||||
}
|
||||
|
||||
|
||||
NonTextFieldmark::NonTextFieldmark(const SwPaM& rPaM)
|
||||
: Fieldmark(rPaM)
|
||||
|
||||
@@ -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 )
|
||||
|
||||
Reference in New Issue
Block a user