summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@libreoffice.org>2020-12-06 22:44:27 +0100
committerBjoern Michaelsen <bjoern.michaelsen@libreoffice.org>2020-12-07 11:40:30 +0100
commit70110bf540449c7a71b6404d576479fededf7172 (patch)
treec437fa2b94baa0bed385292d8278b4ff3ce61324 /sw
parent8144e8133be99e3ad6c767756417d604cec2c3a5 (diff)
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.michaelsen@libreoffice.org>
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/expfld.hxx4
-rw-r--r--sw/source/core/fields/expfld.cxx10
2 files changed, 8 insertions, 6 deletions
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
}