sfx2/source/view/lokcharthelper.cxx | 45 +++++++++++++++++++----------------- 1 file changed, 24 insertions(+), 21 deletions(-)
New commits: commit 6a299d487d93fa862a640011c5ae8a2f406283b8 Author: Pranav Kant <pran...@collabora.co.uk> Date: Fri Dec 22 18:40:05 2017 +0530 lokdocview: android: tiled annotations is the cause of the problem The earlier workaround only fixes it for android but keep other clients like gnome-documents broken. The real problem with these clients is that they ask lokit to render annotations in the tiles. This patch should keep the problem fixed for android and additionally make gnome-documents work, or any other lok clients who do not use comments API but render comments in tiles. Change-Id: I942f988698a9a43abedef7c998589be7f00a4ac0 Reviewed-on: https://gerrit.libreoffice.org/46976 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk> diff --git a/sfx2/source/view/lokcharthelper.cxx b/sfx2/source/view/lokcharthelper.cxx index 6181920916c0..dc82d2ffe4db 100644 --- a/sfx2/source/view/lokcharthelper.cxx +++ b/sfx2/source/view/lokcharthelper.cxx @@ -236,29 +236,32 @@ void LokChartHelper::PaintAllChartsOnTile(VirtualDevice& rDevice, int nTilePosX, int nTilePosY, long nTileWidth, long nTileHeight) { - // Resizes the virtual device so to contain the entries context - rDevice.SetOutputSizePixel(Size(nOutputWidth, nOutputHeight)); - - rDevice.Push(PushFlags::MAPMODE); - MapMode aMapMode(rDevice.GetMapMode()); - - // Scaling. Must convert from pixels to twips. We know - // that VirtualDevices use a DPI of 96. - Fraction scaleX = Fraction(nOutputWidth, 96) * Fraction(1440) / Fraction(nTileWidth); - Fraction scaleY = Fraction(nOutputHeight, 96) * Fraction(1440) / Fraction(nTileHeight); - aMapMode.SetScaleX(scaleX); - aMapMode.SetScaleY(scaleY); - rDevice.SetMapMode(aMapMode); - - tools::Rectangle aTileRect(Point(nTilePosX, nTilePosY), Size(nTileWidth, nTileHeight)); - SfxViewShell* pViewShell = SfxViewShell::GetFirst(); - while (pViewShell) + if (!comphelper::LibreOfficeKit::isTiledAnnotations()) { - LokChartHelper aChartHelper(pViewShell); - aChartHelper.PaintTile(rDevice, aTileRect); - pViewShell = SfxViewShell::GetNext(*pViewShell); + // Resizes the virtual device so to contain the entries context + rDevice.SetOutputSizePixel(Size(nOutputWidth, nOutputHeight)); + + rDevice.Push(PushFlags::MAPMODE); + MapMode aMapMode(rDevice.GetMapMode()); + + // Scaling. Must convert from pixels to twips. We know + // that VirtualDevices use a DPI of 96. + Fraction scaleX = Fraction(nOutputWidth, 96) * Fraction(1440) / Fraction(nTileWidth); + Fraction scaleY = Fraction(nOutputHeight, 96) * Fraction(1440) / Fraction(nTileHeight); + aMapMode.SetScaleX(scaleX); + aMapMode.SetScaleY(scaleY); + rDevice.SetMapMode(aMapMode); + + tools::Rectangle aTileRect(Point(nTilePosX, nTilePosY), Size(nTileWidth, nTileHeight)); + SfxViewShell* pViewShell = SfxViewShell::GetFirst(); + while (pViewShell) + { + LokChartHelper aChartHelper(pViewShell); + aChartHelper.PaintTile(rDevice, aTileRect); + pViewShell = SfxViewShell::GetNext(*pViewShell); + } + rDevice.Pop(); } - rDevice.Pop(); } bool LokChartHelper::postMouseEvent(int nType, int nX, int nY, _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits