summaryrefslogtreecommitdiff
path: root/sw/inc/calbck.hxx
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@libreoffice.org>2021-01-23 01:09:49 +0100
committerBjoern Michaelsen <bjoern.michaelsen@libreoffice.org>2021-01-29 23:10:59 +0100
commitd77552970af7ffb9d06bcd57315979f317e94e2f (patch)
tree9ba78f893f57efc2ab0f8d542abb70032c240ee3 /sw/inc/calbck.hxx
parentc6ff20f1c101372be46a2583ec0c83ff021690a9 (diff)
remove SwCache bookkeeping from SwModify
- only very few classes (SwNode, SwFormat) are the "owners" of SwBorderAttrs in the SwCache - this bookkeeping should not be in such a fundamental class of writer - also: encapsulate most of the interaction with the cache in the new sw::BorderCacheOwner. This is mostly to protect the innocent user: * As interacting with the SwCache directly is very errorprone, because its glorious idea of using void* of the "owners" as keys to the entries. * In C++, reinterpret_cast<void*>(this) might be different along the class heirachy. This might easily slip under the radar of a casual user. Change-Id: I0da774b47885abf52f63aab8d93ebbf41dcf8040 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110112 Tested-by: Jenkins Reviewed-by: Bjoern Michaelsen <bjoern.michaelsen@libreoffice.org>
Diffstat (limited to 'sw/inc/calbck.hxx')
-rw-r--r--sw/inc/calbck.hxx7
1 files changed, 2 insertions, 5 deletions
diff --git a/sw/inc/calbck.hxx b/sw/inc/calbck.hxx
index b5b6ff9a3e30..32b0d35b4c1d 100644
--- a/sw/inc/calbck.hxx
+++ b/sw/inc/calbck.hxx
@@ -176,8 +176,7 @@ class SW_DLLPUBLIC SwModify: public SwClient
friend void sw::ClientNotifyAttrChg(SwModify&, const SwAttrSet&, SwAttrSet&, SwAttrSet&);
template<typename E, typename S, sw::IteratorMode> friend class SwIterator;
sw::WriterListener* m_pWriterListeners; // the start of the linked list of clients
- bool m_bModifyLocked : 1; // don't broadcast changes now
- bool m_bInCache : 1;
+ bool m_bModifyLocked; // don't broadcast changes now
SwModify(SwModify const &) = delete;
SwModify &operator =(const SwModify&) = delete;
@@ -185,7 +184,7 @@ protected:
virtual void SwClientNotify(const SwModify&, const SfxHint& rHint) override;
public:
SwModify()
- : SwClient(), m_pWriterListeners(nullptr), m_bModifyLocked(false), m_bInCache(false)
+ : SwClient(), m_pWriterListeners(nullptr), m_bModifyLocked(false)
{}
// broadcasting mechanism
@@ -202,10 +201,8 @@ public:
void LockModify() { m_bModifyLocked = true; }
void UnlockModify() { m_bModifyLocked = false; }
- void SetInCache( bool bNew ) { m_bInCache = bNew; }
void SetInDocDTOR();
bool IsModifyLocked() const { return m_bModifyLocked; }
- bool IsInCache() const { return m_bInCache; }
void CheckCaching( const sal_uInt16 nWhich );
bool HasOnlyOneListener() const { return m_pWriterListeners && m_pWriterListeners->IsLast(); }