include/svx/svdoattr.hxx | 4 +--- include/svx/svdobj.hxx | 2 +- include/svx/svdovirt.hxx | 3 +++ svx/source/svdraw/svdoattr.cxx | 5 ----- svx/source/svdraw/svdobj.cxx | 10 +++++----- svx/source/svdraw/svdovirt.cxx | 6 ++++++ 6 files changed, 16 insertions(+), 14 deletions(-)
New commits: commit 5d0748b0c44649c422980a2b2f5554846c47ac9c Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Tue Oct 31 12:09:56 2023 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Tue Oct 31 18:09:53 2023 +0100 SdrAttrObj and SdrObject are abstract so push the CreateObjectSpecificProperties implementation down to the concrete subclasses. Change-Id: If2c9545aada3e9f2c2f2a0140b6d880bdfef111d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158711 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/include/svx/svdoattr.hxx b/include/svx/svdoattr.hxx index 3933caa3f3f5..26990a193b46 100644 --- a/include/svx/svdoattr.hxx +++ b/include/svx/svdoattr.hxx @@ -29,15 +29,13 @@ class SdrOutliner; class SfxItemSet; class SfxItemPool; -// SdrAttrObj +// SdrAttrObj. This is an abstract class, we only instantiate its subclasses. class SVXCORE_DLLPUBLIC SdrAttrObj : public SdrObject { private: friend class SdrOutliner; protected: - virtual std::unique_ptr<sdr::properties::BaseProperties> CreateObjectSpecificProperties() override; - tools::Rectangle maSnapRect; protected: diff --git a/include/svx/svdobj.hxx b/include/svx/svdobj.hxx index 631a5973bb7b..892beb56668c 100644 --- a/include/svx/svdobj.hxx +++ b/include/svx/svdobj.hxx @@ -917,7 +917,7 @@ protected: virtual ~SdrObject() override; - virtual std::unique_ptr<sdr::properties::BaseProperties> CreateObjectSpecificProperties(); + virtual std::unique_ptr<sdr::properties::BaseProperties> CreateObjectSpecificProperties() = 0; virtual std::unique_ptr<sdr::contact::ViewContact> CreateObjectSpecificViewContact(); diff --git a/include/svx/svdovirt.hxx b/include/svx/svdovirt.hxx index 8ccddce4d263..17c869313067 100644 --- a/include/svx/svdovirt.hxx +++ b/include/svx/svdovirt.hxx @@ -34,6 +34,9 @@ public: virtual sdr::properties::BaseProperties& GetProperties() const override; protected: + virtual std::unique_ptr<sdr::properties::BaseProperties> + CreateObjectSpecificProperties() override; + virtual std::unique_ptr<sdr::contact::ViewContact> CreateObjectSpecificViewContact() override; rtl::Reference<SdrObject> mxRefObj; // Referenced drawing object diff --git a/svx/source/svdraw/svdoattr.cxx b/svx/source/svdraw/svdoattr.cxx index 2c1b208d314d..ae4f59baa5cf 100644 --- a/svx/source/svdraw/svdoattr.cxx +++ b/svx/source/svdraw/svdoattr.cxx @@ -29,11 +29,6 @@ using namespace com::sun::star; -std::unique_ptr<sdr::properties::BaseProperties> SdrAttrObj::CreateObjectSpecificProperties() -{ - return std::make_unique<sdr::properties::AttributeProperties>(*this); -} - SdrAttrObj::SdrAttrObj(SdrModel& rSdrModel) : SdrObject(rSdrModel) { diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx index c5741f5007c1..f4d13219db0d 100644 --- a/svx/source/svdraw/svdobj.cxx +++ b/svx/source/svdraw/svdobj.cxx @@ -211,11 +211,6 @@ const std::shared_ptr< svx::diagram::IDiagramHelper >& SdrObject::getDiagramHelp // BaseProperties section -std::unique_ptr<sdr::properties::BaseProperties> SdrObject::CreateObjectSpecificProperties() -{ - return std::make_unique<sdr::properties::EmptyProperties>(*this); -} - sdr::properties::BaseProperties& SdrObject::GetProperties() const { if(!mpProperties) @@ -3245,6 +3240,11 @@ public: return new EmptyObject(rTargetModel, *this); } + virtual std::unique_ptr<sdr::properties::BaseProperties> CreateObjectSpecificProperties() override + { + return std::make_unique<sdr::properties::EmptyProperties>(*this); + } + SdrInventor GetObjInventor() const override { return OBJECT_INVENTOR; diff --git a/svx/source/svdraw/svdovirt.cxx b/svx/source/svdraw/svdovirt.cxx index 25a38804a78b..b1fe6f5cb9bb 100644 --- a/svx/source/svdraw/svdovirt.cxx +++ b/svx/source/svdraw/svdovirt.cxx @@ -18,6 +18,7 @@ */ +#include <sdr/properties/emptyproperties.hxx> #include <svx/svdovirt.hxx> #include <svx/svdhdl.hxx> #include <svx/sdr/contact/viewcontactofvirtobj.hxx> @@ -31,6 +32,11 @@ sdr::properties::BaseProperties& SdrVirtObj::GetProperties() const } +std::unique_ptr<sdr::properties::BaseProperties> SdrVirtObj::CreateObjectSpecificProperties() +{ + return std::make_unique<sdr::properties::EmptyProperties>(*this); +} + // #i27224# std::unique_ptr<sdr::contact::ViewContact> SdrVirtObj::CreateObjectSpecificViewContact() {