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 11:06:46 +0100 |
commit | 1ae319aa81b7d42441886dd232256b0336308cf3 (patch) | |
tree | 9bc50238914cdc79f4dadcf5d66a5fa0071ef499 /desktop | |
parent | 4dae4ed81b82ea3f5ae5f1097e5c75c3b1f0644e (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.
(cherry picked from commit bd8610ebafa9caf9f09a5aba9cca04c23691513d)
Conflicts:
libreofficekit/source/gtk/lokdocview.cxx
sw/inc/unotxdoc.hxx
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 53603095c09a..0fbece04b7f1 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -369,6 +369,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); @@ -415,6 +416,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; @@ -1543,6 +1545,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; |