summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorMihai Varga <mihai.varga@collabora.com>2015-11-06 14:34:28 +0200
committerMihai Varga <mihai.mv13@gmail.com>2015-11-16 15:00:41 +0200
commitc4d5cbfa85dba8a695ccdc98a57685bd48bbbee8 (patch)
treec9551a42a1b00fc36fab31513c318899560f848a /desktop
parentde0dd50f59de80ee08aa4f4793dd2b61e6e8156e (diff)
LOK: setClientZoom() - sets the client zoom level
We need to know the client's view level to correctly handle the mouse events in calc. PaintTile() set a zoom level that corresponds to the requested tiles and previously postMouseEvent would call SetZoom(1,1). Now we can make use of knowing the client's view level and call SetZoom() with the correct parameters Change-Id: I34b5afcdcc06a671a8ac92c03e87404e42adf4cd Conflicts: sc/source/ui/unoobj/docuno.cxx Conflicts: libreofficekit/source/gtk/lokdocview.cxx libreofficekit/source/gtk/tilebuffer.hxx
Diffstat (limited to 'desktop')
-rw-r--r--desktop/source/lib/init.cxx20
-rw-r--r--desktop/source/lib/lokandroid.cxx8
2 files changed, 27 insertions, 1 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 13312e0e7e86..f62fcde62c92 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -327,7 +327,11 @@ static void doc_setGraphicSelection (LibreOfficeKitDocument* pThis,
int nY);
static void doc_resetSelection (LibreOfficeKitDocument* pThis);
static char* doc_getCommandValues(LibreOfficeKitDocument* pThis, const char* pCommand);
-
+static void doc_setClientZoom(LibreOfficeKitDocument* pThis,
+ int nTilePixelWidth,
+ int nTilePixelHeight,
+ int nTileTwipWidth,
+ int nTileTwipHeight);
static int doc_createView(LibreOfficeKitDocument* pThis);
static void doc_destroyView(LibreOfficeKitDocument* pThis, int nId);
static void doc_setView(LibreOfficeKitDocument* pThis, int nId);
@@ -367,6 +371,7 @@ LibLODocument_Impl::LibLODocument_Impl(const uno::Reference <css::lang::XCompone
m_pDocumentClass->setGraphicSelection = doc_setGraphicSelection;
m_pDocumentClass->resetSelection = doc_resetSelection;
m_pDocumentClass->getCommandValues = doc_getCommandValues;
+ m_pDocumentClass->setClientZoom = doc_setClientZoom;
m_pDocumentClass->createView = doc_createView;
m_pDocumentClass->destroyView = doc_destroyView;
@@ -1479,6 +1484,19 @@ static char* doc_getCommandValues(LibreOfficeKitDocument* pThis, const char* pCo
}
}
+static void doc_setClientZoom(LibreOfficeKitDocument* pThis, int nTilePixelWidth, int nTilePixelHeight,
+ int nTileTwipWidth, int nTileTwipHeight)
+{
+ ITiledRenderable* pDoc = getTiledRenderable(pThis);
+ if (!pDoc)
+ {
+ gImpl->maLastExceptionMsg = "Document doesn't support tiled rendering";
+ return;
+ }
+
+ pDoc->setClientZoom(nTilePixelWidth, nTilePixelHeight, nTileTwipWidth, nTileTwipHeight);
+}
+
static int doc_createView(LibreOfficeKitDocument* /*pThis*/)
{
SolarMutexGuard aGuard;
diff --git a/desktop/source/lib/lokandroid.cxx b/desktop/source/lib/lokandroid.cxx
index 017ab8a9cdaf..0c360d3c2b9c 100644
--- a/desktop/source/lib/lokandroid.cxx
+++ b/desktop/source/lib/lokandroid.cxx
@@ -358,4 +358,12 @@ extern "C" SAL_JNI_EXPORT jstring JNICALL Java_org_libreoffice_kit_Document_getC
return pEnv->NewStringUTF(pValue);
}
+
+extern "C" SAL_JNI_EXPORT void JNICALL Java_org_libreoffice_kit_Document_setClientZoom
+ (JNIEnv* pEnv, jobject aObject, jint nTilePixelWidth, jint nTilePixelHeight, jint nTileTwipWidth, jint nTileTwipHeight)
+{
+ LibreOfficeKitDocument* pDocument = getHandle<LibreOfficeKitDocument>(pEnv, aObject);
+ pDocument->pClass->setClientZoom(pDocument, nTilePixelWidth, nTilePixelHeight, nTileTwipWidth, nTileTwipHeight);
+
+}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */