summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorAndrzej Hunt <andrzej.hunt@collabora.com>2014-07-29 08:59:13 +0200
committerAndrzej Hunt <andrzej.hunt@collabora.com>2014-07-30 12:44:01 +0200
commit6872ecdbc70befc1f3e9215f5c1cf1530ff8dc40 (patch)
treeacf7e7387e7d4ffefa17ea9acfeadcf2d9f6cba4 /desktop
parent6548361109deeb3be2e2c65b27eca04e59fa1f6f (diff)
LOK: add setPartMode.
This API seems to be simplest in the long run where we'll want to be able to select between rendering slides/notes/both/embedded objects, and maybe even adding the option of switching between continuous and single page mode in writer (although I have no idea how hard getting a single page mode out of writer would be). Change-Id: I5bdfdb61854c37281c6992c8f3ed1c50c8aa0919
Diffstat (limited to 'desktop')
-rw-r--r--desktop/source/lib/init.cxx17
1 files changed, 17 insertions, 0 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 6772694a64b8..4de42e3c6da2 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -185,6 +185,7 @@ static int doc_getParts(LibreOfficeKitDocument* pThis);
static int doc_getPart(LibreOfficeKitDocument* pThis);
static void doc_setPart(LibreOfficeKitDocument* pThis, int nPart);
static char* doc_getPartName(LibreOfficeKitDocument* pThis, int nPart);
+static void doc_setPartMode(LibreOfficeKitDocument* pThis, LibreOfficeKitPartMode ePartMode);
void doc_paintTile(LibreOfficeKitDocument* pThis,
unsigned char* pBuffer,
const int nCanvasWidth, const int nCanvasHeight,
@@ -216,6 +217,7 @@ struct LibLODocument_Impl : public _LibreOfficeKitDocument
m_pDocumentClass->getPart = doc_getPart;
m_pDocumentClass->setPart = doc_setPart;
m_pDocumentClass->getPartName = doc_getPartName;
+ m_pDocumentClass->setPartMode = doc_setPartMode;
m_pDocumentClass->paintTile = doc_paintTile;
m_pDocumentClass->getDocumentSize = doc_getDocumentSize;
@@ -490,6 +492,21 @@ static char* doc_getPartName(LibreOfficeKitDocument* pThis, int nPart)
}
+static void doc_setPartMode(LibreOfficeKitDocument* pThis,
+ LibreOfficeKitPartMode ePartMode)
+{
+ LibLODocument_Impl* pDocument = static_cast<LibLODocument_Impl*>(pThis);
+
+ ::vcl::ITiledRenderable* pDoc = dynamic_cast< ::vcl::ITiledRenderable* >( pDocument->mxComponent.get() );
+ if (!pDoc)
+ {
+ gImpl->maLastExceptionMsg = "Document doesn't support tiled rendering";
+ return;
+ }
+
+ pDoc->setPartMode(ePartMode);
+}
+
void doc_paintTile (LibreOfficeKitDocument* pThis,
unsigned char* pBuffer,
const int nCanvasWidth, const int nCanvasHeight,