[Libreoffice-commits] core.git: sw/inc sw/source

Bjoern Michaelsen (via logerrit) logerrit at kemper.freedesktop.org
Mon Dec 7 10:41:35 UTC 2020


 sw/inc/usrfld.hxx                |    2 +-
 sw/source/core/fields/usrfld.cxx |   12 ++++++------
 2 files changed, 7 insertions(+), 7 deletions(-)

New commits:
commit 43d07ddf487fae1b966abf00a36612b109ed01fc
Author:     Bjoern Michaelsen <bjoern.michaelsen at libreoffice.org>
AuthorDate: Sun Dec 6 22:56:14 2020 +0100
Commit:     Bjoern Michaelsen <bjoern.michaelsen at libreoffice.org>
CommitDate: Mon Dec 7 11:40:54 2020 +0100

    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 at libreoffice.org>

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();
     }
 }


More information about the Libreoffice-commits mailing list