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 /sc/source/ui | |
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 'sc/source/ui')
-rw-r--r-- | sc/source/ui/Accessibility/AccessibleText.cxx | 9 | ||||
-rw-r--r-- | sc/source/ui/pagedlg/tphfedit.cxx | 9 | ||||
-rw-r--r-- | sc/source/ui/unoobj/textuno.cxx | 9 | ||||
-rw-r--r-- | sc/source/ui/view/formatsh.cxx | 3 | ||||
-rw-r--r-- | sc/source/ui/view/printfun.cxx | 9 | ||||
-rw-r--r-- | sc/source/ui/view/viewutil.cxx | 3 |
6 files changed, 14 insertions, 28 deletions
diff --git a/sc/source/ui/Accessibility/AccessibleText.cxx b/sc/source/ui/Accessibility/AccessibleText.cxx index 0e6d2dfb8320..acacc91ba421 100644 --- a/sc/source/ui/Accessibility/AccessibleText.cxx +++ b/sc/source/ui/Accessibility/AccessibleText.cxx @@ -1132,12 +1132,9 @@ SvxTextForwarder* ScAccessibleHeaderTextData::GetTextForwarder() rPattern.FillEditItemSet( &aDefaults ); // FillEditItemSet adjusts font height to 1/100th mm, // but for header/footer twips is needed, as in the PatternAttr: - std::unique_ptr<SfxPoolItem> pNewItem(rPattern.GetItem(ATTR_FONT_HEIGHT).CloneSetWhich(EE_CHAR_FONTHEIGHT)); - aDefaults.Put( *pNewItem ); - pNewItem = rPattern.GetItem(ATTR_CJK_FONT_HEIGHT).CloneSetWhich(EE_CHAR_FONTHEIGHT_CJK); - aDefaults.Put( *pNewItem ); - pNewItem = rPattern.GetItem(ATTR_CTL_FONT_HEIGHT).CloneSetWhich(EE_CHAR_FONTHEIGHT_CTL); - aDefaults.Put( *pNewItem ); + aDefaults.Put( rPattern.GetItem(ATTR_FONT_HEIGHT).CloneSetWhich(EE_CHAR_FONTHEIGHT) ); + aDefaults.Put( rPattern.GetItem(ATTR_CJK_FONT_HEIGHT).CloneSetWhich(EE_CHAR_FONTHEIGHT_CJK) ); + aDefaults.Put( rPattern.GetItem(ATTR_CTL_FONT_HEIGHT).CloneSetWhich(EE_CHAR_FONTHEIGHT_CTL) ); aDefaults.Put( SvxAdjustItem( meAdjust, EE_PARA_JUST ) ); pHdrEngine->SetDefaults( aDefaults ); diff --git a/sc/source/ui/pagedlg/tphfedit.cxx b/sc/source/ui/pagedlg/tphfedit.cxx index 583394658f74..8f647e26e579 100644 --- a/sc/source/ui/pagedlg/tphfedit.cxx +++ b/sc/source/ui/pagedlg/tphfedit.cxx @@ -182,12 +182,9 @@ void ScEditWindow::SetFont( const ScPatternAttr& rPattern ) rPattern.FillEditItemSet( pSet ); // FillEditItemSet adjusts font height to 1/100th mm, // but for header/footer twips is needed, as in the PatternAttr: - std::unique_ptr<SfxPoolItem> pNewItem(rPattern.GetItem(ATTR_FONT_HEIGHT).CloneSetWhich(EE_CHAR_FONTHEIGHT)); - pSet->Put( *pNewItem ); - pNewItem = rPattern.GetItem(ATTR_CJK_FONT_HEIGHT).CloneSetWhich(EE_CHAR_FONTHEIGHT_CJK); - pSet->Put( *pNewItem ); - pNewItem = rPattern.GetItem(ATTR_CTL_FONT_HEIGHT).CloneSetWhich(EE_CHAR_FONTHEIGHT_CTL); - pSet->Put( *pNewItem ); + pSet->Put( rPattern.GetItem(ATTR_FONT_HEIGHT).CloneSetWhich(EE_CHAR_FONTHEIGHT) ); + pSet->Put( rPattern.GetItem(ATTR_CJK_FONT_HEIGHT).CloneSetWhich(EE_CHAR_FONTHEIGHT_CJK) ); + pSet->Put( rPattern.GetItem(ATTR_CTL_FONT_HEIGHT).CloneSetWhich(EE_CHAR_FONTHEIGHT_CTL) ); if (mbRTL) pSet->Put( SvxAdjustItem( SvxAdjust::Right, EE_PARA_JUST ) ); pEdEngine->SetDefaults( pSet ); diff --git a/sc/source/ui/unoobj/textuno.cxx b/sc/source/ui/unoobj/textuno.cxx index f034e1a8f915..5fad23d0df1a 100644 --- a/sc/source/ui/unoobj/textuno.cxx +++ b/sc/source/ui/unoobj/textuno.cxx @@ -219,12 +219,9 @@ SvxTextForwarder* ScHeaderFooterTextData::GetTextForwarder() rPattern.FillEditItemSet( &aDefaults ); // FillEditItemSet adjusts font height to 1/100th mm, // but for header/footer twips is needed, as in the PatternAttr: - std::unique_ptr<SfxPoolItem> pNewItem( rPattern.GetItem(ATTR_FONT_HEIGHT).CloneSetWhich(EE_CHAR_FONTHEIGHT) ); - aDefaults.Put( *pNewItem ); - pNewItem = rPattern.GetItem(ATTR_CJK_FONT_HEIGHT).CloneSetWhich(EE_CHAR_FONTHEIGHT_CJK); - aDefaults.Put( *pNewItem ); - pNewItem = rPattern.GetItem(ATTR_CTL_FONT_HEIGHT).CloneSetWhich(EE_CHAR_FONTHEIGHT_CTL); - aDefaults.Put( *pNewItem ); + aDefaults.Put( rPattern.GetItem(ATTR_FONT_HEIGHT).CloneSetWhich(EE_CHAR_FONTHEIGHT) ); + aDefaults.Put( rPattern.GetItem(ATTR_CJK_FONT_HEIGHT).CloneSetWhich(EE_CHAR_FONTHEIGHT_CJK) ) ; + aDefaults.Put( rPattern.GetItem(ATTR_CTL_FONT_HEIGHT).CloneSetWhich(EE_CHAR_FONTHEIGHT_CTL) ); pHdrEngine->SetDefaults( aDefaults ); ScHeaderFieldData aData; diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx index 0f085f50e913..03fb29f44555 100644 --- a/sc/source/ui/view/formatsh.cxx +++ b/sc/source/ui/view/formatsh.cxx @@ -2210,8 +2210,7 @@ void ScFormatShell::GetAttrState( SfxItemSet& rSet ) break; case SID_ATTR_BRUSH: { - std::unique_ptr<SfxPoolItem> pNewItem(rBrushItem.CloneSetWhich(GetPool().GetWhich(nWhich))); - rSet.Put( *pNewItem ); + rSet.Put( rBrushItem.CloneSetWhich(GetPool().GetWhich(nWhich)) ); } break; case SID_SCATTR_CELLPROTECTION: diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx index ca7b8a8e919a..25e9f7e10d73 100644 --- a/sc/source/ui/view/printfun.cxx +++ b/sc/source/ui/view/printfun.cxx @@ -1729,12 +1729,9 @@ void ScPrintFunc::MakeEditEngine() rPattern.FillEditItemSet( pEditDefaults.get() ); // FillEditItemSet adjusts font height to 1/100th mm, // but for header/footer twips is needed, as in the PatternAttr: - std::unique_ptr<SfxPoolItem> pNewItem(rPattern.GetItem(ATTR_FONT_HEIGHT).CloneSetWhich(EE_CHAR_FONTHEIGHT)); - pEditDefaults->Put( *pNewItem ); - pNewItem = rPattern.GetItem(ATTR_CJK_FONT_HEIGHT).CloneSetWhich(EE_CHAR_FONTHEIGHT_CJK); - pEditDefaults->Put( *pNewItem ); - pNewItem = rPattern.GetItem(ATTR_CTL_FONT_HEIGHT).CloneSetWhich(EE_CHAR_FONTHEIGHT_CTL); - pEditDefaults->Put( *pNewItem ); + pEditDefaults->Put( rPattern.GetItem(ATTR_FONT_HEIGHT).CloneSetWhich(EE_CHAR_FONTHEIGHT) ); + pEditDefaults->Put( rPattern.GetItem(ATTR_CJK_FONT_HEIGHT).CloneSetWhich(EE_CHAR_FONTHEIGHT_CJK) ); + pEditDefaults->Put( rPattern.GetItem(ATTR_CTL_FONT_HEIGHT).CloneSetWhich(EE_CHAR_FONTHEIGHT_CTL) ); // don't use font color, because background color is not used //! there's no way to set the background for note pages pEditDefaults->ClearItem( EE_CHAR_COLOR ); diff --git a/sc/source/ui/view/viewutil.cxx b/sc/source/ui/view/viewutil.cxx index 1cfa805b985c..9eb5ea31ee44 100644 --- a/sc/source/ui/view/viewutil.cxx +++ b/sc/source/ui/view/viewutil.cxx @@ -64,8 +64,7 @@ void ScViewUtil::PutItemScript( SfxItemSet& rShellSet, const SfxItemSet& rCoreSe const SfxPoolItem* pI = aSetItem.GetItemOfScript( nScript ); if (pI) { - std::unique_ptr<SfxPoolItem> pNewItem(pI->CloneSetWhich(nWhichId)); - rShellSet.Put( *pNewItem ); + rShellSet.Put( pI->CloneSetWhich(nWhichId) ); } else rShellSet.InvalidateItem( nWhichId ); |