[Libreoffice-commits] core.git: include/svx svx/inc svx/source

Stephan Bergmann sbergman at redhat.com
Tue Jun 13 11:48:49 UTC 2017


 include/svx/sdr/properties/defaultproperties.hxx    |    2 +-
 include/svx/sdr/properties/properties.hxx           |    6 +++++-
 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          |    2 +-
 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   |    9 +++++----
 svx/source/sdr/properties/captionproperties.cxx     |    7 +++++--
 svx/source/sdr/properties/circleproperties.cxx      |    7 +++++--
 svx/source/sdr/properties/connectorproperties.cxx   |    7 +++++--
 svx/source/sdr/properties/customshapeproperties.cxx |    7 +++++--
 svx/source/sdr/properties/defaultproperties.cxx     |    9 ++++++---
 svx/source/sdr/properties/e3dproperties.cxx         |    7 +++++--
 svx/source/sdr/properties/emptyproperties.cxx       |    9 ++++++---
 svx/source/sdr/properties/graphicproperties.cxx     |    7 +++++--
 svx/source/sdr/properties/groupproperties.cxx       |    7 +++++--
 svx/source/sdr/properties/measureproperties.cxx     |    7 +++++--
 svx/source/sdr/properties/pageproperties.cxx        |    9 ++++++---
 svx/source/sdr/properties/textproperties.cxx        |    7 +++++--
 svx/source/table/cell.cxx                           |    7 ++++---
 svx/source/table/svdotable.cxx                      |    8 ++++----
 29 files changed, 94 insertions(+), 52 deletions(-)

New commits:
commit 889ea6a50fb8ee154b2816ba287f33f0a3ce239b
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Jun 13 13:48:18 2017 +0200

    Let BaseProperties::CreateObjectSpecificItemSet return unique_ptr
    
    Change-Id: Ic734fe2a425ca1c821ba91df17aecac5ef40a000

diff --git a/include/svx/sdr/properties/defaultproperties.hxx b/include/svx/sdr/properties/defaultproperties.hxx
index 8d2b90009353..da78dcd9053a 100644
--- a/include/svx/sdr/properties/defaultproperties.hxx
+++ b/include/svx/sdr/properties/defaultproperties.hxx
@@ -40,7 +40,7 @@ namespace sdr
             std::unique_ptr<SfxItemSet> mpItemSet;
 
             // create a new itemset
-            virtual SfxItemSet* CreateObjectSpecificItemSet(SfxItemPool& rPool) override;
+            virtual std::unique_ptr<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/include/svx/sdr/properties/properties.hxx b/include/svx/sdr/properties/properties.hxx
index 3a49400f5d76..7755f4fbc3fb 100644
--- a/include/svx/sdr/properties/properties.hxx
+++ b/include/svx/sdr/properties/properties.hxx
@@ -20,6 +20,10 @@
 #ifndef INCLUDED_SVX_SDR_PROPERTIES_PROPERTIES_HXX
 #define INCLUDED_SVX_SDR_PROPERTIES_PROPERTIES_HXX
 
+#include <sal/config.h>
+
+#include <memory>
+
 #include <sal/types.h>
 #include <svx/svxdllapi.h>
 
@@ -53,7 +57,7 @@ namespace sdr
         protected:
 
             // create a new object specific itemset with object specific ranges.
-            virtual SfxItemSet* CreateObjectSpecificItemSet(SfxItemPool& pPool) = 0;
+            virtual std::unique_ptr<SfxItemSet> CreateObjectSpecificItemSet(SfxItemPool& pPool) = 0;
 
             // internal access to SdrObject
             const SdrObject& GetSdrObject() const;
diff --git a/svx/inc/sdr/properties/attributeproperties.hxx b/svx/inc/sdr/properties/attributeproperties.hxx
index b60794c05904..603442634df2 100644
--- a/svx/inc/sdr/properties/attributeproperties.hxx
+++ b/svx/inc/sdr/properties/attributeproperties.hxx
@@ -42,7 +42,7 @@ namespace sdr
             SfxStyleSheet*                                  mpStyleSheet;
 
             // create a new itemset
