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/docnode/node.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/docnode/node.cxx')
-rw-r--r-- | sw/source/core/docnode/node.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx index b8f946bc2871..8979184c729d 100644 --- a/sw/source/core/docnode/node.cxx +++ b/sw/source/core/docnode/node.cxx @@ -154,10 +154,10 @@ static bool Put( std::shared_ptr<const SfxItemSet>& rpAttrSet, const SwContentNo SwAttrSet aNewSet( static_cast<const SwAttrSet&>(*rpAttrSet) ); // #i76273# Robust - std::unique_ptr<SfxItemSet> pStyleNames; + std::optional<SfxItemSet> pStyleNames; if ( SfxItemState::SET == rSet.GetItemState( RES_FRMATR_STYLE_NAME, false ) ) { - pStyleNames.reset(new SfxItemSet( *aNewSet.GetPool(), svl::Items<RES_FRMATR_STYLE_NAME, RES_FRMATR_CONDITIONAL_STYLE_NAME>{} )); + pStyleNames.emplace( *aNewSet.GetPool(), svl::Items<RES_FRMATR_STYLE_NAME, RES_FRMATR_CONDITIONAL_STYLE_NAME>{} ); pStyleNames->Put( aNewSet ); } @@ -201,10 +201,10 @@ static bool Put_BC( std::shared_ptr<const SfxItemSet>& rpAttrSet, SwAttrSet aNewSet( static_cast<const SwAttrSet&>(*rpAttrSet) ); // #i76273# Robust - std::unique_ptr<SfxItemSet> pStyleNames; + std::optional<SfxItemSet> pStyleNames; if ( SfxItemState::SET == rSet.GetItemState( RES_FRMATR_STYLE_NAME, false ) ) { - pStyleNames.reset(new SfxItemSet( *aNewSet.GetPool(), svl::Items<RES_FRMATR_STYLE_NAME, RES_FRMATR_CONDITIONAL_STYLE_NAME>{} )); + pStyleNames.emplace( *aNewSet.GetPool(), svl::Items<RES_FRMATR_STYLE_NAME, RES_FRMATR_CONDITIONAL_STYLE_NAME>{} ); pStyleNames->Put( aNewSet ); } |