diff options
author | Andrzej Hunt <andrzej.hunt@collabora.com> | 2014-07-03 14:47:15 +0200 |
---|---|---|
committer | Andrzej Hunt <andrzej.hunt@collabora.com> | 2014-07-08 09:41:30 +0200 |
commit | 8c84f4988ef16d0936d89ebd8abaae5b9c8d4761 (patch) | |
tree | 015a8775d3e9e393682e6632f78f60f4fd8d57a2 | |
parent | e6e0634ed6a2c61412f167d0a8507abf03b26cd4 (diff) |
Iterate from origin to tile area to ensure correct positioning.
Change-Id: I29e881f9e67b84e208a198d2aad06db382d14698
-rw-r--r-- | sc/source/ui/view/gridwin4.cxx | 20 |
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. |