summaryrefslogtreecommitdiff
path: root/sc/source/filter
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-05-08 08:29:46 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-05-09 08:47:50 +0200
commite0382c3ad7786910bc9aa81cf581798df0f2508c (patch)
tree6acb0196add99896ced2aa1a76ff5b432bc45401 /sc/source/filter
parent38a684f72988f29e1c07bf9fa5a83e275e80e24c (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 'sc/source/filter')
-rw-r--r--sc/source/filter/excel/xlroot.cxx9
-rw-r--r--sc/source/filter/ftools/ftools.cxx3
-rw-r--r--sc/source/filter/rtf/eeimpars.cxx20
3 files changed, 12 insertions, 20 deletions
diff --git a/sc/source/filter/excel/xlroot.cxx b/sc/source/filter/excel/xlroot.cxx
index c1044e216115..977f848061d6 100644
--- a/sc/source/filter/excel/xlroot.cxx
+++ b/sc/source/filter/excel/xlroot.cxx
@@ -388,12 +388,9 @@ ScHeaderEditEngine& XclRoot::GetHFEditEngine() const
SfxItemSet aItemSet( *GetDoc().GetPool(), svl::Items<ATTR_PATTERN_START, ATTR_PATTERN_END>{} );
ScPatternAttr::FillToEditItemSet( *pEditSet, aItemSet );
// FillToEditItemSet() adjusts font height to 1/100th mm, we need twips
- std::unique_ptr<SfxPoolItem> pNewItem( aItemSet.Get( ATTR_FONT_HEIGHT ).CloneSetWhich(EE_CHAR_FONTHEIGHT));
- pEditSet->Put( *pNewItem );
- pNewItem = aItemSet.Get( ATTR_CJK_FONT_HEIGHT ).CloneSetWhich(EE_CHAR_FONTHEIGHT_CJK);
- pEditSet->Put( *pNewItem );
- pNewItem = aItemSet.Get( ATTR_CTL_FONT_HEIGHT ).CloneSetWhich(EE_CHAR_FONTHEIGHT_CTL);
- pEditSet->Put( *pNewItem );
+ pEditSet->Put( aItemSet.Get( ATTR_FONT_HEIGHT ).CloneSetWhich(EE_CHAR_FONTHEIGHT) );
+ pEditSet->Put( aItemSet.Get( ATTR_CJK_FONT_HEIGHT ).CloneSetWhich(EE_CHAR_FONTHEIGHT_CJK) );
+ pEditSet->Put( aItemSet.Get( ATTR_CTL_FONT_HEIGHT ).CloneSetWhich(EE_CHAR_FONTHEIGHT_CTL) );
rEE.SetDefaults( pEditSet ); // takes ownership
}
return *mrData.mxHFEditEngine;
diff --git a/sc/source/filter/ftools/ftools.cxx b/sc/source/filter/ftools/ftools.cxx
index 8f9eaed44279..c34c446ea482 100644
--- a/sc/source/filter/ftools/ftools.cxx
+++ b/sc/source/filter/ftools/ftools.cxx
@@ -211,8 +211,7 @@ void ScfTools::PutItem( SfxItemSet& rItemSet, const SfxPoolItem& rItem, sal_uInt
{
if( !bSkipPoolDef || (rItem != rItemSet.GetPool()->GetDefaultItem( nWhichId )) )
{
- std::unique_ptr<SfxPoolItem> pNewItem(rItem.CloneSetWhich(nWhichId));
- rItemSet.Put( *pNewItem );
+ rItemSet.Put( rItem.CloneSetWhich(nWhichId) );
}
}
diff --git a/sc/source/filter/rtf/eeimpars.cxx b/sc/source/filter/rtf/eeimpars.cxx
index 3f3710326292..f6f27d1b061c 100644
--- a/sc/source/filter/rtf/eeimpars.cxx
+++ b/sc/source/filter/rtf/eeimpars.cxx
@@ -271,27 +271,23 @@ void ScEEImport::WriteToDocument( bool bSizeColsRows, double nOutputFactor, SvNu
{
if ( pFont )
{
- std::unique_ptr<SfxPoolItem> pNewItem(pFont->CloneSetWhich(
- ScGlobal::GetScriptedWhichID(nScript, ATTR_FONT )));
- pAttrItemSet->Put( *pNewItem );
+ pAttrItemSet->Put( pFont->CloneSetWhich(
+ ScGlobal::GetScriptedWhichID(nScript, ATTR_FONT )) );
}
if ( pHeight )
{
- std::unique_ptr<SfxPoolItem> pNewItem(pHeight->CloneSetWhich(
- ScGlobal::GetScriptedWhichID(nScript, ATTR_FONT_HEIGHT )));
- pAttrItemSet->Put( *pNewItem );
+ pAttrItemSet->Put( pHeight->CloneSetWhich(
+ ScGlobal::GetScriptedWhichID(nScript, ATTR_FONT_HEIGHT )) );
}
if ( pWeight )
{
- std::unique_ptr<SfxPoolItem> pNewItem(pWeight->CloneSetWhich(
- ScGlobal::GetScriptedWhichID(nScript, ATTR_FONT_WEIGHT )));
- pAttrItemSet->Put( *pNewItem );
+ pAttrItemSet->Put( pWeight->CloneSetWhich(
+ ScGlobal::GetScriptedWhichID(nScript, ATTR_FONT_WEIGHT )) );
}
if ( pPosture )
{
- std::unique_ptr<SfxPoolItem> pNewItem(pPosture->CloneSetWhich(
- ScGlobal::GetScriptedWhichID(nScript, ATTR_FONT_POSTURE )));
- pAttrItemSet->Put( *pNewItem );
+ pAttrItemSet->Put( pPosture->CloneSetWhich(
+ ScGlobal::GetScriptedWhichID(nScript, ATTR_FONT_POSTURE )) );
}
}
}