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 @@
#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);
......
......@@ -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);
}
......
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