sw/inc/expfld.hxx | 4 ++-- sw/source/core/fields/expfld.cxx | 10 ++++++---- 2 files changed, 8 insertions(+), 6 deletions(-)
New commits: commit 70110bf540449c7a71b6404d576479fededf7172 Author: Bjoern Michaelsen <bjoern.michael...@libreoffice.org> AuthorDate: Sun Dec 6 22:44:27 2020 +0100 Commit: Bjoern Michaelsen <bjoern.michael...@libreoffice.org> CommitDate: Mon Dec 7 11:40:30 2020 +0100 Sw{Get,Set}ExpFieldType: Modify no more Change-Id: Id0daf2aa04663127dcbd78d2206d81aab6a783f8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107321 Tested-by: Jenkins Reviewed-by: Bjoern Michaelsen <bjoern.michael...@libreoffice.org> diff --git a/sw/inc/expfld.hxx b/sw/inc/expfld.hxx index 7517afc34715..465379112c58 100644 --- a/sw/inc/expfld.hxx +++ b/sw/inc/expfld.hxx @@ -76,7 +76,7 @@ public: /** Overlay, because get-field cannot be changed and therefore does not need to be updated. Update at changing of set-values! */ private: - virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew ) override; + virtual void SwClientNotify(const SwModify&, const SfxHint&) override; }; class SW_DLLPUBLIC SwGetExpField final : public SwFormulaField @@ -149,7 +149,7 @@ class SW_DLLPUBLIC SwSetExpFieldType final : public SwValueFieldType sal_uInt8 m_nLevel; bool m_bDeleted; - virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew ) override; + virtual void SwClientNotify(const SwModify&, const SfxHint&) override; public: SwSetExpFieldType( SwDoc* pDoc, const OUString& rName, diff --git a/sw/source/core/fields/expfld.cxx b/sw/source/core/fields/expfld.cxx index 6384010b9bde..ceea88941ddb 100644 --- a/sw/source/core/fields/expfld.cxx +++ b/sw/source/core/fields/expfld.cxx @@ -271,11 +271,13 @@ std::unique_ptr<SwFieldType> SwGetExpFieldType::Copy() const return std::make_unique<SwGetExpFieldType>(GetDoc()); } -void SwGetExpFieldType::Modify( const SfxPoolItem*, const SfxPoolItem* pNew ) +void SwGetExpFieldType::SwClientNotify(const SwModify&, const SfxHint& rHint) { - if( pNew && RES_DOCPOS_UPDATE == pNew->Which() ) - NotifyClients( nullptr, pNew ); + auto pLegacy = dynamic_cast<const sw::LegacyModifyHint*>(&rHint); // do not expand anything else + if(!pLegacy || (pLegacy->GetWhich() != RES_DOCPOS_UPDATE)) + return; + CallSwClientNotify(rHint); } SwGetExpField::SwGetExpField(SwGetExpFieldType* pTyp, const OUString& rFormel, @@ -546,7 +548,7 @@ void SwSetExpField::ChgExpStr(const OUString& rExpand, SwRootFrame const*const p } } -void SwSetExpFieldType::Modify( const SfxPoolItem*, const SfxPoolItem* ) +void SwSetExpFieldType::SwClientNotify(const SwModify&, const SfxHint&) { // do not expand further } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits