From e6de84d46c2a41fc4ae53e2744d432e50c4a4ac1 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 2 Jun 2022 09:13:02 +0200 Subject: std::move SfxPoolItem into SfxItemSet where possible found with the help of a temporary loplugin (which i have put into the store/ folder) Change-Id: Ide40d09bef6993ace50039a8fd0439b7e29c09a6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135288 Tested-by: Jenkins Reviewed-by: Noel Grandin --- editeng/source/items/textitem.cxx | 10 +++------- editeng/source/rtf/rtfitem.cxx | 6 +++--- editeng/source/uno/unoipset.cxx | 2 +- 3 files changed, 7 insertions(+), 11 deletions(-) (limited to 'editeng') diff --git a/editeng/source/items/textitem.cxx b/editeng/source/items/textitem.cxx index 72b982b73ff9..df06cfd03ad8 100644 --- a/editeng/source/items/textitem.cxx +++ b/editeng/source/items/textitem.cxx @@ -2620,21 +2620,17 @@ void SvxScriptSetItem::PutItemForScriptType( SvtScriptType nScriptType, sal_uInt16 nLatin, nAsian, nComplex; GetWhichIds( nLatin, nAsian, nComplex ); - std::unique_ptr pCpy(rItem.Clone()); if( SvtScriptType::LATIN & nScriptType ) { - pCpy->SetWhich( nLatin ); - GetItemSet().Put( *pCpy ); + GetItemSet().Put( rItem.CloneSetWhich(nLatin) ); } if( SvtScriptType::ASIAN & nScriptType ) { - pCpy->SetWhich( nAsian ); - GetItemSet().Put( *pCpy ); + GetItemSet().Put( rItem.CloneSetWhich(nAsian) ); } if( SvtScriptType::COMPLEX & nScriptType ) { - pCpy->SetWhich( nComplex ); - GetItemSet().Put( *pCpy ); + GetItemSet().Put( rItem.CloneSetWhich(nComplex) ); } } diff --git a/editeng/source/rtf/rtfitem.cxx b/editeng/source/rtf/rtfitem.cxx index 1434657f7fdc..b74b118791d1 100644 --- a/editeng/source/rtf/rtfitem.cxx +++ b/editeng/source/rtf/rtfitem.cxx @@ -775,7 +775,7 @@ ATTR_SETUNDERLINE: aUL->SetColor(GetColor(sal_uInt16(nTokenValue))); - pSet->Put(*aUL); + pSet->Put(std::move(aUL)); } break; @@ -876,7 +876,7 @@ ATTR_SETOVERLINE: aOL->SetColor(GetColor(sal_uInt16(nTokenValue))); - pSet->Put(*aOL); + pSet->Put(std::move(aOL)); } break; @@ -1529,7 +1529,7 @@ void SvxRTFParser::ReadBorderAttr( int nToken, SfxItemSet& rSet, SetBorderLine( nBorderTyp, *aAttr, aBrd ); - rSet.Put( *aAttr ); + rSet.Put( std::move(aAttr) ); SkipToken(); } diff --git a/editeng/source/uno/unoipset.cxx b/editeng/source/uno/unoipset.cxx index da068755ce8d..2aa7e5746cbc 100644 --- a/editeng/source/uno/unoipset.cxx +++ b/editeng/source/uno/unoipset.cxx @@ -142,7 +142,7 @@ void SvxItemPropertySet::setPropertyValue( const SfxItemPropertyMapEntry* pMap, { // Set new item in item set pNewItem->SetWhich(pMap->nWID); - rSet.Put(*pNewItem); + rSet.Put(std::move(pNewItem)); } } -- cgit