summaryrefslogtreecommitdiff
path: root/sw/inc
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@libreoffice.org>2021-01-12 01:37:29 +0100
committerBjoern Michaelsen <bjoern.michaelsen@libreoffice.org>2021-01-13 18:20:37 +0100
commit8dd78873a9de028c0d9f1f1aee537e85f74d2300 (patch)
tree873a19299f79a67f9623f8cd3a8d8f417b3ab26d /sw/inc
parentdd7825765f83d09d132d1e6138b27cb03564aae8 (diff)
Move SwFntCache link from SwModify down to SwFormat
- apparently only SwTextFormatColls are ever in the SwFntCache - however lots of SwFormat members need to clear the cache - so for now, only move it down to SwFormat - this should make SwModify less of a kitchen sink Change-Id: I389fc9f0a9d9b18b5914f24ae62c5d4119bc468f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109154 Tested-by: Jenkins Reviewed-by: Bjoern Michaelsen <bjoern.michaelsen@libreoffice.org>
Diffstat (limited to 'sw/inc')
-rw-r--r--sw/inc/calbck.hxx5
-rw-r--r--sw/inc/format.hxx23
2 files changed, 23 insertions, 5 deletions
diff --git a/sw/inc/calbck.hxx b/sw/inc/calbck.hxx
index 31df9791291b..b5b6ff9a3e30 100644
--- a/sw/inc/calbck.hxx
+++ b/sw/inc/calbck.hxx
@@ -178,7 +178,6 @@ class SW_DLLPUBLIC SwModify: public SwClient
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_bInSwFntCache : 1;
SwModify(SwModify const &) = delete;
SwModify &operator =(const SwModify&) = delete;
@@ -186,7 +185,7 @@ protected:
virtual void SwClientNotify(const SwModify&, const SfxHint& rHint) override;
public:
SwModify()
- : SwClient(), m_pWriterListeners(nullptr), m_bModifyLocked(false), m_bInCache(false), m_bInSwFntCache(false)
+ : SwClient(), m_pWriterListeners(nullptr), m_bModifyLocked(false), m_bInCache(false)
{}
// broadcasting mechanism
@@ -204,11 +203,9 @@ public:
void LockModify() { m_bModifyLocked = true; }
void UnlockModify() { m_bModifyLocked = false; }
void SetInCache( bool bNew ) { m_bInCache = bNew; }
- void SetInSwFntCache( bool bNew ) { m_bInSwFntCache = bNew; }
void SetInDocDTOR();
bool IsModifyLocked() const { return m_bModifyLocked; }
bool IsInCache() const { return m_bInCache; }
- bool IsInSwFntCache() const { return m_bInSwFntCache; }
void CheckCaching( const sal_uInt16 nWhich );
bool HasOnlyOneListener() const { return m_pWriterListeners && m_pWriterListeners->IsLast(); }
diff --git a/sw/inc/format.hxx b/sw/inc/format.hxx
index e596a26bb882..96e03b342eec 100644
--- a/sw/inc/format.hxx
+++ b/sw/inc/format.hxx
@@ -22,6 +22,7 @@
#include "swdllapi.h"
#include "swatrset.hxx"
#include "calbck.hxx"
+#include "hintids.hxx"
#include <memory>
class IDocumentSettingAccess;
@@ -59,7 +60,25 @@ class SW_DLLPUBLIC SwFormat : public sw::BroadcastingModify
bool m_bAutoUpdateFormat : 1;/**< TRUE: Set attributes of a whole paragraph
at format (UI-side!). */
bool m_bHidden : 1;
+ bool m_bInSwFntCache : 1;
std::shared_ptr<SfxGrabBagItem> m_pGrabBagItem; ///< Style InteropGrabBag.
+ void InvalidateInSwFntCache(sal_uInt16 nWhich)
+ {
+ if(isCHRATR(nWhich))
+ {
+ m_bInSwFntCache = false;
+ }
+ else
+ {
+ switch(nWhich)
+ {
+ case RES_OBJECTDYING:
+ case RES_FMT_CHG:
+ case RES_ATTRSET_CHG:
+ m_bInSwFntCache = false;
+ }
+ }
+ };
protected:
SwFormat( SwAttrPool& rPool, const char* pFormatNm,
@@ -75,7 +94,9 @@ public:
SwFormat &operator=(const SwFormat&);
/// for Querying of Writer-functions.
- sal_uInt16 Which() const { return m_nWhichId; }
+ sal_uInt16 Which() const { return m_nWhichId; };
+ bool IsInSwFntCache() const { return m_bInSwFntCache; };
+ void SetInSwFntCache() { m_bInSwFntCache = true; };
/// Copy attributes even among documents.
void CopyAttrs( const SwFormat& );