diff options
author | Bjoern Michaelsen <bjoern.michaelsen@libreoffice.org> | 2020-12-06 22:56:14 +0100 |
---|---|---|
committer | Bjoern Michaelsen <bjoern.michaelsen@libreoffice.org> | 2020-12-07 11:40:54 +0100 |
commit | 43d07ddf487fae1b966abf00a36612b109ed01fc (patch) | |
tree | a74ed8cc60623ecd6d85785215300cc54e420b81 /sw | |
parent | 70110bf540449c7a71b6404d576479fededf7172 (diff) |
SwUserFieldType: Modify no more
Change-Id: I1194225011380bf63d854f8054d063e93a832744
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107322
Tested-by: Jenkins
Reviewed-by: Bjoern Michaelsen <bjoern.michaelsen@libreoffice.org>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/usrfld.hxx | 2 | ||||
-rw-r--r-- | sw/source/core/fields/usrfld.cxx | 12 |
2 files changed, 7 insertions, 7 deletions
diff --git a/sw/inc/usrfld.hxx b/sw/inc/usrfld.hxx index 589c379a5d1c..3592c6834380 100644 --- a/sw/inc/usrfld.hxx +++ b/sw/inc/usrfld.hxx @@ -73,7 +73,7 @@ public: void dumpAsXml(xmlTextWriterPtr pWriter) const override; private: - virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) override; + virtual void SwClientNotify(const SwModify&, const SfxHint&) override; }; inline bool SwUserFieldType::IsValid() const diff --git a/sw/source/core/fields/usrfld.cxx b/sw/source/core/fields/usrfld.cxx index 07a75a42608f..431a3ba0675f 100644 --- a/sw/source/core/fields/usrfld.cxx +++ b/sw/source/core/fields/usrfld.cxx @@ -213,18 +213,18 @@ OUString SwUserFieldType::GetName() const return m_aName; } -void SwUserFieldType::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) +void SwUserFieldType::SwClientNotify(const SwModify&, const SfxHint& rHint) { - if( !pOld && !pNew ) + auto pLegacy = dynamic_cast<const sw::LegacyModifyHint*>(&rHint); + if(!pLegacy->m_pOld && !pLegacy->m_pNew) m_bValidValue = false; - NotifyClients( pOld, pNew ); - + CallSwClientNotify(rHint); // update input fields that might be connected to the user field - if ( !IsModifyLocked() ) + if (!IsModifyLocked()) { LockModify(); - GetDoc()->getIDocumentFieldsAccess().GetSysFieldType( SwFieldIds::Input )->UpdateFields(); + GetDoc()->getIDocumentFieldsAccess().GetSysFieldType(SwFieldIds::Input)->UpdateFields(); UnlockModify(); } } |