summaryrefslogtreecommitdiff
path: root/desktop/source
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2015-09-17 15:39:19 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-09-21 07:30:24 +0200
commitb8a54763f4f66538f13b6c0e13045e5cb3167ca4 (patch)
treefe44e072e9acb255edfdc7799d38ae0e40e3c472 /desktop/source
parentb0f04d1ba273cc94989a5079f957117433076a9b (diff)
lok::Document: register callback in the view, if requested
With this, a postKeyEvent() in one view properly results in one LOK_CALLBACK_INVALIDATE_TILES per view, at least in Writer. Change-Id: Ia0a9a00ea5a98c38f3d399208b9ef028f3036f79
Diffstat (limited to 'desktop/source')
-rw-r--r--desktop/source/lib/init.cxx20
1 files changed, 15 insertions, 5 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 0aadc3b5d130..d86a84eb1172 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -53,6 +53,8 @@
#include <sfx2/msgpool.hxx>
#include <sfx2/dispatch.hxx>
#include <sfx2/lokhelper.hxx>
+#include <sfx2/viewfrm.hxx>
+#include <sfx2/viewsh.hxx>
#include <svx/svxids.hrc>
#include <vcl/svapp.hxx>
#include <vcl/svpforlokit.hxx>
@@ -813,14 +815,22 @@ static void doc_registerCallback(LibreOfficeKitDocument* pThis,
LibreOfficeKitCallback pCallback,
void* pData)
{
- ITiledRenderable* pDoc = getTiledRenderable(pThis);
- if (!pDoc)
+ if (comphelper::LibreOfficeKit::isViewCallback())
{
- gImpl->maLastExceptionMsg = "Document doesn't support tiled rendering";
- return;
+ if (SfxViewShell* pViewShell = SfxViewFrame::Current()->GetViewShell())
+ pViewShell->registerLibreOfficeKitViewCallback(pCallback, pData);
}
+ else
+ {
+ ITiledRenderable* pDoc = getTiledRenderable(pThis);
+ if (!pDoc)
+ {
+ gImpl->maLastExceptionMsg = "Document doesn't support tiled rendering";
+ return;
+ }
- pDoc->registerCallback(pCallback, pData);
+ pDoc->registerCallback(pCallback, pData);
+ }
}
static void doc_postKeyEvent(LibreOfficeKitDocument* pThis, int nType, int nCharCode, int nKeyCode)