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-11 16:34:51 +0200 |
commit | da64c58871fe3378eb2cee8619f3d96ded4f2d93 (patch) | |
tree | 3c2c11552bf161e8e043447bf61a9d9869136ad5 | |
parent | f77ef66c9c295a2cf2c50e4f180bfe69ec1d5759 (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 7068bb02c399..a145a07a07ca 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 |