diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-02-02 10:32:36 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-02-02 10:56:40 +0100 |
commit | bd8610ebafa9caf9f09a5aba9cca04c23691513d (patch) | |
tree | 86d0c99b905a89b2d2c06158f66ff4b5c1603554 /desktop | |
parent | 9d8b33079494cf7b5e66bd6c9d71f025efd9a653 (diff) |
LOK: add Document::setClientVisibleArea()
... and implement it in Writer.
Otherwise there is no way we can perform e.g. page down in an expected
way. Without this, the core visible area depends on the zoom in the
document, and the client visible area can be something entirely
different.
Change-Id: Iadfb5a225da09a2551ffa41ddf503bb3d22b3eae
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/source/lib/init.cxx | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index aaf52f1c9cb6..5010bd0347c3 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -350,6 +350,7 @@ static void doc_setClientZoom(LibreOfficeKitDocument* pThis, int nTilePixelHeight, int nTileTwipWidth, int nTileTwipHeight); +static void doc_setClientVisibleArea(LibreOfficeKitDocument* pThis, int nX, int nY, int nWidth, int nHeight); static int doc_createView(LibreOfficeKitDocument* pThis); static void doc_destroyView(LibreOfficeKitDocument* pThis, int nId); static void doc_setView(LibreOfficeKitDocument* pThis, int nId); @@ -396,6 +397,7 @@ LibLODocument_Impl::LibLODocument_Impl(const uno::Reference <css::lang::XCompone m_pDocumentClass->resetSelection = doc_resetSelection; m_pDocumentClass->getCommandValues = doc_getCommandValues; m_pDocumentClass->setClientZoom = doc_setClientZoom; + m_pDocumentClass->setClientVisibleArea = doc_setClientVisibleArea; m_pDocumentClass->createView = doc_createView; m_pDocumentClass->destroyView = doc_destroyView; @@ -1496,6 +1498,19 @@ static void doc_setClientZoom(LibreOfficeKitDocument* pThis, int nTilePixelWidth pDoc->setClientZoom(nTilePixelWidth, nTilePixelHeight, nTileTwipWidth, nTileTwipHeight); } +static void doc_setClientVisibleArea(LibreOfficeKitDocument* pThis, int nX, int nY, int nWidth, int nHeight) +{ + ITiledRenderable* pDoc = getTiledRenderable(pThis); + if (!pDoc) + { + gImpl->maLastExceptionMsg = "Document doesn't support tiled rendering"; + return; + } + + Rectangle aRectangle(Point(nX, nY), Size(nWidth, nHeight)); + pDoc->setClientVisibleArea(aRectangle); +} + static int doc_createView(LibreOfficeKitDocument* /*pThis*/) { SolarMutexGuard aGuard; |