From 1bdd92bceb5997d5d0ed27b59734c88f7546a4da Mon Sep 17 00:00:00 2001 From: Bjoern Michaelsen Date: Wed, 22 Mar 2023 23:18:27 +0100 Subject: 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 --- sw/inc/IDocumentFieldsAccess.hxx | 3 ++- sw/inc/cellatr.hxx | 15 ++++++++++++++- sw/inc/hintids.hxx | 1 - sw/inc/hints.hxx | 2 +- 4 files changed, 17 insertions(+), 4 deletions(-) (limited to 'sw/inc') 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 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 RES_FMT_CHG(168); constexpr TypedWhichId RES_ATTRSET_CHG(169); constexpr TypedWhichId RES_UPDATE_ATTR(170); constexpr TypedWhichId RES_REFMARKFLD_UPDATE(171); -constexpr TypedWhichId RES_TABLEFML_UPDATE(173); constexpr TypedWhichId RES_UPDATEDDETBL(174); constexpr TypedWhichId RES_TBLHEADLINECHG(175); constexpr TypedWhichId 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 -- cgit