summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2015-09-17 17:19:49 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-09-21 07:30:25 +0200
commit5c2811d682c6e623f3b2613df3119987c0c79c12 (patch)
treee878fe0cf7dfa29d6f98cbd80923318fa6630eab
parentsfx2: adapt comment to reality (diff)
downloadcore-5c2811d682c6e623f3b2613df3119987c0c79c12.tar.gz
core-5c2811d682c6e623f3b2613df3119987c0c79c12.zip
sw: implement per-view LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR
Change-Id: Ib4c1caede94d3eac372a3605c430bbbd353755f3
-rw-r--r--sw/inc/viewsh.hxx2
-rw-r--r--sw/source/core/crsr/viscrs.cxx8
2 files changed, 7 insertions, 3 deletions
diff --git a/sw/inc/viewsh.hxx b/sw/inc/viewsh.hxx
index d1bf9ca42771..500f552f7c8d 100644
--- a/sw/inc/viewsh.hxx
+++ b/sw/inc/viewsh.hxx
@@ -442,7 +442,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 a6a8957cf939..cd47accc7035 100644
--- a/sw/source/core/crsr/viscrs.cxx
+++ b/sw/source/core/crsr/viscrs.cxx
@@ -54,6 +54,7 @@
#include <memory>
#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() )