summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-10-20 08:42:56 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-10-20 09:58:40 +0200
commitfcbe87abb87bc26f6a57ee246e7fb7e865766067 (patch)
tree47e26df2506c3e2d2ec06992efa891cb80e84c94
parent45f5c1941a21a932cfd758106a694af3b230ce20 (diff)
fix regression in "Format - 3D Effects"
assert at svl/source/items/itemset.cxx:1302: SfxItemSet SfxItemSet::CloneAsValue(bool, SfxItemPool *) const: Assertion `(typeid(*this) == typeid(SfxItemSet)) && "cannot call this on a subclass of SfxItemSet"' failed. This hits in Draw when drawing a rectangle, then "Shape - Convert - To 3D", then "Format - 3D Effects". regression from commit 31e7845339b30a69f06a04619660398fe4267268 Author: Noel Grandin <noel.grandin@collabora.co.uk> Date: Thu Feb 17 12:19:49 2022 +0200 use more SfxItemSet::CloneAsValue Change-Id: I36af83fc04636aecefc89e2654929112051fb217 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141542 Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--svx/source/sdr/properties/e3dsceneproperties.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/svx/source/sdr/properties/e3dsceneproperties.cxx b/svx/source/sdr/properties/e3dsceneproperties.cxx
index c156db33e029..b2380468c671 100644
--- a/svx/source/sdr/properties/e3dsceneproperties.cxx
+++ b/svx/source/sdr/properties/e3dsceneproperties.cxx
@@ -115,14 +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
- SfxItemSet aNewSet(rSet.CloneAsValue());
+ std::unique_ptr<SfxItemSet> xNewSet(rSet.Clone());
for(sal_uInt16 b(SDRATTR_3DSCENE_FIRST); b <= SDRATTR_3DSCENE_LAST; b++)
{
- aNewSet.ClearItem(b);
+ xNewSet->ClearItem(b);
}
- if(aNewSet.Count())
+ if(xNewSet->Count())
{
for(size_t a = 0; a < nCount; ++a)
{
@@ -131,7 +131,7 @@ namespace sdr::properties
if(dynamic_cast<const E3dCompoundObject* >(pObj))
{
// set merged ItemSet at contained 3d object.
- pObj->SetMergedItemSet(aNewSet, bClearAllItems);
+ pObj->SetMergedItemSet(*xNewSet, bClearAllItems);
}
}
}