diff options
author | Bjoern Michaelsen <bjoern.michaelsen@libreoffice.org> | 2020-02-08 12:19:17 +0100 |
---|---|---|
committer | Björn Michaelsen <bjoern.michaelsen@libreoffice.org> | 2020-02-08 21:40:00 +0100 |
commit | 6b2b0af1936ddc57992b01a56725d4acadffc806 (patch) | |
tree | ecb619edd31aad4951e37078266a270600e9f4e8 /sw/source/uibase/wrtsh | |
parent | e2d96d38afb30fa78f37e84543bfd04c25e1c6b2 (diff) |
introduce SwFieldType::FindFormatForField and use it (once)
Change-Id: Id7136b936c0585e7013f3d06ad97436b51522da3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88264
Tested-by: Jenkins
Reviewed-by: Björn Michaelsen <bjoern.michaelsen@libreoffice.org>
Diffstat (limited to 'sw/source/uibase/wrtsh')
-rw-r--r-- | sw/source/uibase/wrtsh/wrtsh1.cxx | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/sw/source/uibase/wrtsh/wrtsh1.cxx b/sw/source/uibase/wrtsh/wrtsh1.cxx index fdb4c56938d7..4225c59b68ec 100644 --- a/sw/source/uibase/wrtsh/wrtsh1.cxx +++ b/sw/source/uibase/wrtsh/wrtsh1.cxx @@ -1978,17 +1978,8 @@ void SwWrtShell::InsertPostIt(SwFieldMgr& rFieldMgr, const SfxRequest& rReq) if (pPostIt) { SwFieldType* pType = GetDoc()->getIDocumentFieldsAccess().GetFieldType(SwFieldIds::Postit, OUString(), false); - SwIterator<SwFormatField,SwFieldType> aIter( *pType ); - SwFormatField* pSwFormatField = aIter.First(); - while( pSwFormatField ) - { - if ( pSwFormatField->GetField() == pPostIt ) - { - pSwFormatField->Broadcast( SwFormatFieldHint( nullptr, SwFormatFieldHintWhich::FOCUS, &GetView() ) ); - break; - } - pSwFormatField = aIter.Next(); - } + if(auto pFormat = pType->FindFormatForField(pPostIt)) + pFormat->Broadcast( SwFormatFieldHint( nullptr, SwFormatFieldHintWhich::FOCUS, &GetView() ) ); } } |