kbrown / rpms / libreoffice

Forked from rpms/libreoffice 2 years ago
Clone

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

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