summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2015-09-14 14:36:56 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-10-06 16:17:07 +0200
commit06d202aea377eaf012e426ec66c5052ccfb3eaec (patch)
treec72bffecd00bf3498a8511bbfb04cacdbe2cc921 /desktop
parent477bd979170e754322d7656c5bf195bdc4777bd9 (diff)
lok::Document: add createView()
(cherry picked from commit 655c7877a0650b7bfd04a3294cdf92bc7ab94055) Conflicts: libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx Change-Id: Ic871ec41992b611b10958799b2dc12375a91efe4
Diffstat (limited to 'desktop')
-rw-r--r--desktop/source/lib/init.cxx19
1 files changed, 19 insertions, 0 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 1439e284e938..7881ccc02bfc 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -53,6 +53,7 @@
#include <sfx2/viewfrm.hxx>
#include <sfx2/msgpool.hxx>
#include <sfx2/dispatch.hxx>
+#include <sfx2/lokhelper.hxx>
#include <svx/svxids.hrc>
#include <vcl/svapp.hxx>
#include <vcl/svpforlokit.hxx>
@@ -249,6 +250,7 @@ static void doc_setGraphicSelection (LibreOfficeKitDocument* pThis,
static void doc_resetSelection (LibreOfficeKitDocument* pThis);
static char* doc_getCommandValues(LibreOfficeKitDocument* pThis, const char* pCommand);
+static int doc_createView(LibreOfficeKitDocument* pThis);
LibLODocument_Impl::LibLODocument_Impl(const uno::Reference <css::lang::XComponent> &xComponent) :
mxComponent( xComponent )
@@ -280,6 +282,8 @@ LibLODocument_Impl::LibLODocument_Impl(const uno::Reference <css::lang::XCompone
m_pDocumentClass->resetSelection = doc_resetSelection;
m_pDocumentClass->getCommandValues = doc_getCommandValues;
+ m_pDocumentClass->createView = doc_createView;
+
gDocumentClass = m_pDocumentClass;
}
pClass = m_pDocumentClass.get();
@@ -1032,6 +1036,21 @@ static char* doc_getCommandValues(LibreOfficeKitDocument* pThis, const char* pCo
}
}
+static int doc_createView(LibreOfficeKitDocument* pThis)
+{
+ SolarMutexGuard aGuard;
+
+ ITiledRenderable* pDoc = getTiledRenderable(pThis);
+ if (!pDoc)
+ {
+ gImpl->maLastExceptionMsg = "Document doesn't support tiled rendering";
+ return -1;
+ }
+
+ SfxViewShell* pViewShell = pDoc->getCurrentViewShell();
+ return SfxLokHelper::createView(pViewShell);
+}
+
static char* lo_getError (LibreOfficeKit *pThis)
{
LibLibreOffice_Impl* pLib = static_cast<LibLibreOffice_Impl*>(pThis);