include/svl/itemset.hxx                             |    2 +
 include/svx/sdr/properties/defaultproperties.hxx    |    9 +++--
 include/svx/sdr/properties/properties.hxx           |    2 -
 svl/source/items/itemset.cxx                        |   32 ++++++++++++++++++++
 svx/inc/sdr/properties/attributeproperties.hxx      |    2 -
 svx/inc/sdr/properties/captionproperties.hxx        |    2 -
 svx/inc/sdr/properties/circleproperties.hxx         |    2 -
 svx/inc/sdr/properties/connectorproperties.hxx      |    2 -
 svx/inc/sdr/properties/customshapeproperties.hxx    |    2 -
 svx/inc/sdr/properties/e3dproperties.hxx            |    2 -
 svx/inc/sdr/properties/emptyproperties.hxx          |    6 +--
 svx/inc/sdr/properties/graphicproperties.hxx        |    2 -
 svx/inc/sdr/properties/groupproperties.hxx          |    2 -
 svx/inc/sdr/properties/measureproperties.hxx        |    2 -
 svx/inc/sdr/properties/pageproperties.hxx           |    2 -
 svx/inc/sdr/properties/textproperties.hxx           |    2 -
 svx/source/sdr/properties/attributeproperties.cxx   |   30 +++++++++---------
 svx/source/sdr/properties/captionproperties.cxx     |    6 +--
 svx/source/sdr/properties/circleproperties.cxx      |   10 +++---
 svx/source/sdr/properties/connectorproperties.cxx   |    4 +-
 svx/source/sdr/properties/customshapeproperties.cxx |    8 ++---
 svx/source/sdr/properties/defaultproperties.cxx     |   32 ++++++++++----------
 svx/source/sdr/properties/e3dcompoundproperties.cxx |    6 +--
 svx/source/sdr/properties/e3dproperties.cxx         |    4 +-
 svx/source/sdr/properties/e3dsceneproperties.cxx    |   20 ++++++------
 svx/source/sdr/properties/emptyproperties.cxx       |   12 +++----
 svx/source/sdr/properties/graphicproperties.cxx     |   24 +++++++--------
 svx/source/sdr/properties/groupproperties.cxx       |   14 ++++----
 svx/source/sdr/properties/measureproperties.cxx     |   16 +++++-----
 svx/source/sdr/properties/pageproperties.cxx        |   16 +++++-----
 svx/source/sdr/properties/textproperties.cxx        |   22 ++++++-------
 svx/source/table/cell.cxx                           |    8 ++---
 svx/source/table/svdotable.cxx                      |    6 +--
 33 files changed, 173 insertions(+), 138 deletions(-)

New commits:
commit cd073a4a945a527cec3080523a0d7ec42bc49b26
Author:     Noel Grandin <noelgran...@gmail.com>
AuthorDate: Mon Apr 19 17:07:50 2021 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Mon Apr 19 21:48:06 2021 +0200

    svx properties: pass SfxItemSet around by value
    
    so we avoid heap allocation costs when loading lots of shapes
    
    Change-Id: I0de5819acc7f845973a284e68ab709989f27d402
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114297
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/include/svl/itemset.hxx b/include/svl/itemset.hxx
index 94ee142a2e77..41a782d7966f 100644
--- a/include/svl/itemset.hxx
+++ b/include/svl/itemset.hxx
@@ -125,6 +125,7 @@ public:
     virtual                     ~SfxItemSet();
 
     virtual std::unique_ptr<SfxItemSet> Clone(bool bItems = true, SfxItemPool 
*pToPool = nullptr) const;
+    virtual SfxItemSet CloneAsValue(bool bItems = true, SfxItemPool *pToPool = 
nullptr) const;
 
     // Get number of items
     sal_uInt16                  Count() const { return m_nCount; }
@@ -256,6 +257,7 @@ public:
                                 SfxAllItemSet( const SfxAllItemSet & );
 
     virtual std::unique_ptr<SfxItemSet> Clone( bool bItems = true, SfxItemPool 
*pToPool = nullptr ) const override;
+    virtual SfxItemSet CloneAsValue( bool bItems = true, SfxItemPool *pToPool 
= nullptr ) const override;
 protected:
     virtual const SfxPoolItem*  PutImpl( const SfxPoolItem&, sal_uInt16 
nWhich, bool bPassingOwnership ) override;
 };
diff --git a/include/svx/sdr/properties/defaultproperties.hxx 
b/include/svx/sdr/properties/defaultproperties.hxx
index c9c4fdc5ec59..e901278d3b3e 100644
--- a/include/svx/sdr/properties/defaultproperties.hxx
+++ b/include/svx/sdr/properties/defaultproperties.hxx
@@ -22,10 +22,11 @@
 
 #include <sal/config.h>
 
-#include <memory>
+#include <optional>
 
 #include <svx/sdr/properties/properties.hxx>
 #include <svx/svxdllapi.h>
+#include <svl/itemset.hxx>
 
 struct _xmlTextWriter;
 typedef struct _xmlTextWriter* xmlTextWriterPtr;
@@ -36,10 +37,10 @@ namespace sdr::properties
         {
         protected:
             // the to be used ItemSet
-            std::unique_ptr<SfxItemSet> mpItemSet;
+            mutable std::optional<SfxItemSet> mxItemSet;
 
             // create a new itemset
-            virtual std::unique_ptr<SfxItemSet> 
CreateObjectSpecificItemSet(SfxItemPool& rPool) override;
+            virtual SfxItemSet CreateObjectSpecificItemSet(SfxItemPool& rPool) 
override;
 
             // test changeability for a single item
             virtual bool AllowItemChange(const sal_uInt16 nWhich, const 
SfxPoolItem* pNewItem = nullptr) const override;
@@ -54,7 +55,7 @@ namespace sdr::properties
             virtual void ItemSetChanged(const SfxItemSet& rSet) override;
 
             // check if SfxItemSet exists
-            bool HasSfxItemSet() const { return bool(mpItemSet); }
+            bool HasSfxItemSet() const { return bool(mxItemSet); }
 
         public:
             // basic constructor
diff --git a/include/svx/sdr/properties/properties.hxx 
b/include/svx/sdr/properties/properties.hxx
index db40737756ca..600522981dc0 100644
--- a/include/svx/sdr/properties/properties.hxx
+++ b/include/svx/sdr/properties/properties.hxx
@@ -84,7 +84,7 @@ namespace sdr::properties
             virtual void applyDefaultStyleSheetFromSdrModel();
 
             // create a new object specific itemset with object specific 
ranges.
-            virtual std::unique_ptr<SfxItemSet> 
CreateObjectSpecificItemSet(SfxItemPool& pPool) = 0;
+            virtual SfxItemSet CreateObjectSpecificItemSet(SfxItemPool& pPool) 
= 0;
 
             // internal access to SdrObject
             const SdrObject& GetSdrObject() const;
diff --git a/svl/source/items/itemset.cxx b/svl/source/items/itemset.cxx
index 883caf50d9d9..dea82de88d64 100644
--- a/svl/source/items/itemset.cxx
+++ b/svl/source/items/itemset.cxx
@@ -1459,6 +1459,31 @@ std::unique_ptr<SfxItemSet> SfxItemSet::Clone(bool 
bItems, SfxItemPool *pToPool
                 : new SfxItemSet(*m_pPool, m_pWhichRanges));
 }
 
