diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-07-01 10:10:35 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-07-01 16:11:06 +0200 |
commit | 608f273e9da412e7a2d884f2603756cb4ff4c8af (patch) | |
tree | 11b279b98062d17ee69f722ccb1532107a615789 /sw/source/core/unocore/unoframe.cxx | |
parent | cc948b84b8550ba728b3dfbc40a9785b928910e9 (diff) |
can allocate these SfxItemSet on the stack
Change-Id: Ib2b89613ad3e8f2bcdd51bee10bab3559a64fce4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118208
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/core/unocore/unoframe.cxx')
-rw-r--r-- | sw/source/core/unocore/unoframe.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx index a430d92f5b7f..fd4f07a73390 100644 --- a/sw/source/core/unocore/unoframe.cxx +++ b/sw/source/core/unocore/unoframe.cxx @@ -1548,7 +1548,7 @@ void SwXFrame::setPropertyValue(const OUString& rPropertyName, const ::uno::Any& UnoActionContext aAction(pFormat->GetDoc()); - std::unique_ptr<SfxItemSet> pSet; + std::optional<SfxItemSet> pSet; // #i31771#, #i25798# - No adjustment of // anchor ( no call of method <sw_ChkAndSetNewAnchor(..)> ), // if document is currently in reading mode. @@ -1563,7 +1563,7 @@ void SwXFrame::setPropertyValue(const OUString& rPropertyName, const ::uno::Any& const ::SfxPoolItem* pItem; if( SfxItemState::SET == pFrameFormat->GetItemState( RES_ANCHOR, false, &pItem )) { - pSet.reset(new SfxItemSet( pDoc->GetAttrPool(), aFrameFormatSetRange )); + pSet.emplace( pDoc->GetAttrPool(), aFrameFormatSetRange ); pSet->Put( *pItem ); if ( pFormat->GetDoc()->GetEditShell() != nullptr && !sw_ChkAndSetNewAnchor( *pFly, *pSet ) ) @@ -1574,7 +1574,7 @@ void SwXFrame::setPropertyValue(const OUString& rPropertyName, const ::uno::Any& } } - pFormat->GetDoc()->SetFrameFormatToFly( *pFormat, *pFrameFormat, pSet.get() ); + pFormat->GetDoc()->SetFrameFormatToFly( *pFormat, *pFrameFormat, pSet ? &*pSet : nullptr ); } else if (FN_UNO_GRAPHIC_FILTER == pEntry->nWID) { |