[Libreoffice-commits] core.git: sw/inc sw/source
Bjoern Michaelsen (via logerrit)
logerrit at kemper.freedesktop.org
Mon Dec 7 10:41:16 UTC 2020
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.michaelsen at libreoffice.org>
AuthorDate: Sun Dec 6 22:44:27 2020 +0100
Commit: Bjoern Michaelsen <bjoern.michaelsen at 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.michaelsen at 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
}
More information about the Libreoffice-commits
mailing list