diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2021-07-03 20:26:18 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-07-05 19:00:45 +0200 |
commit | 6cb400f41df0dd108cdb4b4d3ec6656844814147 (patch) | |
tree | 15a38de0d82d59be10a74d6cdc5375e9c08b0dd6 /svx | |
parent | b99e8c79bf630432fbb6a819d69da0bd2db7c80c (diff) |
store the SfxItemSet inside SfxSetItem by value
rather than on the heap, avoiding an allocation
Change-Id: I3f1504f9a2d4178a9ba59e98de182a0ab98cdce0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118356
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/items/pageitem.cxx | 2 | ||||
-rw-r--r-- | svx/source/xoutdev/xattr.cxx | 8 | ||||
-rw-r--r-- | svx/source/xoutdev/xpool.cxx | 4 |
3 files changed, 7 insertions, 7 deletions
diff --git a/svx/source/items/pageitem.cxx b/svx/source/items/pageitem.cxx index a715543e8dae..db45b3e9fe62 100644 --- a/svx/source/items/pageitem.cxx +++ b/svx/source/items/pageitem.cxx @@ -262,7 +262,7 @@ SvxSetItem::SvxSetItem( const SvxSetItem& rItem ) : { } -SvxSetItem::SvxSetItem( const sal_uInt16 nId, std::unique_ptr<SfxItemSet>&& _pSet ) : +SvxSetItem::SvxSetItem( const sal_uInt16 nId, SfxItemSet&& _pSet ) : SfxSetItem( nId, std::move(_pSet) ) { diff --git a/svx/source/xoutdev/xattr.cxx b/svx/source/xoutdev/xattr.cxx index 421094428fb3..ea32ddea2cb4 100644 --- a/svx/source/xoutdev/xattr.cxx +++ b/svx/source/xoutdev/xattr.cxx @@ -2998,14 +2998,14 @@ XFormTextHideFormItem* XFormTextHideFormItem::Clone(SfxItemPool* /*pPool*/) cons /// a line attribute set item -XLineAttrSetItem::XLineAttrSetItem( std::unique_ptr<SfxItemSet>&& pItemSet ) : +XLineAttrSetItem::XLineAttrSetItem( SfxItemSet&& pItemSet ) : SfxSetItem( XATTRSET_LINE, std::move(pItemSet)) { } XLineAttrSetItem::XLineAttrSetItem( SfxItemPool* pItemPool ) : SfxSetItem( XATTRSET_LINE, - std::make_unique<SfxItemSet>( *pItemPool, svl::Items<XATTR_LINE_FIRST, XATTR_LINE_LAST>{})) + SfxItemSet( *pItemPool, svl::Items<XATTR_LINE_FIRST, XATTR_LINE_LAST>{})) { } @@ -3026,14 +3026,14 @@ XLineAttrSetItem* XLineAttrSetItem::Clone( SfxItemPool* pPool ) const } /// fill attribute set item -XFillAttrSetItem::XFillAttrSetItem( std::unique_ptr<SfxItemSet>&& pItemSet ) : +XFillAttrSetItem::XFillAttrSetItem( SfxItemSet&& pItemSet ) : SfxSetItem( XATTRSET_FILL, std::move(pItemSet)) { } XFillAttrSetItem::XFillAttrSetItem( SfxItemPool* pItemPool ) : SfxSetItem( XATTRSET_FILL, - std::make_unique<SfxItemSet>( *pItemPool, svl::Items<XATTR_FILL_FIRST, XATTR_FILL_LAST>{})) + SfxItemSet( *pItemPool, svl::Items<XATTR_FILL_FIRST, XATTR_FILL_LAST>{})) { } diff --git a/svx/source/xoutdev/xpool.cxx b/svx/source/xoutdev/xpool.cxx index bff5490aa565..928098ceca68 100644 --- a/svx/source/xoutdev/xpool.cxx +++ b/svx/source/xoutdev/xpool.cxx @@ -141,10 +141,10 @@ XOutdevItemPool::XOutdevItemPool(SfxItemPool* _pMaster) // create SetItems rPoolDefaults[XATTRSET_LINE - XATTR_START] = new XLineAttrSetItem( - std::make_unique<SfxItemSet>( + SfxItemSet( *_pMaster, svl::Items<XATTR_LINE_FIRST, XATTR_LINE_LAST>{})); rPoolDefaults[XATTRSET_FILL - XATTR_START] = new XFillAttrSetItem( - std::make_unique<SfxItemSet>( + SfxItemSet( *_pMaster, svl::Items<XATTR_FILL_FIRST, XATTR_FILL_LAST>{})); // create ItemInfos |