diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2022-01-06 21:19:51 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-01-07 11:11:59 +0100 |
commit | c52aa97b988aeeb16d1eb21262889f565b8a72a3 (patch) | |
tree | b9525f57c24bba13e6a33a2c5a851b3d1af4375e /include/svx/sdr | |
parent | 81ccab11ff457786c3877e7b0047d08685493d3c (diff) |
move some methods BaseProperties->DefaultProperties
These methods are part of the implementation of DefaultProperties,
so they do not belong in a superclass
Change-Id: I553f5d5b771aa0a408a8ade25f009cc56f829c72
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128091
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include/svx/sdr')
-rw-r--r-- | include/svx/sdr/properties/defaultproperties.hxx | 27 | ||||
-rw-r--r-- | include/svx/sdr/properties/properties.hxx | 21 |
2 files changed, 17 insertions, 31 deletions
diff --git a/include/svx/sdr/properties/defaultproperties.hxx b/include/svx/sdr/properties/defaultproperties.hxx index b7e5d706aff1..38cb31c1710f 100644 --- a/include/svx/sdr/properties/defaultproperties.hxx +++ b/include/svx/sdr/properties/defaultproperties.hxx @@ -39,20 +39,27 @@ namespace sdr::properties // the to be used ItemSet mutable std::optional<SfxItemSet> mxItemSet; - // create a new itemset - virtual SfxItemSet CreateObjectSpecificItemSet(SfxItemPool& rPool) override; + // create a new object specific itemset with object specific ranges. + virtual SfxItemSet CreateObjectSpecificItemSet(SfxItemPool& pPool); - // test changeability for a single item - virtual bool AllowItemChange(const sal_uInt16 nWhich, const SfxPoolItem* pNewItem = nullptr) const override; + // Test changeability for a single item. If an implementation wants to prevent + // changing an item it should override this method. + virtual bool AllowItemChange(const sal_uInt16 nWhich, const SfxPoolItem* pNewItem = nullptr) const; - // Do the ItemChange, may do special handling - virtual void ItemChange(const sal_uInt16 nWhich, const SfxPoolItem* pNewItem = nullptr) override; + // Do the internal ItemChange. If only nWhich is given, the item needs to be cleared. + // Also needs to handle if nWhich and pNewItem is 0, which means to clear all items. + virtual void ItemChange(const sal_uInt16 nWhich, const SfxPoolItem* pNewItem = nullptr); - // Called after ItemChange() is done for all items. - virtual void PostItemChange(const sal_uInt16 nWhich) override; + // Called after ItemChange() is done for all items. Allows local reactions on + // specific item changes + virtual void PostItemChange(const sal_uInt16 nWhich); - // react on ItemSet changes - virtual void ItemSetChanged(const SfxItemSet*) override; + // Internally react on ItemSet changes. The given ItemSet contains all changed items, the new ones. + virtual void ItemSetChanged(const SfxItemSet*); + + // Subclasses need to return true if they want the ItemSetChanged() callback to actually have a non-zero pointer. + // We do this because creating the temporary item set is expensive and seldom used. + virtual bool WantItemSetInItemSetChanged() const { return false; } // check if SfxItemSet exists bool HasSfxItemSet() const { return bool(mxItemSet); } diff --git a/include/svx/sdr/properties/properties.hxx b/include/svx/sdr/properties/properties.hxx index f27aa5d39d3e..1b74802f0df2 100644 --- a/include/svx/sdr/properties/properties.hxx +++ b/include/svx/sdr/properties/properties.hxx @@ -83,32 +83,11 @@ namespace sdr::properties // apply the correct SfyStyleSheet from SdrObject's SdrModel virtual void applyDefaultStyleSheetFromSdrModel(); - // create a new object specific itemset with object specific ranges. - virtual SfxItemSet CreateObjectSpecificItemSet(SfxItemPool& pPool) = 0; - // internal access to SdrObject const SdrObject& GetSdrObject() const; SdrObject& GetSdrObject(); - // Test changeability for a single item. If an implementation wants to prevent - // changing an item it should override this method. - virtual bool AllowItemChange(const sal_uInt16 nWhich, const SfxPoolItem* pNewItem = nullptr) const = 0; - - // Do the internal ItemChange. If only nWhich is given, the item needs to be cleared. - // Also needs to handle if nWhich and pNewItem is 0, which means to clear all items. - virtual void ItemChange(const sal_uInt16 nWhich, const SfxPoolItem* pNewItem = nullptr) = 0; - - // Called after ItemChange() is done for all items. Allows local reactions on - // specific item changes - virtual void PostItemChange(const sal_uInt16 nWhich) = 0; - - // Internally react on ItemSet changes. The given ItemSet contains all changed items, the new ones. - virtual void ItemSetChanged(const SfxItemSet*) = 0; - // Subclasses need to return true if they want the ItemSetChanged() callback to actually have a non-zero pointer. - // We do this because creating the temporary item set is expensive and seldom used. - virtual bool WantItemSetInItemSetChanged() const { return false; } - public: // basic constructor, used from SdrObject. explicit BaseProperties(SdrObject& rObj); |