summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2011-11-25 00:04:53 +0100
committerEike Rathke <erack@redhat.com>2011-11-25 01:01:17 +0100
commit8a838b9fbf46ece9680824cd3a044ab7338bf306 (patch)
tree35e5639e06cbb396b0498f259be82745af24a210 /sc
parent73d344c18ead9a905871541d5d0d37c56c598a03 (diff)
calc69: #i118068# handle all-hidden case in ScDrawUtil::CalcScale
# Original author: Niklas Nebel <nn@openoffice.org> * found as LGPLv3-only fix at svn rev 1172138 (http://svn.apache.org/viewvc?view=revision&revision=1172138) Plus the original comment from the replaced code why it is there, to fix #i116848#
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/view/drawutil.cxx12
1 files changed, 12 insertions, 0 deletions
diff --git a/sc/source/ui/view/drawutil.cxx b/sc/source/ui/view/drawutil.cxx
index 54b4ef95dd83..1cb5c74fbd82 100644
--- a/sc/source/ui/view/drawutil.cxx
+++ b/sc/source/ui/view/drawutil.cxx
@@ -82,6 +82,18 @@ 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
+ if ( nTwipsY )
+ {
+ 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 );