diff options
author | Bjoern Michaelsen <bjoern.michaelsen@libreoffice.org> | 2023-03-22 23:18:27 +0100 |
---|---|---|
committer | Bjoern Michaelsen <bjoern.michaelsen@libreoffice.org> | 2023-03-30 21:49:59 +0000 |
commit | 1bdd92bceb5997d5d0ed27b59734c88f7546a4da (patch) | |
tree | c96b63b0ca307c1aecfab08aa01c43489e9bca79 /sw/inc | |
parent | a1f6628e0b73556e0f9fa5f4110068ab7096af1a (diff) |
SwTableFormulaUpdate: SwMsgPoolItem no more
- get rid of legacy call with unused WhichId (TABLEFML_UPDATE)
- simplify and inlune ChangeSate, by now only handling TBL_CALC
- simplify params for UpdateTableFields (explictly just one SwTable*)
Change-Id: Ie356c2a17eab0b557efb54719d33e278b887eef5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149591
Tested-by: Jenkins
Reviewed-by: Bjoern Michaelsen <bjoern.michaelsen@libreoffice.org>
Diffstat (limited to 'sw/inc')
-rw-r--r-- | sw/inc/IDocumentFieldsAccess.hxx | 3 | ||||
-rw-r--r-- | sw/inc/cellatr.hxx | 15 | ||||
-rw-r--r-- | sw/inc/hintids.hxx | 1 | ||||
-rw-r--r-- | sw/inc/hints.hxx | 2 |
4 files changed, 17 insertions, 4 deletions
diff --git a/sw/inc/IDocumentFieldsAccess.hxx b/sw/inc/IDocumentFieldsAccess.hxx index c31e6a646ed0..d0bdfe34589b 100644 --- a/sw/inc/IDocumentFieldsAccess.hxx +++ b/sw/inc/IDocumentFieldsAccess.hxx @@ -38,6 +38,7 @@ class SwMsgPoolItem; class DateTime; class SetGetExpField; class SwNode; +class SwTable; enum class SwFieldIds : sal_uInt16; template <class T> class SwHashTable; struct HashStr; @@ -95,7 +96,7 @@ namespace com::sun::star::uno { class Any; } virtual void UpdateRefFields() = 0; - virtual void UpdateTableFields(SfxPoolItem* pHt) = 0; + virtual void UpdateTableFields(const SwTable* pTable) = 0; virtual void UpdateExpFields(SwTextField* pField, bool bUpdateRefFields) = 0; diff --git a/sw/inc/cellatr.hxx b/sw/inc/cellatr.hxx index 2d85015a8901..05b1e965ef0b 100644 --- a/sw/inc/cellatr.hxx +++ b/sw/inc/cellatr.hxx @@ -26,6 +26,7 @@ #include "format.hxx" #include "hintids.hxx" #include "cellfml.hxx" +#include "node.hxx" class SwHistory; @@ -75,7 +76,19 @@ public: void TryBoxNmToPtr(); void ToSplitMergeBoxNmWithHistory(SwTableFormulaUpdate& rUpdate, SwHistory* pHistory); - void ChangeState( const SfxPoolItem* pItem ); + void ChangeState() + { + if(!m_pDefinedIn) + return; + // detect table that contains this attribute + const SwNode* pNd = GetNodeOfFormula(); + if(!pNd) // || &pNd->GetNodes() != &pNd->GetDoc().GetNodes()) + return; + const SwTableNode* pTableNd = pNd->FindTableNode(); + if(pTableNd == nullptr) + return; + ChgValid(false); + } void Calc( SwTableCalcPara& rCalcPara, double& rValue ); }; diff --git a/sw/inc/hintids.hxx b/sw/inc/hintids.hxx index 330b0042b3a9..a8418566f5ec 100644 --- a/sw/inc/hintids.hxx +++ b/sw/inc/hintids.hxx @@ -433,7 +433,6 @@ constexpr TypedWhichId<SwFormatChg> RES_FMT_CHG(168); constexpr TypedWhichId<SwAttrSetChg> RES_ATTRSET_CHG(169); constexpr TypedWhichId<SwUpdateAttr> RES_UPDATE_ATTR(170); constexpr TypedWhichId<SwPtrMsgPoolItem> RES_REFMARKFLD_UPDATE(171); -constexpr TypedWhichId<SwTableFormulaUpdate> RES_TABLEFML_UPDATE(173); constexpr TypedWhichId<SwMsgPoolItem> RES_UPDATEDDETBL(174); constexpr TypedWhichId<SwMsgPoolItem> RES_TBLHEADLINECHG(175); constexpr TypedWhichId<SwAutoFormatGetDocNode> RES_AUTOFMT_DOCNODE(176); diff --git a/sw/inc/hints.hxx b/sw/inc/hints.hxx index 2b870373dcf1..6b993795c058 100644 --- a/sw/inc/hints.hxx +++ b/sw/inc/hints.hxx @@ -299,7 +299,7 @@ enum TableFormulaUpdateFlags { TBL_CALC = 0, TBL_MERGETBL, TBL_SPLITTBL }; -class SwTableFormulaUpdate final : public SwMsgPoolItem +class SwTableFormulaUpdate final { public: const SwTable* m_pTable; ///< Pointer to the current table |