svx/source/sdr/properties/e3dsceneproperties.cxx |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit fcbe87abb87bc26f6a57ee246e7fb7e865766067
Author:     Noel Grandin <[email protected]>
AuthorDate: Thu Oct 20 08:42:56 2022 +0200
Commit:     Noel Grandin <[email protected]>
CommitDate: Thu Oct 20 09:58:40 2022 +0200

    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 <[email protected]>
        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 <[email protected]>
    Reviewed-by: Noel Grandin <[email protected]>

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);
                         }
                     }
                 }

Reply via email to