From 4b49aaf56d4166a2f42e5112bbdb5f17bd32267b Mon Sep 17 00:00:00 2001 From: Bjoern Michaelsen Date: Fri, 20 Sep 2019 01:35:39 +0200 Subject: no more SwClient: sw/source/filter/html MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I45915fa65157aa6a16ecee238d9072d359d3b464 Reviewed-on: https://gerrit.libreoffice.org/79264 Tested-by: Jenkins Reviewed-by: Björn Michaelsen --- sw/source/filter/html/htmltab.cxx | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'sw') 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 #include #include +#include #include #include @@ -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(&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(); } } -- cgit