Blame SOURCES/0155-sw-implement-per-view-LOK_CALLBACK_CURSOR_VISIBLE.patch

135360
From ea203d6dcaad5ea5e1aea716041072f9030e6467 Mon Sep 17 00:00:00 2001
135360
From: Miklos Vajna <vmiklos@collabora.co.uk>
135360
Date: Fri, 18 Sep 2015 14:32:53 +0200
135360
Subject: [PATCH 155/398] sw: implement per-view LOK_CALLBACK_CURSOR_VISIBLE
135360
135360
Change-Id: I4e00679547997cfb3dafe603b908f055011a3b30
135360
(cherry picked from commit 32f419fee5f9df4facb7a9b3ec910471d2a20247)
135360
---
135360
 sw/source/core/crsr/crsrsh.cxx | 20 ++++++++++++++++----
135360
 1 file changed, 16 insertions(+), 4 deletions(-)
135360
135360
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
135360
index 3a0c6667b2e2..cbb89aca8868 100644
135360
--- a/sw/source/core/crsr/crsrsh.cxx
135360
+++ b/sw/source/core/crsr/crsrsh.cxx
135360
@@ -23,6 +23,7 @@
135360
 #include <hintids.hxx>
135360
 #include <svx/svdmodel.hxx>
135360
 #include <editeng/frmdiritem.hxx>
135360
+#include <sfx2/viewsh.hxx>
135360
 #include <SwSmartTagMgr.hxx>
135360
 #include <doc.hxx>
135360
 #include <rootfrm.hxx>
135360
@@ -63,6 +64,7 @@
135360
 #include <comcore.hrc>
135360
 #include <IDocumentLayoutAccess.hxx>
135360
 #include <LibreOfficeKit/LibreOfficeKitEnums.h>
135360
+#include <comphelper/lok.hxx>
135360
 
135360
 using namespace com::sun::star;
135360
 using namespace util;
135360
@@ -2118,8 +2120,13 @@ void SwCrsrShell::ShowCrsr()
135360
         m_bSVCrsrVis = true;
135360
         m_pCurCrsr->SetShowTextInputFieldOverlay( true );
135360
 
135360
-        if (isTiledRendering())
135360
-            libreOfficeKitCallback(LOK_CALLBACK_CURSOR_VISIBLE, OString::boolean(true).getStr());
135360
+        if (comphelper::LibreOfficeKit::isActive())
135360
+        {
135360
+            if (comphelper::LibreOfficeKit::isViewCallback())
135360
+                GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_CURSOR_VISIBLE, OString::boolean(true).getStr());
135360
+            else
135360
+                libreOfficeKitCallback(LOK_CALLBACK_CURSOR_VISIBLE, OString::boolean(true).getStr());
135360
+        }
135360
 
135360
         UpdateCrsr();
135360
     }
135360
@@ -2135,8 +2142,13 @@ void SwCrsrShell::HideCrsr()
135360
         m_pCurCrsr->SetShowTextInputFieldOverlay( false );
135360
         m_pVisCrsr->Hide();
135360
 
135360
-        if (isTiledRendering())
135360
-            libreOfficeKitCallback(LOK_CALLBACK_CURSOR_VISIBLE, OString::boolean(false).getStr());
135360
+        if (comphelper::LibreOfficeKit::isActive())
135360
+        {
135360
+            if (comphelper::LibreOfficeKit::isViewCallback())
135360
+                GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_CURSOR_VISIBLE, OString::boolean(false).getStr());
135360
+            else
135360
+                libreOfficeKitCallback(LOK_CALLBACK_CURSOR_VISIBLE, OString::boolean(false).getStr());
135360
+        }
135360
     }
135360
 }
135360
 
135360
-- 
135360
2.12.0
135360