diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-09-26 14:18:17 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-09-26 14:20:11 +0200 |
commit | b9cc6653606c829805c6c01b9613a3a25d81c20b (patch) | |
tree | 30dcf0be8e3efcd80084c060015d98bd678149f6 /sw | |
parent | 5bc4bcfde4955e3e48255310500102775ba4af23 (diff) |
sw lok: fix cursor position after inserting a comment
Make sure SwVisibleCursor::SetPosAndShow() doesn't emit LOK callbacks
till a comment window is active.
Need to invoke the unit test from desktop/, as the sw tests have the
status bar disabled.
Change-Id: Iab26024e9bb4da9c939bbd6cf769ec5c4dcb9a19
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/crsr/viscrs.cxx | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sw/source/core/crsr/viscrs.cxx b/sw/source/core/crsr/viscrs.cxx index 0e848b88a859..7a886e964c21 100644 --- a/sw/source/core/crsr/viscrs.cxx +++ b/sw/source/core/crsr/viscrs.cxx @@ -59,6 +59,7 @@ #include <sfx2/lokhelper.hxx> #include <comphelper/string.hxx> #include <paintfrm.hxx> +#include <PostItMgr.hxx> // Here static members are defined. They will get changed on alteration of the // MapMode. This is done so that on ShowCursor the same size does not have to be @@ -182,7 +183,14 @@ void SwVisibleCursor::SetPosAndShow(SfxViewShell* pViewShell) m_aTextCursor.SetPos( aRect.Pos() ); - if (comphelper::LibreOfficeKit::isActive()) + bool bPostItActive = false; + if (auto pView = dynamic_cast<SwView*>(m_pCursorShell->GetSfxViewShell())) + { + if (SwPostItMgr* pPostItMgr = pView->GetPostItMgr()) + bPostItActive = pPostItMgr->GetActiveSidebarWin() != nullptr; + } + + if (comphelper::LibreOfficeKit::isActive() && !bPostItActive) { // notify about page number change (if that happened) sal_uInt16 nPage, nVirtPage; |