diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-09-14 14:36:56 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-09-21 07:30:12 +0200 |
commit | 655c7877a0650b7bfd04a3294cdf92bc7ab94055 (patch) | |
tree | a3176e0f229d206e57ae09e81444beb792be307f /desktop | |
parent | 58b5c13b00cd4d881e1d6313316cc621198a4b04 (diff) |
lok::Document: add createView()
Change-Id: Ic871ec41992b611b10958799b2dc12375a91efe4
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/source/lib/init.cxx | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 046182330b48..0973974fd0d3 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -52,6 +52,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> @@ -246,6 +247,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 ) @@ -277,6 +279,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(); @@ -1029,6 +1033,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); |