summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-02-17 12:19:49 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-02-27 19:42:58 +0100
commit31e7845339b30a69f06a04619660398fe4267268 (patch)
tree049ffea6c16bfa05e798ca9dac81aa1a05a17aef /svx
parentc97a3592c78ce276a353f95ce68c70a8a39174a0 (diff)
use more SfxItemSet::CloneAsValue
to reduce heap allocations Change-Id: Ia755c3e7f9610a5441a447cc74ea38ebcef068bc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130066 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/sdr/properties/e3dsceneproperties.cxx9
1 files changed, 4 insertions, 5 deletions
diff --git a/svx/source/sdr/properties/e3dsceneproperties.cxx b/svx/source/sdr/properties/e3dsceneproperties.cxx
index 93d4e2eed9f8..a0887cc15aee 100644
--- a/svx/source/sdr/properties/e3dsceneproperties.cxx
+++ b/svx/source/sdr/properties/e3dsceneproperties.cxx
@@ -115,15 +115,14 @@ namespace sdr::properties
{
// Generate filtered ItemSet which contains all but the SDRATTR_3DSCENE items.
// #i50808# Leak fix, Clone produces a new instance and we get ownership here
- std::unique_ptr<SfxItemSet> pNewSet(rSet.Clone());
- DBG_ASSERT(pNewSet, "E3dSceneProperties::SetMergedItemSet(): Could not clone ItemSet (!)");
+ SfxItemSet aNewSet(rSet.CloneAsValue());
for(sal_uInt16 b(SDRATTR_3DSCENE_FIRST); b <= SDRATTR_3DSCENE_LAST; b++)
{
- pNewSet->ClearItem(b);
+ aNewSet.ClearItem(b);
}
- if(pNewSet->Count())
+ if(aNewSet.Count())
{
for(size_t a = 0; a < nCount; ++a)
{
@@ -132,7 +131,7 @@ namespace sdr::properties
if(dynamic_cast<const E3dCompoundObject* >(pObj))
{
// set merged ItemSet at contained 3d object.
- pObj->SetMergedItemSet(*pNewSet, bClearAllItems);
+ pObj->SetMergedItemSet(aNewSet, bClearAllItems);
}
}
}