[Libreoffice-commits] core.git: sw/inc sw/source
Bjoern Michaelsen (via logerrit)
logerrit at kemper.freedesktop.org
Mon Dec 7 10:40:41 UTC 2020
sw/inc/docufld.hxx | 6 +++---
sw/source/core/fields/docufld.cxx | 11 +++++++----
2 files changed, 10 insertions(+), 7 deletions(-)
New commits:
commit 8144e8133be99e3ad6c767756417d604cec2c3a5
Author: Bjoern Michaelsen <bjoern.michaelsen at libreoffice.org>
AuthorDate: Sun Dec 6 22:06:20 2020 +0100
Commit: Bjoern Michaelsen <bjoern.michaelsen at libreoffice.org>
CommitDate: Mon Dec 7 11:40:03 2020 +0100
SwRefPageSetFieldType: Modify no more
Change-Id: I313237069eeafd5913468e18e2eb34e9ef185302
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107320
Tested-by: Jenkins
Reviewed-by: Bjoern Michaelsen <bjoern.michaelsen at libreoffice.org>
diff --git a/sw/inc/docufld.hxx b/sw/inc/docufld.hxx
index 62363f01bbd1..5da1a4729bcb 100644
--- a/sw/inc/docufld.hxx
+++ b/sw/inc/docufld.hxx
@@ -574,8 +574,8 @@ public:
virtual std::unique_ptr<SwFieldType> Copy() const override;
private:
- /// Overlay, because there is nothing to update!
- virtual void Modify( const SfxPoolItem*, const SfxPoolItem * ) override;
+ /// noop, there is nothing to update!
+ virtual void SwClientNotify(const SwModify&, const SfxHint&) override;
};
// Relative page numbering.
@@ -611,7 +611,7 @@ class SwRefPageGetFieldType final : public SwFieldType
SetGetExpFields const & rSetList, SwRootFrame const* pLayout);
/// overwritten to update all RefPageGet fields
- virtual void Modify( const SfxPoolItem*, const SfxPoolItem * ) override;
+ virtual void SwClientNotify(const SwModify&, const SfxHint&) override;
public:
SwRefPageGetFieldType( SwDoc& rDoc );
virtual std::unique_ptr<SwFieldType> Copy() const override;
diff --git a/sw/source/core/fields/docufld.cxx b/sw/source/core/fields/docufld.cxx
index b32c4937ed1e..a5472dd27776 100644
--- a/sw/source/core/fields/docufld.cxx
+++ b/sw/source/core/fields/docufld.cxx
@@ -2087,7 +2087,7 @@ std::unique_ptr<SwFieldType> SwRefPageSetFieldType::Copy() const
}
// overridden since there is nothing to update
-void SwRefPageSetFieldType::Modify( const SfxPoolItem*, const SfxPoolItem * )
+void SwRefPageSetFieldType::SwClientNotify(const SwModify&, const SfxHint&)
{
}
@@ -2165,8 +2165,11 @@ std::unique_ptr<SwFieldType> SwRefPageGetFieldType::Copy() const
return pNew;
}
-void SwRefPageGetFieldType::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
+void SwRefPageGetFieldType::SwClientNotify(const SwModify&, const SfxHint& rHint)
{
+ auto pLegacy = dynamic_cast<const sw::LegacyModifyHint*>(&rHint);
+ if(!pLegacy)
+ return;
auto const ModifyImpl = [this](SwRootFrame const*const pLayout)
{
// first collect all SetPageRefFields
@@ -2181,7 +2184,7 @@ void SwRefPageGetFieldType::Modify( const SfxPoolItem* pOld, const SfxPoolItem*
};
// update all GetReference fields
- if( !pNew && !pOld && HasWriterListeners() )
+ if( !pLegacy->m_pNew && !pLegacy->m_pOld && HasWriterListeners() )
{
SwRootFrame const* pLayout(nullptr);
SwRootFrame const* pLayoutRLHidden(nullptr);
@@ -2204,7 +2207,7 @@ void SwRefPageGetFieldType::Modify( const SfxPoolItem* pOld, const SfxPoolItem*
}
// forward to text fields, they "expand" the text
- NotifyClients( pOld, pNew );
+ CallSwClientNotify(rHint);
}
bool SwRefPageGetFieldType::MakeSetList(SetGetExpFields& rTmpLst,
More information about the Libreoffice-commits
mailing list