Kaydet (Commit) 489a0039 authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:inlinefields in SdrPageProperties

Change-Id: If6aa6f62687b46ccca2b6b3bffba2eac4e2753ef
Reviewed-on: https://gerrit.libreoffice.org/36372Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 56fd725b
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include <tools/weakbase.hxx> #include <tools/weakbase.hxx>
#include <tools/contnr.hxx> #include <tools/contnr.hxx>
#include <cppuhelper/weakref.hxx> #include <cppuhelper/weakref.hxx>
#include <svl/itemset.hxx>
#include <svx/svdtypes.hxx> #include <svx/svdtypes.hxx>
#include <svx/sdrpageuser.hxx> #include <svx/sdrpageuser.hxx>
#include <svx/sdr/contact/viewobjectcontactredirector.hxx> #include <svx/sdr/contact/viewobjectcontactredirector.hxx>
...@@ -312,7 +313,7 @@ private: ...@@ -312,7 +313,7 @@ private:
// data // data
SdrPage* mpSdrPage; SdrPage* mpSdrPage;
SfxStyleSheet* mpStyleSheet; SfxStyleSheet* mpStyleSheet;
SfxItemSet* mpProperties; SfxItemSet maProperties;
// internal helpers // internal helpers
void ImpRemoveStyleSheet(); void ImpRemoveStyleSheet();
...@@ -331,7 +332,7 @@ public: ...@@ -331,7 +332,7 @@ public:
virtual bool isUsedByModel() const override; virtual bool isUsedByModel() const override;
// data read/write // data read/write
const SfxItemSet& GetItemSet() const { return *mpProperties;} const SfxItemSet& GetItemSet() const { return maProperties;}
void PutItemSet(const SfxItemSet& rSet); void PutItemSet(const SfxItemSet& rSet);
void PutItem(const SfxPoolItem& rItem); void PutItem(const SfxPoolItem& rItem);
void ClearItem(const sal_uInt16 nWhich = 0); void ClearItem(const sal_uInt16 nWhich = 0);
......
...@@ -1049,7 +1049,7 @@ void SdrPageProperties::ImpRemoveStyleSheet() ...@@ -1049,7 +1049,7 @@ void SdrPageProperties::ImpRemoveStyleSheet()
if(mpStyleSheet) if(mpStyleSheet)
{ {
EndListening(*mpStyleSheet); EndListening(*mpStyleSheet);
mpProperties->SetParent(nullptr); maProperties.SetParent(nullptr);
mpStyleSheet = nullptr; mpStyleSheet = nullptr;
} }
} }
...@@ -1061,7 +1061,7 @@ void SdrPageProperties::ImpAddStyleSheet(SfxStyleSheet& rNewStyleSheet) ...@@ -1061,7 +1061,7 @@ void SdrPageProperties::ImpAddStyleSheet(SfxStyleSheet& rNewStyleSheet)
ImpRemoveStyleSheet(); ImpRemoveStyleSheet();
mpStyleSheet = &rNewStyleSheet; mpStyleSheet = &rNewStyleSheet;
StartListening(rNewStyleSheet); StartListening(rNewStyleSheet);
mpProperties->SetParent(&rNewStyleSheet.GetItemSet()); maProperties.SetParent(&rNewStyleSheet.GetItemSet());
} }
} }
...@@ -1081,18 +1081,17 @@ SdrPageProperties::SdrPageProperties(SdrPage& rSdrPage) ...@@ -1081,18 +1081,17 @@ SdrPageProperties::SdrPageProperties(SdrPage& rSdrPage)
: SfxListener(), : SfxListener(),
mpSdrPage(&rSdrPage), mpSdrPage(&rSdrPage),
mpStyleSheet(nullptr), 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()) if(!rSdrPage.IsMasterPage())
{ {
mpProperties->Put(XFillStyleItem(drawing::FillStyle_NONE)); maProperties.Put(XFillStyleItem(drawing::FillStyle_NONE));
} }
} }
SdrPageProperties::~SdrPageProperties() SdrPageProperties::~SdrPageProperties()
{ {
ImpRemoveStyleSheet(); ImpRemoveStyleSheet();
delete mpProperties;
} }
void SdrPageProperties::Notify(SfxBroadcaster& /*rBC*/, const SfxHint& rHint) void SdrPageProperties::Notify(SfxBroadcaster& /*rBC*/, const SfxHint& rHint)
...@@ -1125,20 +1124,20 @@ bool SdrPageProperties::isUsedByModel() const ...@@ -1125,20 +1124,20 @@ bool SdrPageProperties::isUsedByModel() const
void SdrPageProperties::PutItemSet(const SfxItemSet& rSet) void SdrPageProperties::PutItemSet(const SfxItemSet& rSet)
{ {
OSL_ENSURE(!mpSdrPage->IsMasterPage(), "Item set at MasterPage Attributes (!)"); OSL_ENSURE(!mpSdrPage->IsMasterPage(), "Item set at MasterPage Attributes (!)");
mpProperties->Put(rSet); maProperties.Put(rSet);
ImpPageChange(*mpSdrPage); ImpPageChange(*mpSdrPage);
} }
void SdrPageProperties::PutItem(const SfxPoolItem& rItem) void SdrPageProperties::PutItem(const SfxPoolItem& rItem)
{ {
OSL_ENSURE(!mpSdrPage->IsMasterPage(), "Item set at MasterPage Attributes (!)"); OSL_ENSURE(!mpSdrPage->IsMasterPage(), "Item set at MasterPage Attributes (!)");
mpProperties->Put(rItem); maProperties.Put(rItem);
ImpPageChange(*mpSdrPage); ImpPageChange(*mpSdrPage);
} }
void SdrPageProperties::ClearItem(const sal_uInt16 nWhich) void SdrPageProperties::ClearItem(const sal_uInt16 nWhich)
{ {
mpProperties->ClearItem(nWhich); maProperties.ClearItem(nWhich);
ImpPageChange(*mpSdrPage); ImpPageChange(*mpSdrPage);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment