diff options
author | Niklas Nebel <nn@openoffice.org> | 2011-02-07 14:05:48 +0100 |
---|---|---|
committer | Niklas Nebel <nn@openoffice.org> | 2011-02-07 14:05:48 +0100 |
commit | 521ff181344e8625fc613c2706fca9585b6aca38 (patch) | |
tree | de254d1e748341725620bf0814275a59e9c44aa0 /sc/source/ui | |
parent | 5ee30027064080597d1543c2982b8b25e8764698 (diff) |
dr78: #i116848# Use multiplication instead of a large row number for empty sheets in ScDrawUtil::CalcScale
Diffstat (limited to 'sc/source/ui')
-rw-r--r-- | sc/source/ui/view/drawutil.cxx | 9 | ||||
-rw-r--r-- | sc/source/ui/view/drawvie4.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/drawview.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/gridwin3.cxx | 2 |
4 files changed, 12 insertions, 3 deletions
diff --git a/sc/source/ui/view/drawutil.cxx b/sc/source/ui/view/drawutil.cxx index ba250767c169..dcc750229ef1 100644 --- a/sc/source/ui/view/drawutil.cxx +++ b/sc/source/ui/view/drawutil.cxx @@ -81,6 +81,15 @@ void ScDrawUtil::CalcScale( ScDocument* pDoc, SCTAB nTab, nPixelY += ScViewData::ToPixel(nHeight, nPPTY); } + // #i116848# To get a large-enough number for PixelToLogic, multiply the integer values + // instead of using a larger number of rows + long nMultiply = 2000000 / nTwipsY; + if ( nMultiply > 1 ) + { + nTwipsY *= nMultiply; + nPixelY *= nMultiply; + } + MapMode aHMMMode( MAP_100TH_MM, Point(), rZoomX, rZoomY ); Point aPixelLog = pDev->PixelToLogic( Point( nPixelX,nPixelY ), aHMMMode ); diff --git a/sc/source/ui/view/drawvie4.cxx b/sc/source/ui/view/drawvie4.cxx index d4c5d714b2ee..8b9debdabfae 100644 --- a/sc/source/ui/view/drawvie4.cxx +++ b/sc/source/ui/view/drawvie4.cxx @@ -283,7 +283,7 @@ void ScDrawView::CalcNormScale( Fraction& rFractX, Fraction& rFractY ) const if (nEndCol<20) nEndCol = 20; if (nEndRow<20) - nEndRow = 1000; + nEndRow = 20; Fraction aZoom(1,1); ScDrawUtil::CalcScale( pDoc, nTab, 0,0, nEndCol,nEndRow, pDev, aZoom,aZoom, diff --git a/sc/source/ui/view/drawview.cxx b/sc/source/ui/view/drawview.cxx index 3307398b5ef8..77b1d3622b3a 100644 --- a/sc/source/ui/view/drawview.cxx +++ b/sc/source/ui/view/drawview.cxx @@ -377,7 +377,7 @@ void ScDrawView::RecalcScale() if (nEndCol<20) nEndCol = 20; if (nEndRow<20) - nEndRow = 1000; + nEndRow = 20; // #i116848# instead of a large row number for an empty sheet, heights are multiplied in CalcScale ScDrawUtil::CalcScale( pDoc, nTab, 0,0, nEndCol,nEndRow, pDev,aZoomX,aZoomY,nPPTX,nPPTY, aScaleX,aScaleY ); diff --git a/sc/source/ui/view/gridwin3.cxx b/sc/source/ui/view/gridwin3.cxx index cdb7e8acfba7..5bfc0483b553 100644 --- a/sc/source/ui/view/gridwin3.cxx +++ b/sc/source/ui/view/gridwin3.cxx @@ -265,7 +265,7 @@ MapMode ScGridWindow::GetDrawMapMode( BOOL bForce ) SCROW nEndRow = 0; pDoc->GetTableArea( nTab, nEndCol, nEndRow ); if (nEndCol<20) nEndCol = 20; - if (nEndRow<20) nEndRow = 1000; + if (nEndRow<20) nEndRow = 20; ScDrawUtil::CalcScale( pDoc, nTab, 0,0, nEndCol,nEndRow, this, pViewData->GetZoomX(),pViewData->GetZoomY(), pViewData->GetPPTX(),pViewData->GetPPTY(), |