Blame SOURCES/0319-sw-don-t-show-main-cursor-when-editing-a-postit.patch

135360
From e24ce4fa62084b8fb8634da280450c054f797052 Mon Sep 17 00:00:00 2001
135360
From: Miklos Vajna <vmiklos@collabora.co.uk>
135360
Date: Fri, 13 Nov 2015 10:03:10 +0100
135360
Subject: [PATCH 319/398] sw: don't show main cursor when editing a postit
135360
135360
This is primarily for tiled editing that doesn't know about multiple
135360
cursors, so if both the postit cursor and the main cursor is shown for a
135360
short period of time, then the main one is hidden, then gtktiledviewer
135360
still shows the main one.
135360
135360
OTOH if we can avoid showing the cursor in general just to hide it a bit
135360
later in general, let's not do that.
135360
135360
With this, the "cursor is shown at the comment anchor, not inside the
135360
anchor when clicking on the postit" bug disappears.
135360
135360
(cherry picked from commit 1c482cb54b4dab4c5b549ecd2395104f042e4101)
135360
135360
Change-Id: I2383292c5f84604dc8b126510b0797b8426920ae
135360
---
135360
 sw/source/core/crsr/crsrsh.cxx | 11 +++++++++++
135360
 1 file changed, 11 insertions(+)
135360
135360
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
135360
index ffff6a6b2a93..626a2a75e47a 100644
135360
--- a/sw/source/core/crsr/crsrsh.cxx
135360
+++ b/sw/source/core/crsr/crsrsh.cxx
135360
@@ -65,6 +65,8 @@
135360
 #include <IDocumentLayoutAccess.hxx>
135360
 #include <LibreOfficeKit/LibreOfficeKitEnums.h>
135360
 #include <comphelper/lok.hxx>
135360
+#include <comphelper/string.hxx>
135360
+#include <PostItMgr.hxx>
135360
 
135360
 using namespace com::sun::star;
135360
 using namespace util;
135360
@@ -1286,6 +1288,15 @@ void SwCrsrShell::Paint(vcl::RenderContext& rRenderContext, const Rectangle &rRe
135360
             pAktCrsr->Invalidate( aRect );
135360
 
135360
     }
135360
+
135360
+    if (SwPostItMgr* pPostItMgr = GetPostItMgr())
135360
+    {
135360
+        // No point in showing the cursor for Writer text when there is an
135360
+        // active annotation edit.
135360
+        if (bVis)
135360
+            bVis = !pPostItMgr->HasActiveSidebarWin();
135360
+    }
135360
+
135360
     if( m_bSVCrsrVis && bVis ) // also show SV cursor again
135360
         m_pVisCrsr->Show();
135360
 }
135360
-- 
135360
2.12.0
135360