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>
diff --git a/sw/inc/usrfld.hxx b/sw/inc/usrfld.hxx
index 589c379..3592c68 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 07a75a4..431a3ba 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();
    }
}