diff options
author | Niklas Nebel <nn@openoffice.org> | 2001-06-07 10:34:40 +0000 |
---|---|---|
committer | Niklas Nebel <nn@openoffice.org> | 2001-06-07 10:34:40 +0000 |
commit | aac23ffc554122358ce8bbefc3a084432ad3d250 (patch) | |
tree | 1a68c7047bf2443fe7cbd7b76a0139c306a01c7d | |
parent | 000076bae9e7e4cfb06a632cbeb785158b310c9d (diff) |
#87738# GetStretch: calculation in double, skip device MapMode if FmtDevice set
-rw-r--r-- | sc/source/ui/view/output2.cxx | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx index 4cf5052d5ea4..34f52b0988e8 100644 --- a/sc/source/ui/view/output2.cxx +++ b/sc/source/ui/view/output2.cxx @@ -2,9 +2,9 @@ * * $RCSfile: output2.cxx,v $ * - * $Revision: 1.11 $ + * $Revision: 1.12 $ * - * last change: $Author: nn $ $Date: 2001-05-18 19:44:26 $ + * last change: $Author: nn $ $Date: 2001-06-07 11:34:40 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -506,12 +506,19 @@ void ScDrawStringsVars::SetHashText() double ScOutputData::GetStretch() { - MapMode aOld = pRefDevice->GetMapMode(); - Fraction aFract = aOld.GetScaleY(); - aFract /= aOld.GetScaleX(); - aFract *= aZoomY; - aFract /= aZoomX; - return (double) aFract; + // calculation in double is faster than Fraction multiplication + // and doesn't overflow + + if ( pRefDevice == pFmtDevice ) + { + MapMode aOld = pRefDevice->GetMapMode(); + return ((double)aOld.GetScaleY()) / ((double)aOld.GetScaleX()) * ((double)aZoomY) / ((double)aZoomX); + } + else + { + // when formatting for printer, device map mode has already been taken care of + return ((double)aZoomY) / ((double)aZoomX); + } } //================================================================== |