diff options
author | Andrzej Hunt <andrzej.hunt@collabora.com> | 2014-06-20 10:35:45 +0100 |
---|---|---|
committer | Andrzej Hunt <andrzej.hunt@collabora.com> | 2014-07-30 14:18:57 +0200 |
commit | bf605bd71879e040cf0778b0505eb77e9fdf1da7 (patch) | |
tree | 7c3a3d4fb15b55441990cecb42d82089ec14250d | |
parent | ce245affabe2afdda777774f450dcda999d2c3e7 (diff) |
Use output device scaling to determine cells in draw-area.
Change-Id: Idf4e6ccb72090a55b6a9234cafae21821e3df0b0
-rw-r--r-- | sc/source/ui/view/gridwin4.cxx | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx index 2e3c2ed8ab65..962ac979d55f 100644 --- a/sc/source/ui/view/gridwin4.cxx +++ b/sc/source/ui/view/gridwin4.cxx @@ -342,9 +342,6 @@ void ScGridWindow::Paint( const Rectangle& rRect, OutputDevice* pOutDev ) SCTAB nTab = pViewData->GetTabNo(); - double nPPTX = pViewData->GetPPTX(); - double nPPTY = pViewData->GetPPTY(); - Rectangle aMirroredPixel = aPixRect; if ( pDoc->IsLayoutRTL( nTab ) ) { @@ -354,26 +351,30 @@ void ScGridWindow::Paint( const Rectangle& rRect, OutputDevice* pOutDev ) aMirroredPixel.Right() = nWidth - 1 - aPixRect.Left(); } - long nScrX = ScViewData::ToPixel( pDoc->GetColWidth( nX1, nTab ), nPPTX ); + long nScrX = pOutDev->LogicToPixel( Point( pDoc->GetColWidth( nX1, nTab ), 0 ) ).getX();/*ScViewData::ToPixel( pDoc->GetColWidth( nX1, nTab ), nPPTX );*/ while ( nScrX <= aMirroredPixel.Left() && nX1 < MAXCOL ) { ++nX1; - nScrX += ScViewData::ToPixel( pDoc->GetColWidth( nX1, nTab ), nPPTX ); + nScrX += pOutDev->LogicToPixel( Point( pDoc->GetColWidth( nX1, nTab ), 0 ) ).getX(); } SCCOL nX2 = nX1; while ( nScrX <= aMirroredPixel.Right() && nX2 < MAXCOL ) { ++nX2; - nScrX += ScViewData::ToPixel( pDoc->GetColWidth( nX2, nTab ), nPPTX ); + nScrX += pOutDev->LogicToPixel( Point( pDoc->GetColWidth( nX2, nTab ), 0 ) ).getX(); } long nScrY = 0; - ScViewData::AddPixelsWhile( nScrY, aPixRect.Top(), nY1, MAXROW, nPPTY, pDoc, nTab); + while ( nScrY < aPixRect.Top() && nY1 < MAXROW ) + { + ++nY1; + nScrY += pOutDev->LogicToPixel( Point( 0, pDoc->GetRowHeight( nY1, nTab ) ) ).getY(); + } SCROW nY2 = nY1; - if (nScrY <= aPixRect.Bottom() && nY2 < MAXROW) + while ( nScrY <= aPixRect.Bottom() && nY2 < MAXROW ) { ++nY2; - ScViewData::AddPixelsWhile( nScrY, aPixRect.Bottom(), nY2, MAXROW, nPPTY, pDoc, nTab); + nScrY += pOutDev->LogicToPixel( Point( 0, pDoc->GetRowHeight( nY2, nTab ) ) ).getY(); } Draw( nX1,nY1,nX2,nY2, SC_UPDATE_MARKS, pOutDev ); // nicht weiterzeichnen |