diff options
author | Mihai Varga <mihai.varga@collabora.com> | 2015-11-06 14:34:28 +0200 |
---|---|---|
committer | Mihai Varga <mihai.mv13@gmail.com> | 2015-11-13 09:55:19 +0200 |
commit | 96cd2abd748ed24e5aba50cc4c300cf06e512db3 (patch) | |
tree | a1e6636aef83f49a1d9ee81c87d0a9f71c88b5d2 /desktop | |
parent | 249f8b1cc9897ac9666dd5c69dc22fae7586c207 (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
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/source/lib/init.cxx | 20 | ||||
-rw-r--r-- | desktop/source/lib/lokandroid.cxx | 8 |
2 files changed, 27 insertions, 1 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index e33544abec90..94b81e049cd2 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -318,7 +318,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); @@ -358,6 +362,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; @@ -1470,6 +1475,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: */ |