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

Noel Grandin noel.grandin at collabora.co.uk
Tue Apr 11 06:09:49 UTC 2017


 include/svx/svdpage.hxx       |    5 +++--
 svx/source/svdraw/svdpage.cxx |   15 +++++++--------
 2 files changed, 10 insertions(+), 10 deletions(-)

New commits:
commit 489a0039f86ef48d5aa85f4ff56a9cb63c29b56f
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Mon Apr 10 10:10:18 2017 +0200

    loplugin:inlinefields in SdrPageProperties
    
    Change-Id: If6aa6f62687b46ccca2b6b3bffba2eac4e2753ef
    Reviewed-on: https://gerrit.libreoffice.org/36372
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/include/svx/svdpage.hxx b/include/svx/svdpage.hxx
index 11db722b0acf..987acd87aa16 100644
--- a/include/svx/svdpage.hxx
+++ b/include/svx/svdpage.hxx
@@ -27,6 +27,7 @@
 #include <tools/weakbase.hxx>
 #include <tools/contnr.hxx>
 #include <cppuhelper/weakref.hxx>
+#include <svl/itemset.hxx>
 #include <svx/svdtypes.hxx>
 #include <svx/sdrpageuser.hxx>
 #include <svx/sdr/contact/viewobjectcontactredirector.hxx>
@@ -312,7 +313,7 @@ private:
     // data
     SdrPage*                mpSdrPage;
     SfxStyleSheet*          mpStyleSheet;
-    SfxItemSet*             mpProperties;
+    SfxItemSet              maProperties;
 
     // internal helpers
     void ImpRemoveStyleSheet();
@@ -331,7 +332,7 @@ public:
     virtual bool isUsedByModel() const override;
 
     // data read/write
-    const SfxItemSet& GetItemSet() const { return *mpProperties;}
+    const SfxItemSet& GetItemSet() const { return maProperties;}
     void PutItemSet(const SfxItemSet& rSet);
     void PutItem(const SfxPoolItem& rItem);
     void ClearItem(const sal_uInt16 nWhich = 0);
diff --git a/svx/source/svdraw/svdpage.cxx b/svx/source/svdraw/svdpage.cxx
index 794a4e779e15..cec60959272b 100644
--- a/svx/source/svdraw/svdpage.cxx
+++ b/svx/source/svdraw/svdpage.cxx
@@ -1049,7 +1049,7 @@ void SdrPageProperties::ImpRemoveStyleSheet()
     if(mpStyleSheet)
     {
         EndListening(*mpStyleSheet);
-        mpProperties->SetParent(nullptr);
+        maProperties.SetParent(nullptr);
         mpStyleSheet = nullptr;
     }
 }
@@ -1061,7 +1061,7 @@ void SdrPageProperties::ImpAddStyleSheet(SfxStyleSheet& rNewStyleSheet)
         ImpRemoveStyleSheet();
         mpStyleSheet = &rNewStyleSheet;
         StartListening(rNewStyleSheet);
-        mpProperties->SetParent(&rNewStyleSheet.GetItemSet());
+        maProperties.SetParent(&rNewStyleSheet.GetItemSet());
     }
 }
 
@@ -1081,18 +1081,17 @@ SdrPageProperties::SdrPageProperties(SdrPage& rSdrPage)
 :   SfxListener(),
     mpSdrPage(&rSdrPage),
     mpStyleSheet(nullptr),
-    mpProperties(new SfxItemSet(mpSdrPage->GetModel()->GetItemPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST))
+    maProperties(mpSdrPage->GetModel()->GetItemPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST)
 {
     if(!rSdrPage.IsMasterPage())
     {
-        mpProperties->Put(XFillStyleItem(drawing::FillStyle_NONE));
+        maProperties.Put(XFillStyleItem(drawing::FillStyle_NONE));
     }
 }
 
 SdrPageProperties::~SdrPageProperties()
 {
     ImpRemoveStyleSheet();
-    delete mpProperties;
 }
 
 void SdrPageProperties::Notify(SfxBroadcaster& /*rBC*/, const SfxHint& rHint)
@@ -1125,20 +1124,20 @@ bool SdrPageProperties::isUsedByModel() const
 void SdrPageProperties::PutItemSet(const SfxItemSet& rSet)
 {
     OSL_ENSURE(!mpSdrPage->IsMasterPage(), "Item set at MasterPage Attributes (!)");
-    mpProperties->Put(rSet);
+    maProperties.Put(rSet);
     ImpPageChange(*mpSdrPage);
 }
 
 void SdrPageProperties::PutItem(const SfxPoolItem& rItem)
 {
     OSL_ENSURE(!mpSdrPage->IsMasterPage(), "Item set at MasterPage Attributes (!)");
-    mpProperties->Put(rItem);
+    maProperties.Put(rItem);
     ImpPageChange(*mpSdrPage);
 }
 
 void SdrPageProperties::ClearItem(const sal_uInt16 nWhich)
 {
-    mpProperties->ClearItem(nWhich);
+    maProperties.ClearItem(nWhich);
     ImpPageChange(*mpSdrPage);
 }
 


More information about the Libreoffice-commits mailing list