summaryrefslogtreecommitdiff
path: root/sw/inc/calbck.hxx
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@libreoffice.org>2020-11-10 22:40:47 +0100
committerBjoern Michaelsen <bjoern.michaelsen@libreoffice.org>2020-11-12 00:11:29 +0100
commitab72e9fe38b5d30bd1a0393e1611ae969919908f (patch)
treec8569abfaf1bd7a5c8d2247a314c716996650213 /sw/inc/calbck.hxx
parent1abf4e6d07ca0ac31bc54f812df84efc82d2af1b (diff)
Make SwClientNotifyCall protected
Change-Id: I1da6cd45c5039f2b36ae6d8a64febc69eda9c6d5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105569 Tested-by: Jenkins Reviewed-by: Bjoern Michaelsen <bjoern.michaelsen@libreoffice.org>
Diffstat (limited to 'sw/inc/calbck.hxx')
-rw-r--r--sw/inc/calbck.hxx10
1 files changed, 8 insertions, 2 deletions
diff --git a/sw/inc/calbck.hxx b/sw/inc/calbck.hxx
index 8550a3be543f..8fbb2e87e0b2 100644
--- a/sw/inc/calbck.hxx
+++ b/sw/inc/calbck.hxx
@@ -136,6 +136,9 @@ protected:
// write access to pRegisteredIn shall be granted only to the object itself (protected access)
SwModify* GetRegisteredInNonConst() const { return m_pRegisteredIn; }
+ // when overriding this, you MUST call SwClient::SwClientModify() in the override!
+ virtual void SwClientNotify(const SwModify&, const SfxHint& rHint) override;
+
public:
SwClient() : m_pRegisteredIn(nullptr) {}
SwClient(SwClient&&) noexcept;
@@ -145,13 +148,16 @@ public:
// mba: IMHO this method should be pure virtual
// DO NOT USE IN NEW CODE! use SwClientNotify instead.
virtual void Modify(const SfxPoolItem*, const SfxPoolItem*);
- // when overriding this, you MUST call SwClient::SwClientModify() in the override!
- virtual void SwClientNotify(const SwModify&, const SfxHint& rHint) override;
+
// in case an SwModify object is destroyed that itself is registered in another SwModify,
// its SwClient objects can decide to get registered to the latter instead by calling this method
std::unique_ptr<sw::ModifyChangedHint> CheckRegistration( const SfxPoolItem* pOldValue );
+ // DO NOT USE IN NEW CODE! Used to directly call the event handler from
+ // outside the class. It is generally wrong to call the message handler
+ // directly: either it should be a proper stand-alone member function
+ // or by the observed object sending the hint properly itself.
void SwClientNotifyCall( const SwModify& rModify, const SfxHint& rHint ) { SwClientNotify( rModify, rHint ); }
const SwModify* GetRegisteredIn() const { return m_pRegisteredIn; }