Kaydet (Commit) 50667d76 authored tarafından Miklos Vajna's avatar Miklos Vajna

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
(cherry picked from commit b8a54763)
üst efc31865
...@@ -54,6 +54,8 @@ ...@@ -54,6 +54,8 @@
#include <sfx2/msgpool.hxx> #include <sfx2/msgpool.hxx>
#include <sfx2/dispatch.hxx> #include <sfx2/dispatch.hxx>
#include <sfx2/lokhelper.hxx> #include <sfx2/lokhelper.hxx>
#include <sfx2/viewfrm.hxx>
#include <sfx2/viewsh.hxx>
#include <svx/svxids.hrc> #include <svx/svxids.hrc>
#include <vcl/svapp.hxx> #include <vcl/svapp.hxx>
#include <vcl/svpforlokit.hxx> #include <vcl/svpforlokit.hxx>
...@@ -816,14 +818,22 @@ static void doc_registerCallback(LibreOfficeKitDocument* pThis, ...@@ -816,14 +818,22 @@ static void doc_registerCallback(LibreOfficeKitDocument* pThis,
LibreOfficeKitCallback pCallback, LibreOfficeKitCallback pCallback,
void* pData) void* pData)
{ {
ITiledRenderable* pDoc = getTiledRenderable(pThis); if (comphelper::LibreOfficeKit::isViewCallback())
if (!pDoc)
{ {
gImpl->maLastExceptionMsg = "Document doesn't support tiled rendering"; if (SfxViewShell* pViewShell = SfxViewFrame::Current()->GetViewShell())
return; 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) static void doc_postKeyEvent(LibreOfficeKitDocument* pThis, int nType, int nCharCode, int nKeyCode)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment