summaryrefslogtreecommitdiff
path: root/sw/inc/unocrsr.hxx
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2018-08-20 17:21:36 +0200
committerMichael Stahl <Michael.Stahl@cib.de>2018-09-19 10:18:20 +0200
commit503f07caa904ba375e390ad87640115866c3db05 (patch)
treeedc0363d83870061b2ae6c744a34b249ec7e4c65 /sw/inc/unocrsr.hxx
parent251b88be7fdca54c38cc7632a85184577f719180 (diff)
sw: fix listener registration of sw::UnoCursorPointer
Listening at one SwUnoCursor at a time is enough; this triggers asserts added in 1925a57dee73933ffbdb3b57349b757470a8218a from SwNavigationMgr. Change-Id: I791355533214daeb1779cd7d1a6aac7faa1a1472
Diffstat (limited to 'sw/inc/unocrsr.hxx')
-rw-r--r--sw/inc/unocrsr.hxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/sw/inc/unocrsr.hxx b/sw/inc/unocrsr.hxx
index 04d711b555d5..038aff7110c0 100644
--- a/sw/inc/unocrsr.hxx
+++ b/sw/inc/unocrsr.hxx
@@ -143,6 +143,10 @@ namespace sw
{ return *get(); }
UnoCursorPointer& operator=(UnoCursorPointer aOther)
{
+ if (m_pCursor)
+ {
+ EndListening(m_pCursor->m_aNotifier);
+ }
if(aOther.m_pCursor)
StartListening(aOther.m_pCursor->m_aNotifier);
m_pCursor = aOther.m_pCursor;
@@ -154,7 +158,7 @@ namespace sw
{
if(pNew)
StartListening(pNew->m_aNotifier);
- else if(m_pCursor)
+ if (m_pCursor)
EndListening(m_pCursor->m_aNotifier);
m_pCursor = pNew;
}