summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2017-05-03 15:51:34 +0200
committerJan Holesovsky <kendy@collabora.com>2017-05-04 00:22:20 +0200
commit8339e1172a9ca22b4e6448caceec9a4387a0c8dc (patch)
tree955f0a0f352571f04849c3efd9d1f6b1a5932352 /sc
parenta78cb2ba6be7bdf4e45cefeb42b90f1c11a012ab (diff)
sc lok: Extend MaxTiledCol/Row when painting beoyond the current doc area.
We were stripping the painted area only to what was the current document size. But the document size has to grow when the user moves outside of the view, and we have to be able to draw even tiles that are outside of the area. Let's play it safe, and actually extend the MaxTiledCol/Row when we paint beyond the document size. The unit test has to be adapted to assert only the tile content - which is what actually mattered for the original problem. Change-Id: I447c006cc184a27e55a345e51b4fe28e77cfc8ae Reviewed-on: https://gerrit.libreoffice.org/37205 Reviewed-by: Marco Cecchetti <mrcekets@gmail.com> Tested-by: Marco Cecchetti <mrcekets@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/37208 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/view/gridwin4.cxx33
1 files changed, 20 insertions, 13 deletions
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index e22bdc79f3d4..346f833050f2 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -1122,24 +1122,17 @@ void ScGridWindow::PaintTile( VirtualDevice& rDevice,
SCTAB nTab = pViewData->GetTabNo();
ScDocument* pDoc = pViewData->GetDocument();
- SCCOL nEndCol = 0;
- SCROW nEndRow = 0;
-
- // size of the document including drawings, charts, etc.
- pDoc->GetTiledRenderingArea(nTab, nEndCol, nEndRow);
-
const double fPPTX = pViewData->GetPPTX();
const double fPPTY = pViewData->GetPPTY();
- ScTableInfo aTabInfo(nEndRow + 3);
sal_Int32 nTopLeftTileRowOffset = 0;
sal_Int32 nTopLeftTileColOffset = 0;
sal_Int32 nTopLeftTileRowOrigin = 0;
sal_Int32 nTopLeftTileColOrigin = 0;
// find approximate col/row offsets of nearby.
- sal_Int32 nTopLeftTileRow =0;
- sal_Int32 nTopLeftTileCol =0;
+ sal_Int32 nTopLeftTileRow = 0;
+ sal_Int32 nTopLeftTileCol = 0;
sal_Int32 nBottomRightTileRow = 0;
sal_Int32 nBottomRightTileCol = 0;
sal_Int32 nDummy;
@@ -1157,12 +1150,25 @@ void ScGridWindow::PaintTile( VirtualDevice& rDevice,
nBottomRightTileCol++;
nBottomRightTileRow++;
- nTopLeftTileCol = std::min(nTopLeftTileCol, (sal_Int32)nEndCol);
- nTopLeftTileRow = std::min(nTopLeftTileRow, (sal_Int32)nEndRow);
+ // size of the document including drawings, charts, etc.
+ SCCOL nEndCol = 0;
+ SCROW nEndRow = 0;
+ pDoc->GetTiledRenderingArea(nTab, nEndCol, nEndRow);
+
+ if (nEndCol < nBottomRightTileCol)
+ {
+ nEndCol = nBottomRightTileCol;
+ pViewData->SetMaxTiledCol(nEndCol);
+ }
+
+ if (nEndRow < nBottomRightTileRow)
+ {
+ nEndRow = nBottomRightTileRow;
+ pViewData->SetMaxTiledRow(nEndRow);
+ }
+
nTopLeftTileCol = std::max<sal_Int32>(nTopLeftTileCol, 0);
nTopLeftTileRow = std::max<sal_Int32>(nTopLeftTileRow, 0);
- nBottomRightTileCol = std::min(nBottomRightTileCol, (sal_Int32)nEndCol);
- nBottomRightTileRow = std::min(nBottomRightTileRow, (sal_Int32)nEndRow);
nTopLeftTileColOrigin = nTopLeftTileColOrigin * TWIPS_PER_PIXEL;
nTopLeftTileRowOrigin = nTopLeftTileRowOrigin * TWIPS_PER_PIXEL;
@@ -1176,6 +1182,7 @@ void ScGridWindow::PaintTile( VirtualDevice& rDevice,
aAbsMode.SetOrigin(aOrigin);
rDevice.SetMapMode(aAbsMode);
+ ScTableInfo aTabInfo(nEndRow + 3);
pDoc->FillInfo(aTabInfo, nTopLeftTileCol, nTopLeftTileRow,
nBottomRightTileCol, nBottomRightTileRow,
nTab, fPPTX, fPPTY, false, false);