summaryrefslogtreecommitdiff
path: root/sw/inc/unocrsr.hxx
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@canonical.com>2016-11-28 09:12:16 +0100
committerBjörn Michaelsen <bjoern.michaelsen@canonical.com>2016-11-29 09:28:18 +0000
commit27ec6d1cb96a0d3becf14309a26d1c024a0f8603 (patch)
tree8a2acf029f49c1da7d8ba35e70035fa91863de0b /sw/inc/unocrsr.hxx
parenta029a479429d334875b73e2fc4e34b314a1ad369 (diff)
kill SwClient/Modify here, use sane(r) SfxBroadcaster/Listener
Change-Id: I862d7cf5785dc838044351b6ecac71aa7e0b2669 Reviewed-on: https://gerrit.libreoffice.org/31305 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
Diffstat (limited to 'sw/inc/unocrsr.hxx')
-rw-r--r--sw/inc/unocrsr.hxx29
1 files changed, 15 insertions, 14 deletions
diff --git a/sw/inc/unocrsr.hxx b/sw/inc/unocrsr.hxx
index eeb1b4a4ef2a..ac6b84883a07 100644
--- a/sw/inc/unocrsr.hxx
+++ b/sw/inc/unocrsr.hxx
@@ -20,7 +20,8 @@
#define INCLUDED_SW_INC_UNOCRSR_HXX
#include <swcrsr.hxx>
-#include <calbck.hxx>
+#include <svl/SfxBroadcaster.hxx>
+#include <svl/lstner.hxx>
namespace sw
{
@@ -39,7 +40,7 @@ namespace sw
};
}
-class SwUnoCursor : public virtual SwCursor, public SwModify
+class SwUnoCursor : public virtual SwCursor
{
private:
bool m_bRemainInSection : 1;
@@ -47,6 +48,7 @@ private:
bool m_bSkipOverProtectSections : 1;
public:
+ SfxBroadcaster m_aNotifier;
SwUnoCursor( const SwPosition &rPos );
virtual ~SwUnoCursor() override;
@@ -111,7 +113,7 @@ public:
namespace sw
{
- class UnoCursorPointer : public SwClient
+ class UnoCursorPointer : public SfxListener
{
public:
UnoCursorPointer()
@@ -120,30 +122,29 @@ namespace sw
UnoCursorPointer(std::shared_ptr<SwUnoCursor> pCursor, bool bSectionRestricted=false)
: m_pCursor(pCursor), m_bSectionRestricted(bSectionRestricted)
{
- m_pCursor->Add(this);
+ StartListening(m_pCursor->m_aNotifier);
}
UnoCursorPointer(const UnoCursorPointer& rOther)
- : SwClient(nullptr)
+ : SfxListener()
, m_pCursor(rOther.m_pCursor)
, m_bSectionRestricted(rOther.m_bSectionRestricted)
{
if(m_pCursor)
- m_pCursor->Add(this);
+ StartListening(m_pCursor->m_aNotifier);
}
virtual ~UnoCursorPointer() override
{
if(m_pCursor)
- m_pCursor->Remove(this);
+ EndListening(m_pCursor->m_aNotifier);
}
- virtual void SwClientNotify(const SwModify& rModify, const SfxHint& rHint) override
+ virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint) override
{
- SwClient::SwClientNotify(rModify, rHint);
if(m_pCursor)
{
if(typeid(rHint) == typeid(UnoCursorHint))
- m_pCursor->Remove(this);
+ EndListening(rBC);
}
- if(!GetRegisteredIn())
+ if(!GetBroadcasterCount())
m_pCursor.reset();
};
SwUnoCursor* get() const
@@ -155,7 +156,7 @@ namespace sw
UnoCursorPointer& operator=(UnoCursorPointer aOther)
{
if(aOther.m_pCursor)
- aOther.m_pCursor->Add(this);
+ StartListening(aOther.m_pCursor->m_aNotifier);
m_pCursor = aOther.m_pCursor;
return *this;
}
@@ -164,9 +165,9 @@ namespace sw
void reset(std::shared_ptr<SwUnoCursor> pNew)
{
if(pNew)
- pNew->Add(this);
+ StartListening(pNew->m_aNotifier);
else if(m_pCursor)
- m_pCursor->Remove(this);
+ EndListening(m_pCursor->m_aNotifier);
m_pCursor = pNew;
}
private: