[Libreoffice-commits] core.git: sw/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Mon Feb 25 18:55:35 UTC 2019
sw/source/core/inc/unoflatpara.hxx | 8 +++-----
sw/source/core/unocore/unoflatpara.cxx | 8 +++-----
2 files changed, 6 insertions(+), 10 deletions(-)
New commits:
commit 91d4a3b0c79d9abb6fb15b3afa173f8ff2f0b079
Author: Bjoern Michaelsen <bjoern.michaelsen at libreoffice.org>
AuthorDate: Sun Feb 24 18:59:44 2019 +0100
Commit: Björn Michaelsen <bjoern.michaelsen at libreoffice.org>
CommitDate: Mon Feb 25 19:55:09 2019 +0100
UNO paragraph iterator: uno SvtListener instead of SwClient
Change-Id: Ic428cf9b1d7f3aed60b941445d4ddf52a8c2415c
Reviewed-on: https://gerrit.libreoffice.org/68289
Tested-by: Jenkins
Reviewed-by: Björn Michaelsen <bjoern.michaelsen at libreoffice.org>
diff --git a/sw/source/core/inc/unoflatpara.hxx b/sw/source/core/inc/unoflatpara.hxx
index 5449119523e7..ad584dbb4400 100644
--- a/sw/source/core/inc/unoflatpara.hxx
+++ b/sw/source/core/inc/unoflatpara.hxx
@@ -26,7 +26,7 @@
#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <com/sun/star/text/XFlatParagraph.hpp>
#include <com/sun/star/text/XFlatParagraphIterator.hpp>
-#include <calbck.hxx>
+#include <svl/listener.hxx>
#include <modeltoviewhelper.hxx>
#include "unotextmarkup.hxx"
@@ -117,7 +117,7 @@ class SwXFlatParagraphIterator:
<
css::text::XFlatParagraphIterator
>,
- public SwClient // to get notified when doc is closed...
+ public SvtListener
{
public:
SwXFlatParagraphIterator( SwDoc& rDoc, sal_Int32 nType, bool bAutomatic );
@@ -130,9 +130,7 @@ public:
virtual css::uno::Reference< css::text::XFlatParagraph > SAL_CALL getParaBefore(const css::uno::Reference< css::text::XFlatParagraph > & xPara) override;
virtual css::uno::Reference< css::text::XFlatParagraph > SAL_CALL getParaAfter(const css::uno::Reference< css::text::XFlatParagraph > & xPara) override;
-protected:
- // SwClient
- virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew ) override;
+ virtual void Notify( const SfxHint& ) override;
private:
SwXFlatParagraphIterator( const SwXFlatParagraphIterator & ) = delete;
diff --git a/sw/source/core/unocore/unoflatpara.cxx b/sw/source/core/unocore/unoflatpara.cxx
index e63caf187e9f..099cf4a999df 100644
--- a/sw/source/core/unocore/unoflatpara.cxx
+++ b/sw/source/core/unocore/unoflatpara.cxx
@@ -342,7 +342,7 @@ SwXFlatParagraphIterator::SwXFlatParagraphIterator( SwDoc& rDoc, sal_Int32 nType
//mnStartNode = mnCurrentNode = get node from current cursor TODO!
// register as listener and get notified when document is closed
- mpDoc->getIDocumentStylePoolAccess().GetPageDescFromPool( RES_POOLPAGE_STANDARD )->Add(this);
+ StartListening(mpDoc->getIDocumentStylePoolAccess().GetPageDescFromPool( RES_POOLPAGE_STANDARD )->GetNotifier());
}
SwXFlatParagraphIterator::~SwXFlatParagraphIterator()
@@ -351,11 +351,9 @@ SwXFlatParagraphIterator::~SwXFlatParagraphIterator()
EndListeningAll();
}
-void SwXFlatParagraphIterator::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew )
+void SwXFlatParagraphIterator::Notify( const SfxHint& rHint )
{
- ClientModify( this, pOld, pNew );
- // check if document gets closed...
- if(!GetRegisteredIn())
+ if(rHint.GetId() == SfxHintId::Dying)
{
SolarMutexGuard aGuard;
mpDoc = nullptr;
More information about the Libreoffice-commits
mailing list