diff options
author | Bjoern Michaelsen <bjoern.michaelsen@libreoffice.org> | 2021-01-19 23:39:17 +0100 |
---|---|---|
committer | Bjoern Michaelsen <bjoern.michaelsen@libreoffice.org> | 2021-01-25 00:43:49 +0100 |
commit | 6c8a6b6aa2f962bd2fadbdf27405bfcd7d167fec (patch) | |
tree | ea676a5aeaa5844d04be36f0686649724f04b276 /sw/inc | |
parent | 013d6da8737ec074f9e398ec27cb91926572b2b4 (diff) |
SwFntCache: move down from SwFormat to SwTextFormatCol where possible
Change-Id: Ia5dcc3b1145c6bd65253577499da3bb80d82e926
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109659
Tested-by: Jenkins
Reviewed-by: Bjoern Michaelsen <bjoern.michaelsen@libreoffice.org>
Diffstat (limited to 'sw/inc')
-rw-r--r-- | sw/inc/fmtcol.hxx | 24 | ||||
-rw-r--r-- | sw/inc/format.hxx | 21 |
2 files changed, 25 insertions, 20 deletions
diff --git a/sw/inc/fmtcol.hxx b/sw/inc/fmtcol.hxx index 07f157f13bf2..10a41b9d9b78 100644 --- a/sw/inc/fmtcol.hxx +++ b/sw/inc/fmtcol.hxx @@ -66,6 +66,8 @@ class SW_DLLPUBLIC SwTextFormatColl bool mbAssignedToOutlineStyle; + bool m_bInSwFntCache; + SwTextFormatColl *mpNextTextFormatColl; protected: @@ -75,6 +77,7 @@ protected: : SwFormatColl(rPool, pFormatCollName, aTextFormatCollSetRange, pDerFrom, nFormatWh) , mbStayAssignedToListLevelOfOutlineStyle(false) , mbAssignedToOutlineStyle(false) + , m_bInSwFntCache(false) { mpNextTextFormatColl = this; } @@ -85,6 +88,7 @@ protected: : SwFormatColl(rPool, rFormatCollName, aTextFormatCollSetRange, pDerFrom, nFormatWh) , mbStayAssignedToListLevelOfOutlineStyle(false) , mbAssignedToOutlineStyle(false) + , m_bInSwFntCache(false) { mpNextTextFormatColl = this; } @@ -93,6 +97,7 @@ protected: virtual void SwClientNotify(const SwModify&, const SfxHint&) override; public: + virtual ~SwTextFormatColl(); inline void SetNextTextFormatColl(SwTextFormatColl& rNext); SwTextFormatColl& GetNextTextFormatColl() const { return *mpNextTextFormatColl; } @@ -138,6 +143,25 @@ public: if(HasWriterListeners() && !IsModifyLocked()) CallSwClientNotify(sw::LegacyModifyHint(&rDrop, &rDrop)); }; + bool IsInSwFntCache() const { return m_bInSwFntCache; }; + void SetInSwFntCache() { m_bInSwFntCache = true; }; + virtual void InvalidateInSwFntCache(sal_uInt16 nWhich) override + { + if(isCHRATR(nWhich)) + { + m_bInSwFntCache = false; + } + else + { + switch(nWhich) + { + case RES_OBJECTDYING: + case RES_FMT_CHG: + case RES_ATTRSET_CHG: + m_bInSwFntCache = false; + } + } + }; }; class SwGrfFormatColl final : public SwFormatColl diff --git a/sw/inc/format.hxx b/sw/inc/format.hxx index 96e03b342eec..f1e301ba50d0 100644 --- a/sw/inc/format.hxx +++ b/sw/inc/format.hxx @@ -60,25 +60,8 @@ 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; - } - } - }; + virtual void InvalidateInSwFntCache(sal_uInt16) {}; protected: SwFormat( SwAttrPool& rPool, const char* pFormatNm, @@ -95,8 +78,6 @@ public: /// for Querying of Writer-functions. 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& ); |