Blob Blame History Raw
From eaa1e3dcd0d84b8c60f5175b8e3ab5582e4658e7 Mon Sep 17 00:00:00 2001
From: Miklos Vajna <vmiklos@collabora.co.uk>
Date: Thu, 17 Sep 2015 17:19:49 +0200
Subject: [PATCH 151/398] sw: implement per-view
 LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR

Change-Id: Ib4c1caede94d3eac372a3605c430bbbd353755f3
(cherry picked from commit 5c2811d682c6e623f3b2613df3119987c0c79c12)
---
 sw/inc/viewsh.hxx              | 2 +-
 sw/source/core/crsr/viscrs.cxx | 8 ++++++--
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/sw/inc/viewsh.hxx b/sw/inc/viewsh.hxx
index 1ba064f0c16c..fcccb91654fb 100644
--- a/sw/inc/viewsh.hxx
+++ b/sw/inc/viewsh.hxx
@@ -449,7 +449,7 @@ public:
                           { return mpCareWindow ? mpCareWindow.get() : CareChildWin(rVSh); }
     static vcl::Window*   CareChildWin(SwViewShell& rVSh);
 
-    inline SfxViewShell   *GetSfxViewShell() { return mpSfxViewShell; }
+    inline SfxViewShell   *GetSfxViewShell() const { return mpSfxViewShell; }
     inline void           SetSfxViewShell(SfxViewShell *pNew) { mpSfxViewShell = pNew; }
 
     // Selection of  Draw Engine has been changed.
diff --git a/sw/source/core/crsr/viscrs.cxx b/sw/source/core/crsr/viscrs.cxx
index e0d32cc86e11..13cfcd89b22b 100644
--- a/sw/source/core/crsr/viscrs.cxx
+++ b/sw/source/core/crsr/viscrs.cxx
@@ -54,6 +54,7 @@
 #include <boost/scoped_ptr.hpp>
 
 #include <LibreOfficeKit/LibreOfficeKitEnums.h>
+#include <comphelper/lok.hxx>
 #include <paintfrm.hxx>
 
 // Here static members are defined. They will get changed on alteration of the
@@ -178,7 +179,7 @@ void SwVisCrsr::_SetPosAndShow()
 
     m_aTextCrsr.SetPos( aRect.Pos() );
 
-    if (m_pCrsrShell->isTiledRendering())
+    if (comphelper::LibreOfficeKit::isActive())
     {
         // notify about page number change (if that happened)
         sal_uInt16 nPage, nVirtPage;
@@ -193,7 +194,10 @@ void SwVisCrsr::_SetPosAndShow()
         // notify about the cursor position & size
         Rectangle aSVRect(aRect.Pos().getX(), aRect.Pos().getY(), aRect.Pos().getX() + aRect.SSize().Width(), aRect.Pos().getY() + aRect.SSize().Height());
         OString sRect = aSVRect.toString();
-        m_pCrsrShell->libreOfficeKitCallback(LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR, sRect.getStr());
+        if (comphelper::LibreOfficeKit::isViewCallback())
+            m_pCrsrShell->GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR, sRect.getStr());
+        else
+            m_pCrsrShell->libreOfficeKitCallback(LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR, sRect.getStr());
     }
 
     if ( !m_pCrsrShell->IsCrsrReadonly()  || m_pCrsrShell->GetViewOptions()->IsSelectionInReadonly() )
-- 
2.12.0