summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPranav Kant <pranavk@collabora.co.uk>2017-12-22 18:40:05 +0530
committerMiklos Vajna <vmiklos@collabora.co.uk>2018-01-10 11:40:17 +0100
commit6a299d487d93fa862a640011c5ae8a2f406283b8 (patch)
treeee9b395cbb1d262cdea097f5270f46c3c9b18cc4
parentebfe25077040210771b6cfe6ec60e49a8e14de2a (diff)
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 <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
-rw-r--r--sfx2/source/view/lokcharthelper.cxx45
1 files changed, 24 insertions, 21 deletions
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,