Blob Blame History Raw
From e24ce4fa62084b8fb8634da280450c054f797052 Mon Sep 17 00:00:00 2001
From: Miklos Vajna <vmiklos@collabora.co.uk>
Date: Fri, 13 Nov 2015 10:03:10 +0100
Subject: [PATCH 319/398] sw: don't show main cursor when editing a postit

This is primarily for tiled editing that doesn't know about multiple
cursors, so if both the postit cursor and the main cursor is shown for a
short period of time, then the main one is hidden, then gtktiledviewer
still shows the main one.

OTOH if we can avoid showing the cursor in general just to hide it a bit
later in general, let's not do that.

With this, the "cursor is shown at the comment anchor, not inside the
anchor when clicking on the postit" bug disappears.

(cherry picked from commit 1c482cb54b4dab4c5b549ecd2395104f042e4101)

Change-Id: I2383292c5f84604dc8b126510b0797b8426920ae
---
 sw/source/core/crsr/crsrsh.cxx | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index ffff6a6b2a93..626a2a75e47a 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -65,6 +65,8 @@
 #include <IDocumentLayoutAccess.hxx>
 #include <LibreOfficeKit/LibreOfficeKitEnums.h>
 #include <comphelper/lok.hxx>
+#include <comphelper/string.hxx>
+#include <PostItMgr.hxx>
 
 using namespace com::sun::star;
 using namespace util;
@@ -1286,6 +1288,15 @@ void SwCrsrShell::Paint(vcl::RenderContext& rRenderContext, const Rectangle &rRe
             pAktCrsr->Invalidate( aRect );
 
     }
+
+    if (SwPostItMgr* pPostItMgr = GetPostItMgr())
+    {
+        // No point in showing the cursor for Writer text when there is an
+        // active annotation edit.
+        if (bVis)
+            bVis = !pPostItMgr->HasActiveSidebarWin();
+    }
+
     if( m_bSVCrsrVis && bVis ) // also show SV cursor again
         m_pVisCrsr->Show();
 }
-- 
2.12.0