Kaydet (Commit) 861e3220 authored tarafından Bjoern Michaelsen's avatar Bjoern Michaelsen Kaydeden (comit) Björn Michaelsen

UNO redlines: uno SvtListener instead of SwClient

Change-Id: Ie07147c9d6af469ed1088148dd8b9bdb64ae8590
Reviewed-on: https://gerrit.libreoffice.org/68362
Tested-by: Jenkins
Reviewed-by: 's avatarBjörn Michaelsen <bjoern.michaelsen@libreoffice.org>
üst 570cc11e
......@@ -24,6 +24,7 @@
#include "docary.hxx"
#include "unocoll.hxx"
#include "unobaseclass.hxx"
#include <svl/listener.hxx>
#include <com/sun/star/container/XEnumerationAccess.hpp>
class SwRangeRedline;
......@@ -69,7 +70,7 @@ public:
class SwXRedlineEnumeration
: public SwSimpleEnumeration_Base
, public SwClient
, public SvtListener
{
SwDoc* pDoc;
SwRedlineTable::size_type nCurrentIndex;
......@@ -86,9 +87,8 @@ public:
virtual OUString SAL_CALL getImplementationName() override;
virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override;
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
protected:
//SwClient
virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew) override;
virtual void Notify( const SfxHint& ) override;
};
#endif
......
......@@ -33,7 +33,6 @@
#include <IDocumentStylePoolAccess.hxx>
#include <docary.hxx>
#include <redline.hxx>
#include <calbck.hxx>
using namespace ::com::sun::star;
......@@ -126,7 +125,7 @@ SwXRedlineEnumeration::SwXRedlineEnumeration(SwDoc& rDoc) :
pDoc(&rDoc),
nCurrentIndex(0)
{
pDoc->getIDocumentStylePoolAccess().GetPageDescFromPool(RES_POOLPAGE_STANDARD)->Add(this);
StartListening(pDoc->getIDocumentStylePoolAccess().GetPageDescFromPool(RES_POOLPAGE_STANDARD)->GetNotifier());
}
SwXRedlineEnumeration::~SwXRedlineEnumeration()
......@@ -168,10 +167,9 @@ uno::Sequence< OUString > SwXRedlineEnumeration::getSupportedServiceNames()
return uno::Sequence< OUString >();
}
void SwXRedlineEnumeration::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew)
void SwXRedlineEnumeration::Notify( const SfxHint& rHint )
{
ClientModify(this, pOld, pNew);
if(!GetRegisteredIn())
if(rHint.GetId() == SfxHintId::Dying)
pDoc = nullptr;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment