[Libreoffice-commits] core.git: sw/source
Bjoern Michaelsen (via logerrit)
logerrit at kemper.freedesktop.org
Fri Sep 20 01:12:47 UTC 2019
sw/source/filter/html/htmltab.cxx | 20 ++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
New commits:
commit 4b49aaf56d4166a2f42e5112bbdb5f17bd32267b
Author: Bjoern Michaelsen <bjoern.michaelsen at libreoffice.org>
AuthorDate: Fri Sep 20 01:35:39 2019 +0200
Commit: Björn Michaelsen <bjoern.michaelsen at libreoffice.org>
CommitDate: Fri Sep 20 03:11:44 2019 +0200
no more SwClient: sw/source/filter/html
Change-Id: I45915fa65157aa6a16ecee238d9072d359d3b464
Reviewed-on: https://gerrit.libreoffice.org/79264
Tested-by: Jenkins
Reviewed-by: Björn Michaelsen <bjoern.michaelsen at libreoffice.org>
diff --git a/sw/source/filter/html/htmltab.cxx b/sw/source/filter/html/htmltab.cxx
index 168a5d2e40e8..a592cd48e9b4 100644
--- a/sw/source/filter/html/htmltab.cxx
+++ b/sw/source/filter/html/htmltab.cxx
@@ -34,6 +34,7 @@
#include <svtools/htmltokn.h>
#include <svtools/htmlkywd.hxx>
#include <svl/urihelper.hxx>
+#include <svl/listener.hxx>
#include <sal/log.hxx>
#include <dcontact.hxx>
@@ -4860,22 +4861,24 @@ HTMLTableOptions::HTMLTableOptions( const HTMLOptions& rOptions,
namespace
{
- class FrameDeleteWatch : public SwClient
+ class FrameDeleteWatch final: public SvtListener
{
+ SwFrameFormat* m_pFormat;
public:
- FrameDeleteWatch(SwFrameFormat* pObjectFormat)
+ FrameDeleteWatch(SwFrameFormat* pFormat)
+ : m_pFormat(pFormat)
{
- if (pObjectFormat)
- pObjectFormat->Add(this);
+ if(m_pFormat)
+ StartListening(pFormat->GetNotifier());
}
- virtual void SwClientNotify(const SwModify& rModify, const SfxHint& rHint) override
+ virtual void Notify(const SfxHint& rHint) override
{
- SwClient::SwClientNotify(rModify, rHint);
if (auto pDrawFrameFormatHint = dynamic_cast<const sw::DrawFrameFormatHint*>(&rHint))
{
if (pDrawFrameFormatHint->m_eId == sw::DrawFrameFormatHintId::DYING)
{
+ m_pFormat = nullptr;
EndListeningAll();
}
}
@@ -4883,11 +4886,12 @@ namespace
bool WasDeleted() const
{
- return !GetRegisteredIn();
+ return !m_pFormat;
}
virtual ~FrameDeleteWatch() override
{
+ m_pFormat = nullptr;
EndListeningAll();
}
};
@@ -4977,7 +4981,7 @@ void SwHTMLParser::DeleteSection(SwStartNode* pSttNd)
if (aWatch.WasDeleted())
m_pMarquee = nullptr;
else
- pObjectFormat->Remove(&aWatch);
+ aWatch.EndListeningAll();
}
}
More information about the Libreoffice-commits
mailing list