-            virtual SfxItemSet* CreateObjectSpecificItemSet(SfxItemPool& pPool) override;
+            virtual std::unique_ptr<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 13bb57ff3d6a..2fb7b8d1e6c2 100644
--- a/svx/inc/sdr/properties/captionproperties.hxx
+++ b/svx/inc/sdr/properties/captionproperties.hxx
@@ -31,7 +31,7 @@ namespace sdr
         {
         protected:
             // create a new itemset
-            virtual SfxItemSet* CreateObjectSpecificItemSet(SfxItemPool& rPool) override;
+            virtual std::unique_ptr<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 df8ae4c472dc..5de1ac6c6e9e 100644
--- a/svx/inc/sdr/properties/circleproperties.hxx
+++ b/svx/inc/sdr/properties/circleproperties.hxx
@@ -31,7 +31,7 @@ namespace sdr
         {
         protected:
             // create a new itemset
-            virtual SfxItemSet* CreateObjectSpecificItemSet(SfxItemPool& rPool) override;
+            virtual std::unique_ptr<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 95de994a0085..5ed60a3ad420 100644
--- a/svx/inc/sdr/properties/connectorproperties.hxx
+++ b/svx/inc/sdr/properties/connectorproperties.hxx
@@ -31,7 +31,7 @@ namespace sdr
         {
         protected:
             // create a new itemset
-            virtual SfxItemSet* CreateObjectSpecificItemSet(SfxItemPool& rPool) override;
+            virtual std::unique_ptr<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 ba93dad7339a..e056f21a106f 100644
--- a/svx/inc/sdr/properties/customshapeproperties.hxx
+++ b/svx/inc/sdr/properties/customshapeproperties.hxx
@@ -34,7 +34,7 @@ namespace sdr
 
         protected:
             // create a new itemset
-            virtual SfxItemSet* CreateObjectSpecificItemSet(SfxItemPool& rPool) override;
+            virtual std::unique_ptr<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 07006c0afda5..0e6352079756 100644
--- a/svx/inc/sdr/properties/e3dproperties.hxx
+++ b/svx/inc/sdr/properties/e3dproperties.hxx
@@ -31,7 +31,7 @@ namespace sdr
         {
         protected:
             // create a new itemset
-            virtual SfxItemSet* CreateObjectSpecificItemSet(SfxItemPool& rPool) override;
+            virtual std::unique_ptr<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 2b431ec7b576..4da4be720ef3 100644
--- a/svx/inc/sdr/properties/emptyproperties.hxx
+++ b/svx/inc/sdr/properties/emptyproperties.hxx
@@ -38,7 +38,7 @@ namespace sdr
             std::unique_ptr<SfxItemSet> mpEmptyItemSet;
 
             // create a new itemset
-            virtual SfxItemSet* CreateObjectSpecificItemSet(SfxItemPool& rPool) override;
+            virtual std::unique_ptr<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 aeb8b6585a98..860bc264ee7f 100644
--- a/svx/inc/sdr/properties/graphicproperties.hxx
+++ b/svx/inc/sdr/properties/graphicproperties.hxx
@@ -31,7 +31,7 @@ namespace sdr
         {
         protected:
             // create a new itemset
-            virtual SfxItemSet* CreateObjectSpecificItemSet(SfxItemPool& rPool) override;
+            virtual std::unique_ptr<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 50d3fb16e652..7e2a71177841 100644
--- a/svx/inc/sdr/properties/groupproperties.hxx
+++ b/svx/inc/sdr/properties/groupproperties.hxx
@@ -31,7 +31,7 @@ namespace sdr
         {
         protected:
             // create a new itemset
-            virtual SfxItemSet* CreateObjectSpecificItemSet(SfxItemPool& rPool) override;
+            virtual std::unique_ptr<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 e7dae195176c..06cc0fd328f5 100644
--- a/svx/inc/sdr/properties/measureproperties.hxx
+++ b/svx/inc/sdr/properties/measureproperties.hxx
@@ -31,7 +31,7 @@ namespace sdr
         {
         protected:
             // create a new itemset
-            virtual SfxItemSet* CreateObjectSpecificItemSet(SfxItemPool& rPool) override;
+            virtual std::unique_ptr<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 1c4eee7c8cd4..febdae9a2194 100644
--- a/svx/inc/sdr/properties/pageproperties.hxx
+++ b/svx/inc/sdr/properties/pageproperties.hxx
@@ -31,7 +31,7 @@ namespace sdr
         {
         protected:
             // create a new object specific itemset with object specific ranges.
-            virtual SfxItemSet* CreateObjectSpecificItemSet(SfxItemPool& pPool) override;
+            virtual std::unique_ptr<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 b2c73f4d0a00..df6715cd51f0 100644
--- a/svx/inc/sdr/properties/textproperties.hxx
+++ b/svx/inc/sdr/properties/textproperties.hxx
@@ -36,7 +36,7 @@ namespace sdr
 
         protected:
             // create a new itemset
-            virtual SfxItemSet* CreateObjectSpecificItemSet(SfxItemPool& rPool) override;
+            virtual std::unique_ptr<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 369c6bd3cd77..137cc6bd93c0 100644
--- a/svx/source/sdr/properties/attributeproperties.cxx
+++ b/svx/source/sdr/properties/attributeproperties.cxx
@@ -21,6 +21,7 @@
 
 #include <utility>
 
+#include <o3tl/make_unique.hxx>
 #include <sdr/properties/attributeproperties.hxx>
 #include <sdr/properties/itemsettools.hxx>
 #include <tools/debug.hxx>
@@ -112,9 +113,9 @@ namespace sdr
         }
 
         // create a new itemset
-        SfxItemSet* AttributeProperties::CreateObjectSpecificItemSet(SfxItemPool& rPool)
+        std::unique_ptr<SfxItemSet> AttributeProperties::CreateObjectSpecificItemSet(SfxItemPool& rPool)
         {
-            return new SfxItemSet(rPool,
+            return o3tl::make_unique<SfxItemSet>(rPool,
 
                 // ranges from SdrAttrObj
                 SDRATTR_START, SDRATTR_SHADOW_LAST,
@@ -419,7 +420,7 @@ namespace sdr
                                 pItemSet = pItemSet->GetParent();
                             }
 
-                            SfxItemSet* pNewSet = CreateObjectSpecificItemSet(pNewModel->GetItemPool());
+                            auto pNewSet = CreateObjectSpecificItemSet(pNewModel->GetItemPool());
 
                             std::vector<const SfxItemSet*>::reverse_iterator riter;
                             for (riter = aSetList.rbegin(); riter != aSetList.rend(); ++riter)
@@ -455,7 +456,7 @@ namespace sdr
                                 }
                             }
 
-                            mpItemSet.reset(pNewSet);
+                            mpItemSet = std::move(pNewSet);
                         }
                     }
                 }
diff --git a/svx/source/sdr/properties/captionproperties.cxx b/svx/source/sdr/properties/captionproperties.cxx
index 5a5e7a238b87..be25e2ed6e50 100644
--- a/svx/source/sdr/properties/captionproperties.cxx
+++ b/svx/source/sdr/properties/captionproperties.cxx
@@ -17,6 +17,9 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include <sal/config.h>
+
+#include <o3tl/make_unique.hxx>
 #include <sdr/properties/captionproperties.hxx>
 #include <svl/itemset.hxx>
 #include <svl/style.hxx>
@@ -30,9 +33,9 @@ namespace sdr
     namespace properties
     {
         // create a new itemset
-        SfxItemSet* CaptionProperties::CreateObjectSpecificItemSet(SfxItemPool& rPool)
+        std::unique_ptr<SfxItemSet> CaptionProperties::CreateObjectSpecificItemSet(SfxItemPool& rPool)
         {
-            return new SfxItemSet(rPool,
+            return o3tl::make_unique<SfxItemSet>(rPool,
 
                 // range from SdrAttrObj
                 SDRATTR_START, SDRATTR_SHADOW_LAST,
diff --git a/svx/source/sdr/properties/circleproperties.cxx b/svx/source/sdr/properties/circleproperties.cxx
index 1da3816b498a..4168e28e29e7 100644
--- a/svx/source/sdr/properties/circleproperties.cxx
+++ b/svx/source/sdr/properties/circleproperties.cxx
@@ -17,6 +17,9 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include <sal/config.h>
+
+#include <o3tl/make_unique.hxx>
 #include <sdr/properties/circleproperties.hxx>
 #include <svl/itemset.hxx>
 #include <svl/style.hxx>
@@ -32,9 +35,9 @@ namespace sdr
     namespace properties
     {
         // create a new itemset
-        SfxItemSet* CircleProperties::CreateObjectSpecificItemSet(SfxItemPool& rPool)
+        std::unique_ptr<SfxItemSet> CircleProperties::CreateObjectSpecificItemSet(SfxItemPool& rPool)
         {
-            return new SfxItemSet(rPool,
+            return o3tl::make_unique<SfxItemSet>(rPool,
 
                 // range from SdrAttrObj
                 SDRATTR_START, SDRATTR_SHADOW_LAST,
diff --git a/svx/source/sdr/properties/connectorproperties.cxx b/svx/source/sdr/properties/connectorproperties.cxx
index 7ab5fc431ebf..05501095a21c 100644
--- a/svx/source/sdr/properties/connectorproperties.cxx
+++ b/svx/source/sdr/properties/connectorproperties.cxx
@@ -17,6 +17,9 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include <sal/config.h>
+
+#include <o3tl/make_unique.hxx>
 #include <sdr/properties/connectorproperties.hxx>
 #include <svl/itemset.hxx>
 #include <svl/style.hxx>
@@ -30,9 +33,9 @@ namespace sdr
     namespace properties
     {
         // create a new itemset
-        SfxItemSet* ConnectorProperties::CreateObjectSpecificItemSet(SfxItemPool& rPool)
+        std::unique_ptr<SfxItemSet> ConnectorProperties::CreateObjectSpecificItemSet(SfxItemPool& rPool)
         {
-            return new SfxItemSet(rPool,
+            return o3tl::make_unique<SfxItemSet>(rPool,
 
                 // range from SdrAttrObj
                 SDRATTR_START, SDRATTR_SHADOW_LAST,
diff --git a/svx/source/sdr/properties/customshapeproperties.cxx b/svx/source/sdr/properties/customshapeproperties.cxx
index 2f7c2fd0f5f2..f674ab5b51b0 100644
--- a/svx/source/sdr/properties/customshapeproperties.cxx
+++ b/svx/source/sdr/properties/customshapeproperties.cxx
@@ -17,6 +17,9 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include <sal/config.h>
+
+#include <o3tl/make_unique.hxx>
 #include <sdr/properties/customshapeproperties.hxx>
 #include <svl/itemset.hxx>
 #include <svl/style.hxx>
@@ -59,9 +62,9 @@ namespace sdr
             }
         }
 
-        SfxItemSet* CustomShapeProperties::CreateObjectSpecificItemSet(SfxItemPool& rPool)
+        std::unique_ptr<SfxItemSet> CustomShapeProperties::CreateObjectSpecificItemSet(SfxItemPool& rPool)
         {
-            return new SfxItemSet(rPool,
+            return o3tl::make_unique<SfxItemSet>(rPool,
 
                 // ranges from SdrAttrObj
                 SDRATTR_START, SDRATTR_SHADOW_LAST,
diff --git a/svx/source/sdr/properties/defaultproperties.cxx b/svx/source/sdr/properties/defaultproperties.cxx
index 3d53ddec61fe..ce5d927ba270 100644
--- a/svx/source/sdr/properties/defaultproperties.cxx
+++ b/svx/source/sdr/properties/defaultproperties.cxx
@@ -17,6 +17,9 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include <sal/config.h>
+
+#include <o3tl/make_unique.hxx>
 #include <svx/sdr/properties/defaultproperties.hxx>
 #include <sdr/properties/itemsettools.hxx>
 #include <svl/itemset.hxx>
@@ -35,10 +38,10 @@ namespace sdr
 {
     namespace properties
     {
-        SfxItemSet* DefaultProperties::CreateObjectSpecificItemSet(SfxItemPool& rPool)
+        std::unique_ptr<SfxItemSet> DefaultProperties::CreateObjectSpecificItemSet(SfxItemPool& rPool)
         {
             // Basic implementation; Basic object has NO attributes
-            return new SfxItemSet(rPool);
+            return o3tl::make_unique<SfxItemSet>(rPool);
         }
 
         DefaultProperties::DefaultProperties(SdrObject& rObj)
@@ -75,7 +78,7 @@ namespace sdr
         {
             if(!mpItemSet)
             {
-                const_cast<DefaultProperties*>(this)->mpItemSet.reset(const_cast<DefaultProperties*>(this)->CreateObjectSpecificItemSet(GetSdrObject().GetObjectItemPool()));
+                const_cast<DefaultProperties*>(this)->mpItemSet = const_cast<DefaultProperties*>(this)->CreateObjectSpecificItemSet(GetSdrObject().GetObjectItemPool());
                 const_cast<DefaultProperties*>(this)->ForceDefaultAttributes();
             }
 
diff --git a/svx/source/sdr/properties/e3dproperties.cxx b/svx/source/sdr/properties/e3dproperties.cxx
index fd49afc1c13f..2a674886e570 100644
--- a/svx/source/sdr/properties/e3dproperties.cxx
+++ b/svx/source/sdr/properties/e3dproperties.cxx
@@ -17,6 +17,9 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include <sal/config.h>
+
+#include <o3tl/make_unique.hxx>
 #include <sdr/properties/e3dproperties.hxx>
 #include <svl/itemset.hxx>
 #include <svx/svddef.hxx>
@@ -28,9 +31,9 @@ namespace sdr
     namespace properties
     {
         // create a new itemset
-        SfxItemSet* E3dProperties::CreateObjectSpecificItemSet(SfxItemPool& rPool)
+        std::unique_ptr<SfxItemSet> E3dProperties::CreateObjectSpecificItemSet(SfxItemPool& rPool)
         {
-            return new SfxItemSet(rPool,
+            return o3tl::make_unique<SfxItemSet>(rPool,
 
                 // ranges from SdrAttrObj
                 SDRATTR_START, SDRATTR_SHADOW_LAST,
diff --git a/svx/source/sdr/properties/emptyproperties.cxx b/svx/source/sdr/properties/emptyproperties.cxx
index 25d7c04ee16b..458cf3b98f64 100644
--- a/svx/source/sdr/properties/emptyproperties.cxx
+++ b/svx/source/sdr/properties/emptyproperties.cxx
@@ -17,6 +17,9 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include <sal/config.h>
+
+#include <o3tl/make_unique.hxx>
 #include <sdr/properties/emptyproperties.hxx>
 #include <svl/itemset.hxx>
 #include <svx/svddef.hxx>
@@ -30,11 +33,11 @@ namespace sdr
     namespace properties
     {
         // create a new itemset
-        SfxItemSet* EmptyProperties::CreateObjectSpecificItemSet(SfxItemPool& rPool)
+        std::unique_ptr<SfxItemSet> EmptyProperties::CreateObjectSpecificItemSet(SfxItemPool& rPool)
         {
             // Basic implementation; Basic object has NO attributes
             assert(!"EmptyProperties::CreateObjectSpecificItemSet() should never be called");
-            return new SfxItemSet(rPool);
+            return o3tl::make_unique<SfxItemSet>(rPool);
         }
 
         EmptyProperties::EmptyProperties(SdrObject& rObj)
@@ -52,7 +55,7 @@ namespace sdr
         {
             if(!mpEmptyItemSet)
             {
-                const_cast<EmptyProperties*>(this)->mpEmptyItemSet.reset(const_cast<EmptyProperties*>(this)->CreateObjectSpecificItemSet(GetSdrObject().GetObjectItemPool()));
+                const_cast<EmptyProperties*>(this)->mpEmptyItemSet = const_cast<EmptyProperties*>(this)->CreateObjectSpecificItemSet(GetSdrObject().GetObjectItemPool());
             }
 
             assert(mpEmptyItemSet);
diff --git a/svx/source/sdr/properties/graphicproperties.cxx b/svx/source/sdr/properties/graphicproperties.cxx
index 9663199d766c..955384961f70 100644
--- a/svx/source/sdr/properties/graphicproperties.cxx
+++ b/svx/source/sdr/properties/graphicproperties.cxx
@@ -17,6 +17,9 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include <sal/config.h>
+
+#include <o3tl/make_unique.hxx>
 #include <sdr/properties/graphicproperties.hxx>
 #include <svl/itemset.hxx>
 #include <svl/style.hxx>
@@ -31,9 +34,9 @@ namespace sdr
     namespace properties
     {
         // create a new itemset
-        SfxItemSet* GraphicProperties::CreateObjectSpecificItemSet(SfxItemPool& rPool)
+        std::unique_ptr<SfxItemSet> GraphicProperties::CreateObjectSpecificItemSet(SfxItemPool& rPool)
         {
-            return new SfxItemSet(rPool,
+            return o3tl::make_unique<SfxItemSet>(rPool,
 
                 // range from SdrAttrObj
                 SDRATTR_START, SDRATTR_SHADOW_LAST,
diff --git a/svx/source/sdr/properties/groupproperties.cxx b/svx/source/sdr/properties/groupproperties.cxx
index 4dfc770e0888..7b46704e0923 100644
--- a/svx/source/sdr/properties/groupproperties.cxx
+++ b/svx/source/sdr/properties/groupproperties.cxx
@@ -17,6 +17,9 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include <sal/config.h>
+
+#include <o3tl/make_unique.hxx>
 #include <sdr/properties/groupproperties.hxx>
 #include <svl/itemset.hxx>
 #include <svl/whiter.hxx>
@@ -32,12 +35,12 @@ namespace sdr
     namespace properties
     {
         // create a new itemset
-        SfxItemSet* GroupProperties::CreateObjectSpecificItemSet(SfxItemPool& rPool)
+        std::unique_ptr<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 new SfxItemSet(rPool);
+            return o3tl::make_unique<SfxItemSet>(rPool);
         }
 
         GroupProperties::GroupProperties(SdrObject& rObj)
diff --git a/svx/source/sdr/properties/measureproperties.cxx b/svx/source/sdr/properties/measureproperties.cxx
index fe0b362e3f86..03f10aeda774 100644
--- a/svx/source/sdr/properties/measureproperties.cxx
+++ b/svx/source/sdr/properties/measureproperties.cxx
@@ -17,6 +17,9 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include <sal/config.h>
+
+#include <o3tl/make_unique.hxx>
 #include <sdr/properties/measureproperties.hxx>
 #include <svl/itemset.hxx>
 #include <svl/style.hxx>
@@ -36,9 +39,9 @@ namespace sdr
     namespace properties
     {
         // create a new itemset
-        SfxItemSet* MeasureProperties::CreateObjectSpecificItemSet(SfxItemPool& rPool)
+        std::unique_ptr<SfxItemSet> MeasureProperties::CreateObjectSpecificItemSet(SfxItemPool& rPool)
         {
-            return new SfxItemSet(rPool,
+            return o3tl::make_unique<SfxItemSet>(rPool,
 
                 // range from SdrAttrObj
                 SDRATTR_START, SDRATTR_SHADOW_LAST,
diff --git a/svx/source/sdr/properties/pageproperties.cxx b/svx/source/sdr/properties/pageproperties.cxx
index a4d57fc80602..a3a567698cee 100644
--- a/svx/source/sdr/properties/pageproperties.cxx
+++ b/svx/source/sdr/properties/pageproperties.cxx
@@ -17,6 +17,9 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include <sal/config.h>
+
+#include <o3tl/make_unique.hxx>
 #include <sdr/properties/pageproperties.hxx>
 #include <svl/itemset.hxx>
 #include <svx/svdobj.hxx>
@@ -29,10 +32,10 @@ namespace sdr
     namespace properties
     {
         // create a new itemset
-        SfxItemSet* PageProperties::CreateObjectSpecificItemSet(SfxItemPool& rPool)
+        std::unique_ptr<SfxItemSet> PageProperties::CreateObjectSpecificItemSet(SfxItemPool& rPool)
         {
             // override to legally return a valid ItemSet
-            return new SfxItemSet(rPool);
+            return o3tl::make_unique<SfxItemSet>(rPool);
         }
 
         PageProperties::PageProperties(SdrObject& rObj)
@@ -60,7 +63,7 @@ namespace sdr
         {
             if(!mpEmptyItemSet)
             {
-                const_cast<PageProperties*>(this)->mpEmptyItemSet.reset(const_cast<PageProperties*>(this)->CreateObjectSpecificItemSet(GetSdrObject().GetObjectItemPool()));
+                const_cast<PageProperties*>(this)->mpEmptyItemSet = const_cast<PageProperties*>(this)->CreateObjectSpecificItemSet(GetSdrObject().GetObjectItemPool());
             }
 
             DBG_ASSERT(mpEmptyItemSet, "Could not create an SfxItemSet(!)");
diff --git a/svx/source/sdr/properties/textproperties.cxx b/svx/source/sdr/properties/textproperties.cxx
index b2d840c763fe..4749a1c02506 100644
--- a/svx/source/sdr/properties/textproperties.cxx
+++ b/svx/source/sdr/properties/textproperties.cxx
@@ -17,6 +17,9 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include <sal/config.h>
+
+#include <o3tl/make_unique.hxx>
 #include <sdr/properties/textproperties.hxx>
 #include <svl/itemset.hxx>
 #include <svl/style.hxx>
@@ -42,9 +45,9 @@ namespace sdr
 {
     namespace properties
     {
-        SfxItemSet* TextProperties::CreateObjectSpecificItemSet(SfxItemPool& rPool)
+        std::unique_ptr<SfxItemSet> TextProperties::CreateObjectSpecificItemSet(SfxItemPool& rPool)
         {
-            return new SfxItemSet(rPool,
+            return o3tl::make_unique<SfxItemSet>(rPool,
 
                 // range from SdrAttrObj
                 SDRATTR_START, SDRATTR_SHADOW_LAST,
diff --git a/svx/source/table/cell.cxx b/svx/source/table/cell.cxx
index 5266e5e2165f..c1703c9cb88e 100644
--- a/svx/source/table/cell.cxx
+++ b/svx/source/table/cell.cxx
@@ -29,6 +29,7 @@
 #include <cppuhelper/supportsservice.hxx>
 #include <cppuhelper/typeprovider.hxx>
 #include <o3tl/any.hxx>
+#include <o3tl/make_unique.hxx>
 #include <svl/style.hxx>
 #include <svl/itemset.hxx>
 
@@ -150,7 +151,7 @@ namespace sdr
         {
         protected:
             // create a new itemset
-            SfxItemSet* CreateObjectSpecificItemSet(SfxItemPool& rPool) override;
+            std::unique_ptr<SfxItemSet> CreateObjectSpecificItemSet(SfxItemPool& rPool) override;
 
             const svx::ITextProvider& getTextProvider() const override;
 
@@ -177,9 +178,9 @@ namespace sdr
         };
 
         // create a new itemset
-        SfxItemSet* CellProperties::CreateObjectSpecificItemSet(SfxItemPool& rPool)
+        std::unique_ptr<SfxItemSet> CellProperties::CreateObjectSpecificItemSet(SfxItemPool& rPool)
         {
-            return new SfxItemSet(rPool,
+            return o3tl::make_unique<SfxItemSet>(rPool,
 
                 // range from SdrAttrObj
                 SDRATTR_START, SDRATTR_SHADOW_LAST,
diff --git a/svx/source/table/svdotable.cxx b/svx/source/table/svdotable.cxx
index ef58d32b4a5b..2e2d01887fa2 100644
--- a/svx/source/table/svdotable.cxx
+++ b/svx/source/table/svdotable.cxx
@@ -22,7 +22,7 @@
 #include <com/sun/star/container/XNamed.hpp>
 #include <com/sun/star/container/XNameAccess.hpp>
 #include <com/sun/star/container/XIndexAccess.hpp>
-
+#include <o3tl/make_unique.hxx>
 #include <vcl/canvastools.hxx>
 #include <com/sun/star/style/XStyle.hpp>
 #include <com/sun/star/beans/XPropertySet.hpp>
@@ -86,7 +86,7 @@ class TableProperties : public TextProperties
 {
 protected:
     // create a new itemset
-    SfxItemSet* CreateObjectSpecificItemSet(SfxItemPool& rPool) override;
+    std::unique_ptr<SfxItemSet> CreateObjectSpecificItemSet(SfxItemPool& rPool) override;
 
 public:
     // basic constructor
@@ -125,9 +125,9 @@ void TableProperties::ItemChange(const sal_uInt16 nWhich, const SfxPoolItem* pNe
 }
 
 // create a new itemset
-SfxItemSet* TableProperties::CreateObjectSpecificItemSet(SfxItemPool& rPool)
+std::unique_ptr<SfxItemSet> TableProperties::CreateObjectSpecificItemSet(SfxItemPool& rPool)
 {
-    return new SfxItemSet(rPool,
+    return o3tl::make_unique<SfxItemSet>(rPool,
 
         // range from SdrAttrObj
         SDRATTR_START, SDRATTR_SHADOW_LAST,


More information about the Libreoffice-commits mailing list