Blob Blame History Raw
From ea203d6dcaad5ea5e1aea716041072f9030e6467 Mon Sep 17 00:00:00 2001
From: Miklos Vajna <vmiklos@collabora.co.uk>
Date: Fri, 18 Sep 2015 14:32:53 +0200
Subject: [PATCH 155/398] sw: implement per-view LOK_CALLBACK_CURSOR_VISIBLE

Change-Id: I4e00679547997cfb3dafe603b908f055011a3b30
(cherry picked from commit 32f419fee5f9df4facb7a9b3ec910471d2a20247)
---
 sw/source/core/crsr/crsrsh.cxx | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index 3a0c6667b2e2..cbb89aca8868 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -23,6 +23,7 @@
 #include <hintids.hxx>
 #include <svx/svdmodel.hxx>
 #include <editeng/frmdiritem.hxx>
+#include <sfx2/viewsh.hxx>
 #include <SwSmartTagMgr.hxx>
 #include <doc.hxx>
 #include <rootfrm.hxx>
@@ -63,6 +64,7 @@
 #include <comcore.hrc>
 #include <IDocumentLayoutAccess.hxx>
 #include <LibreOfficeKit/LibreOfficeKitEnums.h>
+#include <comphelper/lok.hxx>
 
 using namespace com::sun::star;
 using namespace util;
@@ -2118,8 +2120,13 @@ void SwCrsrShell::ShowCrsr()
         m_bSVCrsrVis = true;
         m_pCurCrsr->SetShowTextInputFieldOverlay( true );
 
-        if (isTiledRendering())
-            libreOfficeKitCallback(LOK_CALLBACK_CURSOR_VISIBLE, OString::boolean(true).getStr());
+        if (comphelper::LibreOfficeKit::isActive())
+        {
+            if (comphelper::LibreOfficeKit::isViewCallback())
+                GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_CURSOR_VISIBLE, OString::boolean(true).getStr());
+            else
+                libreOfficeKitCallback(LOK_CALLBACK_CURSOR_VISIBLE, OString::boolean(true).getStr());
+        }
 
         UpdateCrsr();
     }
@@ -2135,8 +2142,13 @@ void SwCrsrShell::HideCrsr()
         m_pCurCrsr->SetShowTextInputFieldOverlay( false );
         m_pVisCrsr->Hide();
 
-        if (isTiledRendering())
-            libreOfficeKitCallback(LOK_CALLBACK_CURSOR_VISIBLE, OString::boolean(false).getStr());
+        if (comphelper::LibreOfficeKit::isActive())
+        {
+            if (comphelper::LibreOfficeKit::isViewCallback())
+                GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_CURSOR_VISIBLE, OString::boolean(false).getStr());
+            else
+                libreOfficeKitCallback(LOK_CALLBACK_CURSOR_VISIBLE, OString::boolean(false).getStr());
+        }
     }
 }
 
-- 
2.12.0