summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrzej Hunt <andrzej.hunt@collabora.com>2014-07-03 14:47:15 +0200
committerAndrzej Hunt <andrzej.hunt@collabora.com>2014-07-08 09:41:30 +0200
commit8c84f4988ef16d0936d89ebd8abaae5b9c8d4761 (patch)
tree015a8775d3e9e393682e6632f78f60f4fd8d57a2
parente6e0634ed6a2c61412f167d0a8507abf03b26cd4 (diff)
Iterate from origin to tile area to ensure correct positioning.
Change-Id: I29e881f9e67b84e208a198d2aad06db382d14698
-rw-r--r--sc/source/ui/view/gridwin4.cxx20
1 files changed, 18 insertions, 2 deletions
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index 34e085b3eaa0..028c114cbc9e 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -341,8 +341,16 @@ void ScGridWindow::Paint( const Rectangle& rRect, OutputDevice* pOutDev )
bIsInPaint = true;
- SCCOL nX1 = pViewData->GetPosX(eHWhich);
- SCROW nY1 = pViewData->GetPosY(eVWhich);
+ // If we're doing tiled rendering we'll have a different output device here,
+ // and we could really be at a completely random position, hence we
+ // iterate from 0.
+ SCCOL nX1 = 0;
+ SCROW nY1 = 0;
+ if ( pOutDev == this )
+ {
+ nX1 = pViewData->GetPosX(eHWhich);
+ nY1 = pViewData->GetPosY(eVWhich);
+ }
SCTAB nTab = pViewData->GetTabNo();
@@ -381,6 +389,14 @@ void ScGridWindow::Paint( const Rectangle& rRect, OutputDevice* pOutDev )
nScrY += pDoc->GetRowHeight( nY2, nTab );
}
+ // Bit hacky -- but Draw starts drawing with nX1/nY1 being at
+ // the output devices origin, so we make sure we start drawing
+ // with cell A1 at the origin etc.
+ if ( pOutDev != this )
+ {
+ nX1 = 0;
+ nY1 = 0;
+ }
// We specifically need to set the visible range here -- by default it is
// set in UpdateVisibleRange which however uses the viewdata, which is
// completely irrelevant for tiled rendering.