diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-05-08 08:29:46 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-05-09 08:47:50 +0200 |
commit | e0382c3ad7786910bc9aa81cf581798df0f2508c (patch) | |
tree | 6acb0196add99896ced2aa1a76ff5b432bc45401 /editeng/source | |
parent | 38a684f72988f29e1c07bf9fa5a83e275e80e24c (diff) |
avoid copying when placing items into SfxItemSet
Change-Id: I05c627f590e7794c1ba11b66021dc30aa3285eb0
Reviewed-on: https://gerrit.libreoffice.org/71941
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'editeng/source')
-rw-r--r-- | editeng/source/editeng/editdoc.cxx | 5 | ||||
-rw-r--r-- | editeng/source/editeng/editview.cxx | 3 |
2 files changed, 3 insertions, 5 deletions
diff --git a/editeng/source/editeng/editdoc.cxx b/editeng/source/editeng/editdoc.cxx index ef5964c822f5..c416f61125c9 100644 --- a/editeng/source/editeng/editdoc.cxx +++ b/editeng/source/editeng/editdoc.cxx @@ -901,12 +901,11 @@ void ConvertAndPutItems( SfxItemSet& rDest, const SfxItemSet& rSource, const Map std::unique_ptr<SfxPoolItem> pItem(rSource.Get( nSourceWhich ).Clone()); ConvertItem( pItem, eSourceUnit, eDestUnit ); pItem->SetWhich(nWhich); - rDest.Put( *pItem ); + rDest.Put( std::move(pItem) ); } else { - std::unique_ptr<SfxPoolItem> pNewItem(rSource.Get( nSourceWhich ).CloneSetWhich(nWhich)); - rDest.Put( *pNewItem ); + rDest.Put( rSource.Get( nSourceWhich ).CloneSetWhich(nWhich) ); } } } diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx index 0e2dcfd55751..75624ea527d5 100644 --- a/editeng/source/editeng/editview.cxx +++ b/editeng/source/editeng/editview.cxx @@ -1378,8 +1378,7 @@ bool EditView::ChangeFontSize( bool bGrow, SfxItemSet& rSet, const FontList* pFo if( nHeight != static_cast<long>(aFontHeightItem.GetHeight()) ) { aFontHeightItem.SetHeight( nHeight ); - std::unique_ptr<SfxPoolItem> pNewItem(aFontHeightItem.CloneSetWhich(*pWhich)); - rSet.Put( *pNewItem ); + rSet.Put( aFontHeightItem.CloneSetWhich(*pWhich) ); bRet = true; } } |