+SfxItemSet SfxItemSet::CloneAsValue(bool bItems, SfxItemPool *pToPool ) const
+{
+    if (pToPool && pToPool != m_pPool)
+    {
+        SfxItemSet aNewSet(*pToPool, m_pWhichRanges);
+        if ( bItems )
+        {
+            SfxWhichIter aIter(aNewSet);
+            sal_uInt16 nWhich = aIter.FirstWhich();
+            while ( nWhich )
+            {
+                const SfxPoolItem* pItem;
+                if ( SfxItemState::SET == GetItemState( nWhich, false, &pItem 
) )
+                    aNewSet.Put( *pItem, pItem->Which() );
+                nWhich = aIter.NextWhich();
+            }
+        }
+        return aNewSet;
+    }
+    else
+        return bItems
+                ? *this
+                : SfxItemSet(*m_pPool, m_pWhichRanges);
+}
+
 void SfxItemSet::PutDirect(const SfxPoolItem &rItem)
 {
     SfxPoolItem const** ppFnd = m_pItems.get();
@@ -1742,4 +1767,11 @@ std::unique_ptr<SfxItemSet> SfxAllItemSet::Clone(bool 
bItems, SfxItemPool *pToPo
         return std::unique_ptr<SfxItemSet>(bItems ? new SfxAllItemSet(*this) : 
new SfxAllItemSet(*m_pPool));
 }
 
+SfxItemSet SfxAllItemSet::CloneAsValue(bool , SfxItemPool * ) const
+{
+    // if you are trying to clone, then the thing you are cloning is 
polymorphic, which means
+    // it cannot be cloned as a value
+    throw std::logic_error("cannot do this");
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/inc/sdr/properties/attributeproperties.hxx 
b/svx/inc/sdr/properties/attributeproperties.hxx
index f425983d8fb4..9633257c5a63 100644
--- a/svx/inc/sdr/properties/attributeproperties.hxx
+++ b/svx/inc/sdr/properties/attributeproperties.hxx
@@ -43,7 +43,7 @@ namespace sdr::properties
             SfxStyleSheet*                                  mpStyleSheet;
 
             // create a new itemset
-            virtual std::unique_ptr<SfxItemSet> 
CreateObjectSpecificItemSet(SfxItemPool& pPool) override;
+            virtual SfxItemSet CreateObjectSpecificItemSet(SfxItemPool& pPool) 
override;
 
             // Do the ItemChange, may do special handling
             virtual void ItemChange(const sal_uInt16 nWhich, const 
SfxPoolItem* pNewItem = nullptr) override;
diff --git a/svx/inc/sdr/properties/captionproperties.hxx 
b/svx/inc/sdr/properties/captionproperties.hxx
index 6a4a2d91b635..c6f71529e181 100644
--- a/svx/inc/sdr/properties/captionproperties.hxx
+++ b/svx/inc/sdr/properties/captionproperties.hxx
@@ -28,7 +28,7 @@ namespace sdr::properties
         class CaptionProperties final : public RectangleProperties
         {
             // create a new itemset
-            virtual std::unique_ptr<SfxItemSet> 
CreateObjectSpecificItemSet(SfxItemPool& rPool) override;
+            virtual SfxItemSet CreateObjectSpecificItemSet(SfxItemPool& rPool) 
override;
 
             // react on ItemSet changes
             virtual void ItemSetChanged(const SfxItemSet& rSet) override;
diff --git a/svx/inc/sdr/properties/circleproperties.hxx 
b/svx/inc/sdr/properties/circleproperties.hxx
index fc06fe82a5f0..2227817d1b49 100644
--- a/svx/inc/sdr/properties/circleproperties.hxx
+++ b/svx/inc/sdr/properties/circleproperties.hxx
@@ -28,7 +28,7 @@ namespace sdr::properties
         class CircleProperties final : public RectangleProperties
         {
             // create a new itemset
-            virtual std::unique_ptr<SfxItemSet> 
CreateObjectSpecificItemSet(SfxItemPool& rPool) override;
+            virtual SfxItemSet CreateObjectSpecificItemSet(SfxItemPool& rPool) 
override;
 
             // react on ItemSet changes
             virtual void ItemSetChanged(const SfxItemSet& rSet) override;
diff --git a/svx/inc/sdr/properties/connectorproperties.hxx 
b/svx/inc/sdr/properties/connectorproperties.hxx
index 5afce0b33b70..8d6e14ffb64b 100644
--- a/svx/inc/sdr/properties/connectorproperties.hxx
+++ b/svx/inc/sdr/properties/connectorproperties.hxx
@@ -28,7 +28,7 @@ namespace sdr::properties
         class ConnectorProperties final : public TextProperties
         {
             // create a new itemset
-            virtual std::unique_ptr<SfxItemSet> 
CreateObjectSpecificItemSet(SfxItemPool& rPool) override;
+            virtual SfxItemSet CreateObjectSpecificItemSet(SfxItemPool& rPool) 
override;
 
             // react on ItemSet changes
             virtual void ItemSetChanged(const SfxItemSet& rSet) override;
diff --git a/svx/inc/sdr/properties/customshapeproperties.hxx 
b/svx/inc/sdr/properties/customshapeproperties.hxx
index 1c7ced978997..8fa29e117bd7 100644
--- a/svx/inc/sdr/properties/customshapeproperties.hxx
+++ b/svx/inc/sdr/properties/customshapeproperties.hxx
@@ -31,7 +31,7 @@ namespace sdr::properties
             void UpdateTextFrameStatus(bool bInvalidateRenderGeometry);
 
             // create a new itemset
-            virtual std::unique_ptr<SfxItemSet> 
CreateObjectSpecificItemSet(SfxItemPool& rPool) override;
+            virtual SfxItemSet CreateObjectSpecificItemSet(SfxItemPool& rPool) 
override;
 
             // test changeability for a single item
             virtual bool AllowItemChange(const sal_uInt16 nWhich, const 
SfxPoolItem* pNewItem = nullptr) const override;
diff --git a/svx/inc/sdr/properties/e3dproperties.hxx 
b/svx/inc/sdr/properties/e3dproperties.hxx
index 360a6f998427..cce69e8f9eb1 100644
--- a/svx/inc/sdr/properties/e3dproperties.hxx
+++ b/svx/inc/sdr/properties/e3dproperties.hxx
@@ -29,7 +29,7 @@ namespace sdr::properties
         {
         protected:
             // create a new itemset
-            virtual std::unique_ptr<SfxItemSet> 
CreateObjectSpecificItemSet(SfxItemPool& rPool) override;
+            virtual SfxItemSet CreateObjectSpecificItemSet(SfxItemPool& rPool) 
override;
 
             // react on ItemSet changes
             virtual void ItemSetChanged(const SfxItemSet& rSet) override;
diff --git a/svx/inc/sdr/properties/emptyproperties.hxx 
b/svx/inc/sdr/properties/emptyproperties.hxx
index f482d5f94481..250c23deac0e 100644
--- a/svx/inc/sdr/properties/emptyproperties.hxx
+++ b/svx/inc/sdr/properties/emptyproperties.hxx
@@ -22,7 +22,7 @@
 
 #include <sal/config.h>
 
-#include <memory>
+#include <optional>
 
 #include <svx/sdr/properties/properties.hxx>
 #include <svl/itemset.hxx>
@@ -34,10 +34,10 @@ namespace sdr::properties
         {
         protected:
             // the to be used ItemSet
-            std::unique_ptr<SfxItemSet> mpEmptyItemSet;
+            mutable std::optional<SfxItemSet> mxEmptyItemSet;
 
             // create a new itemset
-            virtual std::unique_ptr<SfxItemSet> 
CreateObjectSpecificItemSet(SfxItemPool& rPool) override;
+            virtual SfxItemSet CreateObjectSpecificItemSet(SfxItemPool& rPool) 
override;
 
             // test changeability for a single item
             virtual bool AllowItemChange(const sal_uInt16 nWhich, const 
SfxPoolItem* pNewItem = nullptr) const override;
diff --git a/svx/inc/sdr/properties/graphicproperties.hxx 
b/svx/inc/sdr/properties/graphicproperties.hxx
index 8587a862a103..3a424f7e921d 100644
--- a/svx/inc/sdr/properties/graphicproperties.hxx
+++ b/svx/inc/sdr/properties/graphicproperties.hxx
@@ -31,7 +31,7 @@ namespace sdr::properties
             virtual void applyDefaultStyleSheetFromSdrModel() override;
 
             // create a new itemset
-            virtual std::unique_ptr<SfxItemSet> 
CreateObjectSpecificItemSet(SfxItemPool& rPool) override;
+            virtual SfxItemSet CreateObjectSpecificItemSet(SfxItemPool& rPool) 
override;
 
             // react on ItemSet changes
             virtual void ItemSetChanged(const SfxItemSet& rSet) override;
diff --git a/svx/inc/sdr/properties/groupproperties.hxx 
b/svx/inc/sdr/properties/groupproperties.hxx
index 2e05027c7192..32fe503d1dd2 100644
--- a/svx/inc/sdr/properties/groupproperties.hxx
+++ b/svx/inc/sdr/properties/groupproperties.hxx
@@ -28,7 +28,7 @@ namespace sdr::properties
         class GroupProperties final : public DefaultProperties
         {
             // create a new itemset
-            virtual std::unique_ptr<SfxItemSet> 
CreateObjectSpecificItemSet(SfxItemPool& rPool) override;
+            virtual SfxItemSet CreateObjectSpecificItemSet(SfxItemPool& rPool) 
override;
 
             // test changeability for a single item
             virtual bool AllowItemChange(const sal_uInt16 nWhich, const 
SfxPoolItem* pNewItem = nullptr) const override;
diff --git a/svx/inc/sdr/properties/measureproperties.hxx 
b/svx/inc/sdr/properties/measureproperties.hxx
index 301661f5a119..77cb253be45a 100644
--- a/svx/inc/sdr/properties/measureproperties.hxx
+++ b/svx/inc/sdr/properties/measureproperties.hxx
@@ -28,7 +28,7 @@ namespace sdr::properties
         class MeasureProperties final : public TextProperties
         {
             // create a new itemset
-            virtual std::unique_ptr<SfxItemSet> 
CreateObjectSpecificItemSet(SfxItemPool& rPool) override;
+            virtual SfxItemSet CreateObjectSpecificItemSet(SfxItemPool& rPool) 
override;
 
             // react on ItemSet changes
             virtual void ItemSetChanged(const SfxItemSet& rSet) override;
diff --git a/svx/inc/sdr/properties/pageproperties.hxx 
b/svx/inc/sdr/properties/pageproperties.hxx
index cc4d21a641e7..7bd5c213fbc4 100644
--- a/svx/inc/sdr/properties/pageproperties.hxx
+++ b/svx/inc/sdr/properties/pageproperties.hxx
@@ -28,7 +28,7 @@ namespace sdr::properties
         class PageProperties final : public EmptyProperties
         {
             // create a new object specific itemset with object specific 
ranges.
-            virtual std::unique_ptr<SfxItemSet> 
CreateObjectSpecificItemSet(SfxItemPool& pPool) override;
+            virtual SfxItemSet CreateObjectSpecificItemSet(SfxItemPool& pPool) 
override;
 
             // Do the ItemChange, may do special handling
             virtual void ItemChange(const sal_uInt16 nWhich, const 
SfxPoolItem* pNewItem = nullptr) override;
diff --git a/svx/inc/sdr/properties/textproperties.hxx 
b/svx/inc/sdr/properties/textproperties.hxx
index 26cc52c96ba6..ea587a8996fb 100644
--- a/svx/inc/sdr/properties/textproperties.hxx
+++ b/svx/inc/sdr/properties/textproperties.hxx
@@ -34,7 +34,7 @@ namespace sdr::properties
 
         protected:
             // create a new itemset
-            virtual std::unique_ptr<SfxItemSet> 
CreateObjectSpecificItemSet(SfxItemPool& rPool) override;
+            virtual SfxItemSet CreateObjectSpecificItemSet(SfxItemPool& rPool) 
override;
 
             // Do the ItemChange, may do special handling
             virtual void ItemChange(const sal_uInt16 nWhich, const 
SfxPoolItem* pNewItem = nullptr) override;
diff --git a/svx/source/sdr/properties/attributeproperties.cxx 
b/svx/source/sdr/properties/attributeproperties.cxx
index e67e560c1505..c61f95354020 100644
--- a/svx/source/sdr/properties/attributeproperties.cxx
+++ b/svx/source/sdr/properties/attributeproperties.cxx
@@ -55,7 +55,7 @@ namespace sdr::properties
                     {
                         if(SfxItemState::SET == rStyle.GetItemState(nWhich))
                         {
-                            mpItemSet->ClearItem(nWhich);
+                            mxItemSet->ClearItem(nWhich);
                         }
 
                         nWhich = aIter.NextWhich();
@@ -63,7 +63,7 @@ namespace sdr::properties
                 }
 
                 // set new stylesheet as parent
-                mpItemSet->SetParent(&mpStyleSheet->GetItemSet());
+                mxItemSet->SetParent(&mpStyleSheet->GetItemSet());
             }
             else
             {
@@ -110,7 +110,7 @@ namespace sdr::properties
                 // reset parent of ItemSet
                 if(HasSfxItemSet())
                 {
-                    mpItemSet->SetParent(nullptr);
+                    mxItemSet->SetParent(nullptr);
                 }
 
                 SdrObject& rObj = GetSdrObject();
@@ -122,9 +122,9 @@ namespace sdr::properties
         }
 
         // create a new itemset
-        std::unique_ptr<SfxItemSet> 
AttributeProperties::CreateObjectSpecificItemSet(SfxItemPool& rPool)
+        SfxItemSet 
AttributeProperties::CreateObjectSpecificItemSet(SfxItemPool& rPool)
         {
-            return std::make_unique<SfxItemSet>(rPool,
+            return SfxItemSet(rPool,
 
                 // ranges from SdrAttrObj
                 svl::Items<SDRATTR_START, SDRATTR_SHADOW_LAST,
@@ -272,7 +272,7 @@ namespace sdr::properties
                 }
             }
 
-            return *mpItemSet;
+            return *mxItemSet;
         }
 
         void AttributeProperties::ItemSetChanged(const SfxItemSet& /*rSet*/)
@@ -339,14 +339,14 @@ namespace sdr::properties
                 if(pResultItem)
                 {
                     // force ItemSet
-                    mpItemSet->Put(*pResultItem);
+                    mxItemSet->Put(*pResultItem);
 
                     // delete item if it was a generated one
                     pResultItem.reset();
                 }
                 else
                 {
-                    mpItemSet->Put(*pNewItem);
+                    mxItemSet->Put(*pNewItem);
                 }
             }
             else
@@ -354,7 +354,7 @@ namespace sdr::properties
                 // clear item if ItemSet exists
                 if(HasSfxItemSet())
                 {
-                    mpItemSet->ClearItem(nWhich);
+                    mxItemSet->ClearItem(nWhich);
                 }
             }
         }
@@ -386,8 +386,8 @@ namespace sdr::properties
             GetObjectItemSet();
 
             // prepare copied, new itemset, but WITHOUT parent
-            SfxItemSet* pDestItemSet = new SfxItemSet(*mpItemSet);
-            pDestItemSet->SetParent(nullptr);
+            SfxItemSet aDestItemSet(*mxItemSet);
+            aDestItemSet.SetParent(nullptr);
 
             // prepare forgetting the current stylesheet like in 
RemoveStyleSheet()
             EndListening(*mpStyleSheet);
@@ -395,7 +395,7 @@ namespace sdr::properties
 
             // prepare the iter; use the mpObjectItemSet which may have less
             // WhichIDs than the style.
-            SfxWhichIter aIter(*pDestItemSet);
+            SfxWhichIter aIter(aDestItemSet);
             sal_uInt16 nWhich(aIter.FirstWhich());
             const SfxPoolItem *pItem = nullptr;
 
@@ -404,16 +404,16 @@ namespace sdr::properties
             {
                 // #i61284# use mpItemSet with parents, makes things easier 
and reduces to
                 // one loop
-                if(SfxItemState::SET == mpItemSet->GetItemState(nWhich, true, 
&pItem))
+                if(SfxItemState::SET == mxItemSet->GetItemState(nWhich, true, 
&pItem))
                 {
-                    pDestItemSet->Put(*pItem);
+                    aDestItemSet.Put(*pItem);
                 }
 
                 nWhich = aIter.NextWhich();
             }
 
             // replace itemsets
-            mpItemSet.reset(pDestItemSet);
+            mxItemSet.emplace(std::move(aDestItemSet));
 
             // set necessary changes like in RemoveStyleSheet()
             GetSdrObject().SetBoundRectDirty();
diff --git a/svx/source/sdr/properties/captionproperties.cxx 
b/svx/source/sdr/properties/captionproperties.cxx
index 0afd70af5234..6f98fdb2a407 100644
--- a/svx/source/sdr/properties/captionproperties.cxx
+++ b/svx/source/sdr/properties/captionproperties.cxx
@@ -30,9 +30,9 @@
 namespace sdr::properties
 {
         // create a new itemset
-        std::unique_ptr<SfxItemSet> 
CaptionProperties::CreateObjectSpecificItemSet(SfxItemPool& rPool)
+        SfxItemSet CaptionProperties::CreateObjectSpecificItemSet(SfxItemPool& 
rPool)
         {
-            return std::make_unique<SfxItemSet>(
+            return SfxItemSet(
                 rPool,
                 svl::Items<
                     // Ranges from SdrAttrObj, SdrCaptionObj:
@@ -92,7 +92,7 @@ namespace sdr::properties
 
             // this was set by TextProperties::ForceDefaultAttributes(),
             // reset to default
-            mpItemSet->ClearItem(XATTR_LINESTYLE);
+            mxItemSet->ClearItem(XATTR_LINESTYLE);
         }
 } // end of namespace
 
diff --git a/svx/source/sdr/properties/circleproperties.cxx 
b/svx/source/sdr/properties/circleproperties.cxx
index b6965fd235bb..08139805228c 100644
--- a/svx/source/sdr/properties/circleproperties.cxx
+++ b/svx/source/sdr/properties/circleproperties.cxx
@@ -32,9 +32,9 @@
 namespace sdr::properties
 {
         // create a new itemset
-        std::unique_ptr<SfxItemSet> 
CircleProperties::CreateObjectSpecificItemSet(SfxItemPool& rPool)
+        SfxItemSet CircleProperties::CreateObjectSpecificItemSet(SfxItemPool& 
rPool)
         {
-            return std::make_unique<SfxItemSet>(
+            return SfxItemSet(
                 rPool,
                 svl::Items<
                     // Ranges from SdrAttrObj, SdrCircObj
@@ -99,16 +99,16 @@ namespace sdr::properties
                 // force ItemSet
                 GetObjectItemSet();
 
-                mpItemSet->Put(SdrCircKindItem(eKind));
+                mxItemSet->Put(SdrCircKindItem(eKind));
 
                 if(rObj.GetStartAngle())
                 {
-                    
mpItemSet->Put(makeSdrCircStartAngleItem(rObj.GetStartAngle()));
+                    
mxItemSet->Put(makeSdrCircStartAngleItem(rObj.GetStartAngle()));
                 }
 
                 if(rObj.GetEndAngle() != 36000_deg100)
                 {
-                    
mpItemSet->Put(makeSdrCircEndAngleItem(rObj.GetEndAngle()));
+                    
mxItemSet->Put(makeSdrCircEndAngleItem(rObj.GetEndAngle()));
                 }
             }
 
diff --git a/svx/source/sdr/properties/connectorproperties.cxx 
b/svx/source/sdr/properties/connectorproperties.cxx
index 29a2b7edeb5f..58e773e91327 100644
--- a/svx/source/sdr/properties/connectorproperties.cxx
+++ b/svx/source/sdr/properties/connectorproperties.cxx
@@ -30,9 +30,9 @@
 namespace sdr::properties
 {
         // create a new itemset
-        std::unique_ptr<SfxItemSet> 
ConnectorProperties::CreateObjectSpecificItemSet(SfxItemPool& rPool)
+        SfxItemSet 
ConnectorProperties::CreateObjectSpecificItemSet(SfxItemPool& rPool)
         {
-            return std::make_unique<SfxItemSet>(
+            return SfxItemSet(
                 rPool,
                 svl::Items<
                     // Ranges from SdrAttrObj, SdrEdgeObj:
diff --git a/svx/source/sdr/properties/customshapeproperties.cxx 
b/svx/source/sdr/properties/customshapeproperties.cxx
index 1d0364941fae..4b372605576d 100644
--- a/svx/source/sdr/properties/customshapeproperties.cxx
+++ b/svx/source/sdr/properties/customshapeproperties.cxx
@@ -59,9 +59,9 @@ namespace sdr::properties
             }
         }
 
-        std::unique_ptr<SfxItemSet> 
CustomShapeProperties::CreateObjectSpecificItemSet(SfxItemPool& rPool)
+        SfxItemSet 
CustomShapeProperties::CreateObjectSpecificItemSet(SfxItemPool& rPool)
         {
-            return std::make_unique<SfxItemSet>(
+            return SfxItemSet(
                 rPool,
                 svl::Items<
                     // Ranges from SdrAttrObj:
@@ -93,7 +93,7 @@ namespace sdr::properties
         {
             if ( !nWhich )
             {
-                SfxWhichIter aIter( *mpItemSet );
+                SfxWhichIter aIter( *mxItemSet );
                 sal_uInt16 nWhich2 = aIter.FirstWhich();
                 while( nWhich2 )
                 {
@@ -111,7 +111,7 @@ namespace sdr::properties
         {
             if ( !nWhich )
             {
-                SfxWhichIter aIter( *mpItemSet );
+                SfxWhichIter aIter( *mxItemSet );
                 sal_uInt16 nWhich2 = aIter.FirstWhich();
                 while( nWhich2 )
                 {
diff --git a/svx/source/sdr/properties/defaultproperties.cxx 
b/svx/source/sdr/properties/defaultproperties.cxx
index 0e459d87f9ad..b12e7bd5b82d 100644
--- a/svx/source/sdr/properties/defaultproperties.cxx
+++ b/svx/source/sdr/properties/defaultproperties.cxx
@@ -34,10 +34,10 @@
 
 namespace sdr::properties
 {
-        std::unique_ptr<SfxItemSet> 
DefaultProperties::CreateObjectSpecificItemSet(SfxItemPool& rPool)
+        SfxItemSet DefaultProperties::CreateObjectSpecificItemSet(SfxItemPool& 
rPool)
         {
             // Basic implementation; Basic object has NO attributes
-            return std::make_unique<SfxItemSet>(rPool);
+            return SfxItemSet(rPool);
         }
 
         DefaultProperties::DefaultProperties(SdrObject& rObj)
@@ -48,15 +48,15 @@ namespace sdr::properties
         DefaultProperties::DefaultProperties(const DefaultProperties& rProps, 
SdrObject& rObj)
         :   BaseProperties(rObj)
         {
-            if(!rProps.mpItemSet)
+            if(!rProps.mxItemSet)
                 return;
 
             // Clone may be to another model and thus another ItemPool.
             // SfxItemSet supports that thus we are able to Clone all
             // SfxItemState::SET items to the target pool.
-            mpItemSet = rProps.mpItemSet->Clone(
+            mxItemSet.emplace(rProps.mxItemSet->CloneAsValue(
                 true,
-                &rObj.getSdrModelFromSdrObject().GetItemPool());
+                &rObj.getSdrModelFromSdrObject().GetItemPool()));
 
             // React on ModelChange: If metric has changed, scale items.
             // As seen above, clone is supported, but scale is not included,
@@ -74,15 +74,15 @@ namespace sdr::properties
                 {
                     const Fraction aMetricFactor(GetMapFactor(aOldUnit, 
aNewUnit).X());
 
-                    ScaleItemSet(*mpItemSet, aMetricFactor);
+                    ScaleItemSet(*mxItemSet, aMetricFactor);
                 }
             }
 
             // do not keep parent info, this may be changed by later 
constructors.
             // This class just copies the ItemSet, ignore parent.
-            if(mpItemSet && mpItemSet->GetParent())
+            if(mxItemSet && mxItemSet->GetParent())
             {
-                mpItemSet->SetParent(nullptr);
+                mxItemSet->SetParent(nullptr);
             }
         }
 
@@ -95,15 +95,15 @@ namespace sdr::properties
 
         const SfxItemSet& DefaultProperties::GetObjectItemSet() const
         {
-            if(!mpItemSet)
+            if(!mxItemSet)
             {
-                const_cast<DefaultProperties*>(this)->mpItemSet = 
const_cast<DefaultProperties*>(this)->CreateObjectSpecificItemSet(GetSdrObject().GetObjectItemPool());
+                
mxItemSet.emplace(const_cast<DefaultProperties*>(this)->CreateObjectSpecificItemSet(GetSdrObject().GetObjectItemPool()));
                 const_cast<DefaultProperties*>(this)->ForceDefaultAttributes();
             }
 
-            assert(mpItemSet && "Could not create an SfxItemSet(!)");
+            assert(mxItemSet && "Could not create an SfxItemSet(!)");
 
-            return *mpItemSet;
+            return *mxItemSet;
         }
 
         void DefaultProperties::SetObjectItem(const SfxPoolItem& rItem)
@@ -223,8 +223,8 @@ namespace sdr::properties
 
         void DefaultProperties::PostItemChange(const sal_uInt16 nWhich )
         {
-            if( (nWhich == XATTR_FILLSTYLE) && (mpItemSet != nullptr) )
-                CleanupFillProperties(*mpItemSet);
+            if( (nWhich == XATTR_FILLSTYLE) && mxItemSet )
+                CleanupFillProperties(*mxItemSet);
         }
 
         void DefaultProperties::SetStyleSheet(SfxStyleSheet* 
/*pNewStyleSheet*/, bool /*bDontRemoveHardAttr*/)
@@ -246,9 +246,9 @@ namespace sdr::properties
         {
             (void)xmlTextWriterStartElement(pWriter, 
BAD_CAST("DefaultProperties"));
             BaseProperties::dumpAsXml(pWriter);
-            if (mpItemSet)
+            if (mxItemSet)
             {
-                mpItemSet->dumpAsXml(pWriter);
+                mxItemSet->dumpAsXml(pWriter);
             }
             (void)xmlTextWriterEndElement(pWriter);
         }
diff --git a/svx/source/sdr/properties/e3dcompoundproperties.cxx 
b/svx/source/sdr/properties/e3dcompoundproperties.cxx
index 8d023d033c64..8b6d1f5f60e2 100644
--- a/svx/source/sdr/properties/e3dcompoundproperties.cxx
+++ b/svx/source/sdr/properties/e3dcompoundproperties.cxx
@@ -56,9 +56,9 @@ namespace sdr::properties
                 GetObjectItemSet();
 
                 // add filtered scene properties (SDRATTR_3DSCENE_) to local 
itemset
-                SfxItemSet aSet(*mpItemSet->GetPool(), 
svl::Items<SDRATTR_3DSCENE_FIRST, SDRATTR_3DSCENE_LAST>{});
+                SfxItemSet aSet(*mxItemSet->GetPool(), 
svl::Items<SDRATTR_3DSCENE_FIRST, SDRATTR_3DSCENE_LAST>{});
                 aSet.Put(pScene->GetProperties().GetObjectItemSet());
-                mpItemSet->Put(aSet);
+                mxItemSet->Put(aSet);
             }
 
             // call parent
@@ -77,7 +77,7 @@ namespace sdr::properties
                 GetObjectItemSet();
 
                 // Generate filtered scene properties (SDRATTR_3DSCENE_) 
itemset
-                SfxItemSet aSet(*mpItemSet->GetPool(), 
svl::Items<SDRATTR_3DSCENE_FIRST, SDRATTR_3DSCENE_LAST>{});
+                SfxItemSet aSet(*mxItemSet->GetPool(), 
svl::Items<SDRATTR_3DSCENE_FIRST, SDRATTR_3DSCENE_LAST>{});
                 aSet.Put(rSet);
 
                 if(bClearAllItems)
diff --git a/svx/source/sdr/properties/e3dproperties.cxx 
b/svx/source/sdr/properties/e3dproperties.cxx
index 0f435fd99c7f..393b3c9f072c 100644
--- a/svx/source/sdr/properties/e3dproperties.cxx
+++ b/svx/source/sdr/properties/e3dproperties.cxx
@@ -28,9 +28,9 @@
 namespace sdr::properties
 {
         // create a new itemset
-        std::unique_ptr<SfxItemSet> 
E3dProperties::CreateObjectSpecificItemSet(SfxItemPool& rPool)
+        SfxItemSet E3dProperties::CreateObjectSpecificItemSet(SfxItemPool& 
rPool)
         {
-            return std::make_unique<SfxItemSet>(rPool,
+            return SfxItemSet(rPool,
 
                 // ranges from SdrAttrObj
                 svl::Items<SDRATTR_START, SDRATTR_SHADOW_LAST,
diff --git a/svx/source/sdr/properties/e3dsceneproperties.cxx 
b/svx/source/sdr/properties/e3dsceneproperties.cxx
index e4ebfe194e4c..7635f32f806d 100644
--- a/svx/source/sdr/properties/e3dsceneproperties.cxx
+++ b/svx/source/sdr/properties/e3dsceneproperties.cxx
@@ -50,13 +50,13 @@ namespace sdr::properties
         const SfxItemSet& E3dSceneProperties::GetMergedItemSet() const
         {
             // prepare ItemSet
-            if(mpItemSet)
+            if(mxItemSet)
             {
                 // filter for SDRATTR_3DSCENE_ items, only keep those items
-                SfxItemSet aNew(*mpItemSet->GetPool(), 
svl::Items<SDRATTR_3DSCENE_FIRST, SDRATTR_3DSCENE_LAST>{});
-                aNew.Put(*mpItemSet);
-                mpItemSet->ClearItem();
-                mpItemSet->Put(aNew);
+                SfxItemSet aNew(*mxItemSet->GetPool(), 
svl::Items<SDRATTR_3DSCENE_FIRST, SDRATTR_3DSCENE_LAST>{});
+                aNew.Put(*mxItemSet);
+                mxItemSet->ClearItem();
+                mxItemSet->Put(aNew);
             }
             else
             {
@@ -87,11 +87,11 @@ namespace sdr::properties
                         {
                             if(SfxItemState::DONTCARE == 
rSet.GetItemState(nWhich, false))
                             {
-                                mpItemSet->InvalidateItem(nWhich);
+                                mxItemSet->InvalidateItem(nWhich);
                             }
                             else
                             {
-                                mpItemSet->MergeValue(rSet.Get(nWhich), true);
+                                mxItemSet->MergeValue(rSet.Get(nWhich), true);
                             }
                         }
 
@@ -280,13 +280,13 @@ namespace sdr::properties
             const Camera3D& aSceneCam(rObj.GetCamera());
 
             // ProjectionType
-            mpItemSet->Put(Svx3DPerspectiveItem(aSceneCam.GetProjection()));
+            mxItemSet->Put(Svx3DPerspectiveItem(aSceneCam.GetProjection()));
 
             // CamPos
-            
mpItemSet->Put(makeSvx3DDistanceItem(static_cast<sal_uInt32>(aSceneCam.GetPosition().getZ()
 + 0.5)));
+            
mxItemSet->Put(makeSvx3DDistanceItem(static_cast<sal_uInt32>(aSceneCam.GetPosition().getZ()
 + 0.5)));
 
             // FocalLength
-            
mpItemSet->Put(makeSvx3DFocalLengthItem(static_cast<sal_uInt32>((aSceneCam.GetFocalLength()
 * 100.0) + 0.5)));
+            
mxItemSet->Put(makeSvx3DFocalLengthItem(static_cast<sal_uInt32>((aSceneCam.GetFocalLength()
 * 100.0) + 0.5)));
         }
 } // end of namespace
 
diff --git a/svx/source/sdr/properties/emptyproperties.cxx 
b/svx/source/sdr/properties/emptyproperties.cxx
index 502fe2702c39..3837b23bfeec 100644
--- a/svx/source/sdr/properties/emptyproperties.cxx
+++ b/svx/source/sdr/properties/emptyproperties.cxx
@@ -27,11 +27,11 @@
 namespace sdr::properties
 {
         // create a new itemset
-        std::unique_ptr<SfxItemSet> 
EmptyProperties::CreateObjectSpecificItemSet(SfxItemPool& rPool)
+        SfxItemSet EmptyProperties::CreateObjectSpecificItemSet(SfxItemPool& 
rPool)
         {
             // Basic implementation; Basic object has NO attributes
             assert(!"EmptyProperties::CreateObjectSpecificItemSet() should 
never be called");
-            return std::make_unique<SfxItemSet>(rPool);
+            return SfxItemSet(rPool);
         }
 
         EmptyProperties::EmptyProperties(SdrObject& rObj)
@@ -46,15 +46,15 @@ namespace sdr::properties
 
         const SfxItemSet& EmptyProperties::GetObjectItemSet() const
         {
-            if(!mpEmptyItemSet)
+            if(!mxEmptyItemSet)
             {
-                const_cast<EmptyProperties*>(this)->mpEmptyItemSet = 
const_cast<EmptyProperties*>(this)->CreateObjectSpecificItemSet(GetSdrObject().GetObjectItemPool());
+                
mxEmptyItemSet.emplace(const_cast<EmptyProperties*>(this)->CreateObjectSpecificItemSet(GetSdrObject().GetObjectItemPool()));
             }
 
-            assert(mpEmptyItemSet);
+            assert(mxEmptyItemSet);
             assert(!"EmptyProperties::GetObjectItemSet() should never be 
called");
 
-            return *mpEmptyItemSet;
+            return *mxEmptyItemSet;
         }
 
         void EmptyProperties::SetObjectItem(const SfxPoolItem& /*rItem*/)
diff --git a/svx/source/sdr/properties/graphicproperties.cxx 
b/svx/source/sdr/properties/graphicproperties.cxx
index 2819826caad5..d50e58f3d883 100644
--- a/svx/source/sdr/properties/graphicproperties.cxx
+++ b/svx/source/sdr/properties/graphicproperties.cxx
@@ -55,9 +55,9 @@ namespace sdr::properties
         }
 
         // create a new itemset
-        std::unique_ptr<SfxItemSet> 
GraphicProperties::CreateObjectSpecificItemSet(SfxItemPool& rPool)
+        SfxItemSet GraphicProperties::CreateObjectSpecificItemSet(SfxItemPool& 
rPool)
         {
-            return std::make_unique<SfxItemSet>(rPool,
+            return SfxItemSet(rPool,
 
                 // range from SdrAttrObj
                 svl::Items<SDRATTR_START, SDRATTR_SHADOW_LAST,
@@ -132,16 +132,16 @@ namespace sdr::properties
             // force ItemSet
             GetObjectItemSet();
 
-            mpItemSet->Put( SdrGrafLuminanceItem( 0 ) );
-            mpItemSet->Put( SdrGrafContrastItem( 0 ) );
-            mpItemSet->Put( SdrGrafRedItem( 0 ) );
-            mpItemSet->Put( SdrGrafGreenItem( 0 ) );
-            mpItemSet->Put( SdrGrafBlueItem( 0 ) );
-            mpItemSet->Put( SdrGrafGamma100Item( 100 ) );
-            mpItemSet->Put( SdrGrafTransparenceItem( 0 ) );
-            mpItemSet->Put( SdrGrafInvertItem( false ) );
-            mpItemSet->Put( SdrGrafModeItem( GraphicDrawMode::Standard ) );
-            mpItemSet->Put( SdrGrafCropItem( 0, 0, 0, 0 ) );
+            mxItemSet->Put( SdrGrafLuminanceItem( 0 ) );
+            mxItemSet->Put( SdrGrafContrastItem( 0 ) );
+            mxItemSet->Put( SdrGrafRedItem( 0 ) );
+            mxItemSet->Put( SdrGrafGreenItem( 0 ) );
+            mxItemSet->Put( SdrGrafBlueItem( 0 ) );
+            mxItemSet->Put( SdrGrafGamma100Item( 100 ) );
+            mxItemSet->Put( SdrGrafTransparenceItem( 0 ) );
+            mxItemSet->Put( SdrGrafInvertItem( false ) );
+            mxItemSet->Put( SdrGrafModeItem( GraphicDrawMode::Standard ) );
+            mxItemSet->Put( SdrGrafCropItem( 0, 0, 0, 0 ) );
         }
 } // end of namespace
 
diff --git a/svx/source/sdr/properties/groupproperties.cxx 
b/svx/source/sdr/properties/groupproperties.cxx
index 923bed6ade17..5f197c417688 100644
--- a/svx/source/sdr/properties/groupproperties.cxx
+++ b/svx/source/sdr/properties/groupproperties.cxx
@@ -30,12 +30,12 @@
 namespace sdr::properties
 {
         // create a new itemset
-        std::unique_ptr<SfxItemSet> 
GroupProperties::CreateObjectSpecificItemSet(SfxItemPool& rPool)
+        SfxItemSet GroupProperties::CreateObjectSpecificItemSet(SfxItemPool& 
rPool)
         {
             // Groups have in principle no ItemSet. To support methods like
             // GetMergedItemSet() the local one is used. Thus, all items in 
the pool
             // may be used and a pool itemset is created.
-            return std::make_unique<SfxItemSet>(rPool);
+            return SfxItemSet(rPool);
         }
 
         GroupProperties::GroupProperties(SdrObject& rObj)
@@ -66,10 +66,10 @@ namespace sdr::properties
         const SfxItemSet& GroupProperties::GetMergedItemSet() const
         {
             // prepare ItemSet
-            if(mpItemSet)
+            if(mxItemSet)
             {
                 // clear local itemset for merge
-                mpItemSet->ClearItem();
+                mxItemSet->ClearItem();
             }
             else
             {
@@ -92,11 +92,11 @@ namespace sdr::properties
                 {
                     if(SfxItemState::DONTCARE == rSet.GetItemState(nWhich, 
false))
                     {
-                        mpItemSet->InvalidateItem(nWhich);
+                        mxItemSet->InvalidateItem(nWhich);
                     }
                     else
                     {
-                        mpItemSet->MergeValue(rSet.Get(nWhich), true);
+                        mxItemSet->MergeValue(rSet.Get(nWhich), true);
                     }
 
                     nWhich = aIter.NextWhich();
@@ -105,7 +105,7 @@ namespace sdr::properties
 
             // For group properties, do not call parent since groups do
             // not have local ItemSets.
-            return *mpItemSet;
+            return *mxItemSet;
         }
 
         void GroupProperties::SetMergedItemSet(const SfxItemSet& rSet, bool 
bClearAllItems)
diff --git a/svx/source/sdr/properties/measureproperties.cxx 
b/svx/source/sdr/properties/measureproperties.cxx
index 5519930e3dda..0675a6c1ddc4 100644
--- a/svx/source/sdr/properties/measureproperties.cxx
+++ b/svx/source/sdr/properties/measureproperties.cxx
@@ -38,9 +38,9 @@
 namespace sdr::properties
 {
         // create a new itemset
-        std::unique_ptr<SfxItemSet> 
MeasureProperties::CreateObjectSpecificItemSet(SfxItemPool& rPool)
+        SfxItemSet MeasureProperties::CreateObjectSpecificItemSet(SfxItemPool& 
rPool)
         {
-            return std::make_unique<SfxItemSet>(
+            return SfxItemSet(
                 rPool,
                 svl::Items<
                     // Ranges from SdrAttrObj, SdrMeasureObj:
@@ -109,7 +109,7 @@ namespace sdr::properties
             //#71958# by default, the show units Bool-Item is set as hard
             // attribute to sal_True to avoid confusion when copying 
SdrMeasureObj's
             // from one application to another
-            mpItemSet->Put(SdrYesNoItem(SDRATTR_MEASURESHOWUNIT, true));
+            mxItemSet->Put(SdrYesNoItem(SDRATTR_MEASURESHOWUNIT, true));
 
             basegfx::B2DPolygon aNewPolygon;
             aNewPolygon.append(basegfx::B2DPoint(100.0, 0.0));
@@ -117,11 +117,11 @@ namespace sdr::properties
             aNewPolygon.append(basegfx::B2DPoint(0.0, 400.0));
             aNewPolygon.setClosed(true);
 
-            mpItemSet->Put(XLineStartItem(OUString(), 
basegfx::B2DPolyPolygon(aNewPolygon)));
-            mpItemSet->Put(XLineStartWidthItem(200));
-            mpItemSet->Put(XLineEndItem(OUString(), 
basegfx::B2DPolyPolygon(aNewPolygon)));
-            mpItemSet->Put(XLineEndWidthItem(200));
-            mpItemSet->Put(XLineStyleItem(css::drawing::LineStyle_SOLID));
+            mxItemSet->Put(XLineStartItem(OUString(), 
basegfx::B2DPolyPolygon(aNewPolygon)));
+            mxItemSet->Put(XLineStartWidthItem(200));
+            mxItemSet->Put(XLineEndItem(OUString(), 
basegfx::B2DPolyPolygon(aNewPolygon)));
+            mxItemSet->Put(XLineEndWidthItem(200));
+            mxItemSet->Put(XLineStyleItem(css::drawing::LineStyle_SOLID));
         }
 } // end of namespace
 
diff --git a/svx/source/sdr/properties/pageproperties.cxx 
b/svx/source/sdr/properties/pageproperties.cxx
index feca40ac7faa..ed75133f929f 100644
--- a/svx/source/sdr/properties/pageproperties.cxx
+++ b/svx/source/sdr/properties/pageproperties.cxx
@@ -29,10 +29,10 @@
 namespace sdr::properties
 {
         // create a new itemset
-        std::unique_ptr<SfxItemSet> 
PageProperties::CreateObjectSpecificItemSet(SfxItemPool& rPool)
+        SfxItemSet PageProperties::CreateObjectSpecificItemSet(SfxItemPool& 
rPool)
         {
             // override to legally return a valid ItemSet
-            return std::make_unique<SfxItemSet>(rPool);
+            return SfxItemSet(rPool);
         }
 
         PageProperties::PageProperties(SdrObject& rObj)
@@ -58,14 +58,14 @@ namespace sdr::properties
         // without asserting
         const SfxItemSet& PageProperties::GetObjectItemSet() const
         {
-            if(!mpEmptyItemSet)
+            if(!mxEmptyItemSet)
             {
-                const_cast<PageProperties*>(this)->mpEmptyItemSet = 
const_cast<PageProperties*>(this)->CreateObjectSpecificItemSet(GetSdrObject().GetObjectItemPool());
+                
mxEmptyItemSet.emplace(const_cast<PageProperties*>(this)->CreateObjectSpecificItemSet(GetSdrObject().GetObjectItemPool()));
             }
 
-            DBG_ASSERT(mpEmptyItemSet, "Could not create an SfxItemSet(!)");
+            DBG_ASSERT(mxEmptyItemSet, "Could not create an SfxItemSet(!)");
 
-            return *mpEmptyItemSet;
+            return *mxEmptyItemSet;
         }
 
         void PageProperties::ItemChange(const sal_uInt16 /*nWhich*/, const 
SfxPoolItem* /*pNewItem*/)
@@ -86,8 +86,8 @@ namespace sdr::properties
 
         void PageProperties::PostItemChange(const sal_uInt16 nWhich )
         {
-            if( (nWhich == XATTR_FILLSTYLE) && (mpEmptyItemSet != nullptr) )
-                CleanupFillProperties(*mpEmptyItemSet);
+            if( (nWhich == XATTR_FILLSTYLE) && mxEmptyItemSet )
+                CleanupFillProperties(*mxEmptyItemSet);
         }
 
         void PageProperties::ClearObjectItem(const sal_uInt16 /*nWhich*/)
diff --git a/svx/source/sdr/properties/textproperties.cxx 
b/svx/source/sdr/properties/textproperties.cxx
index 8a90de5c848b..a5ebc79efddc 100644
--- a/svx/source/sdr/properties/textproperties.cxx
+++ b/svx/source/sdr/properties/textproperties.cxx
@@ -46,9 +46,9 @@ using namespace com::sun::star;
 
 namespace sdr::properties
 {
-        std::unique_ptr<SfxItemSet> 
TextProperties::CreateObjectSpecificItemSet(SfxItemPool& rPool)
+        SfxItemSet TextProperties::CreateObjectSpecificItemSet(SfxItemPool& 
rPool)
         {
-            return std::make_unique<SfxItemSet>(rPool,
+            return SfxItemSet(rPool,
 
                 // range from SdrAttrObj
                 svl::Items<SDRATTR_START, SDRATTR_SHADOW_LAST,
@@ -126,7 +126,7 @@ namespace sdr::properties
                             GetObjectItemSet();
 
                             SfxItemSet aNewSet(pOutliner->GetParaAttribs(0));
-                            mpItemSet->Put(aNewSet);
+                            mxItemSet->Put(aNewSet);
                         }
 
                         std::unique_ptr<OutlinerParaObject> pTemp = 
pOutliner->CreateParaObject(0, nParaCount);
@@ -367,15 +367,15 @@ namespace sdr::properties
 
             if(bTextFrame)
             {
-                mpItemSet->Put(XLineStyleItem(drawing::LineStyle_NONE));
-                mpItemSet->Put(XFillColorItem(OUString(), COL_WHITE));
-                mpItemSet->Put(XFillStyleItem(drawing::FillStyle_NONE));
+                mxItemSet->Put(XLineStyleItem(drawing::LineStyle_NONE));
+                mxItemSet->Put(XFillColorItem(OUString(), COL_WHITE));
+                mxItemSet->Put(XFillStyleItem(drawing::FillStyle_NONE));
             }
             else
             {
-                mpItemSet->Put(SvxAdjustItem(SvxAdjust::Center, EE_PARA_JUST));
-                
mpItemSet->Put(SdrTextHorzAdjustItem(SDRTEXTHORZADJUST_CENTER));
-                
mpItemSet->Put(SdrTextVertAdjustItem(SDRTEXTVERTADJUST_CENTER));
+                mxItemSet->Put(SvxAdjustItem(SvxAdjust::Center, EE_PARA_JUST));
+                
mxItemSet->Put(SdrTextHorzAdjustItem(SDRTEXTHORZADJUST_CENTER));
+                
mxItemSet->Put(SdrTextVertAdjustItem(SDRTEXTVERTADJUST_CENTER));
             }
         }
 
@@ -387,7 +387,7 @@ namespace sdr::properties
             // #i61284# push hard ObjectItemSet to OutlinerParaObject 
attributes
             // using existing functionality
             GetObjectItemSet(); // force ItemSet
-            ItemSetChanged(*mpItemSet);
+            ItemSetChanged(*mxItemSet);
 
             // now the standard TextProperties stuff
             SdrTextObj& rObj = static_cast<SdrTextObj&>(GetSdrObject());
@@ -525,7 +525,7 @@ namespace sdr::properties
         void TextProperties::SetObjectItemNoBroadcast(const SfxPoolItem& rItem)
         {
             GetObjectItemSet();
-            mpItemSet->Put(rItem);
+            mxItemSet->Put(rItem);
         }
 
 
diff --git a/svx/source/table/cell.cxx b/svx/source/table/cell.cxx
index c42db7cfd7d8..a4bc4a86ffec 100644
--- a/svx/source/table/cell.cxx
+++ b/svx/source/table/cell.cxx
@@ -150,7 +150,7 @@ namespace sdr::properties
         {
         protected:
             // create a new itemset
-            std::unique_ptr<SfxItemSet> 
CreateObjectSpecificItemSet(SfxItemPool& rPool) override;
+            SfxItemSet CreateObjectSpecificItemSet(SfxItemPool& rPool) 
override;
 
             const svx::ITextProvider& getTextProvider() const override;
 
@@ -177,9 +177,9 @@ namespace sdr::properties
         };
 
         // create a new itemset
-        std::unique_ptr<SfxItemSet> 
CellProperties::CreateObjectSpecificItemSet(SfxItemPool& rPool)
+        SfxItemSet CellProperties::CreateObjectSpecificItemSet(SfxItemPool& 
rPool)
         {
-            return std::make_unique<SfxItemSet>(rPool,
+            return SfxItemSet(rPool,
 
                 // range from SdrAttrObj
                 svl::Items<SDRATTR_START, SDRATTR_SHADOW_LAST,
@@ -278,7 +278,7 @@ namespace sdr::properties
                             GetObjectItemSet();
 
                             SfxItemSet aNewSet(pOutliner->GetParaAttribs(0));
-                            mpItemSet->Put(aNewSet);
+                            mxItemSet->Put(aNewSet);
                         }
 
                         std::unique_ptr<OutlinerParaObject> pTemp = 
pOutliner->CreateParaObject(0, nParaCount);
diff --git a/svx/source/table/svdotable.cxx b/svx/source/table/svdotable.cxx
index 33b134dbe2c2..5731c12acdd9 100644
--- a/svx/source/table/svdotable.cxx
+++ b/svx/source/table/svdotable.cxx
@@ -85,7 +85,7 @@ class TableProperties : public TextProperties
 {
 protected:
     // create a new itemset
-    std::unique_ptr<SfxItemSet> CreateObjectSpecificItemSet(SfxItemPool& 
rPool) override;
+    SfxItemSet CreateObjectSpecificItemSet(SfxItemPool& rPool) override;
 
 public:
     // basic constructor
@@ -126,9 +126,9 @@ void TableProperties::ItemChange(const sal_uInt16 nWhich, 
const SfxPoolItem* pNe
 }
 
 // create a new itemset
-std::unique_ptr<SfxItemSet> 
TableProperties::CreateObjectSpecificItemSet(SfxItemPool& rPool)
+SfxItemSet TableProperties::CreateObjectSpecificItemSet(SfxItemPool& rPool)
 {
-    return std::make_unique<SfxItemSet>(rPool,
+    return SfxItemSet(rPool,
 
         // range from SdrAttrObj
         svl::Items<SDRATTR_START, SDRATTR_SHADOW_LAST,
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to