summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-06-02 09:13:02 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-06-02 10:45:44 +0200
commite6de84d46c2a41fc4ae53e2744d432e50c4a4ac1 (patch)
tree6be38c21e699cf240ff4b5eb3dd38e251dda96b5 /editeng
parent1577c0dc30ed3c9db361fb989e41a3e9d6c45dfa (diff)
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 <noel.grandin@collabora.co.uk>
Diffstat (limited to 'editeng')
-rw-r--r--editeng/source/items/textitem.cxx10
-rw-r--r--editeng/source/rtf/rtfitem.cxx6
-rw-r--r--editeng/source/uno/unoipset.cxx2
3 files changed, 7 insertions, 11 deletions
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<SfxPoolItem> 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));
}
}