diff options
author | Michael Stahl <Michael.Stahl@cib.de> | 2018-08-20 17:21:36 +0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-09-20 17:40:36 +0200 |
commit | b1686298cb81b8c1f56a217ebe9333f1e0007d5a (patch) | |
tree | e0b5ce223fb45ab3d6694ae0ff1e139935068261 | |
parent | 2b3cbeb76247e9819d60d661a4f3546ec731ea80 (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
(cherry picked from commit 503f07caa904ba375e390ad87640115866c3db05)
Reviewed-on: https://gerrit.libreoffice.org/60746
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | sw/inc/unocrsr.hxx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sw/inc/unocrsr.hxx b/sw/inc/unocrsr.hxx index fc03253a1109..15468a847743 100644 --- a/sw/inc/unocrsr.hxx +++ b/sw/inc/unocrsr.hxx @@ -146,6 +146,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; @@ -157,7 +161,7 @@ namespace sw { if(pNew) StartListening(pNew->m_aNotifier); - else if(m_pCursor) + if (m_pCursor) EndListening(m_pCursor->m_aNotifier); m_pCursor = pNew; } |