diff options
author | Kurt Zenker <kz@openoffice.org> | 2005-07-12 10:14:17 +0000 |
---|---|---|
committer | Kurt Zenker <kz@openoffice.org> | 2005-07-12 10:14:17 +0000 |
commit | 54a7cfa7f740c1dfabfe6b389dbee036dbaacf19 (patch) | |
tree | 994bb747ac8b54d0dfad7825939ace049e0d5e0b | |
parent | d4553258ffa2c854031cec318583d1013a382769 (diff) |
INTEGRATION: CWS os65 (1.20.342); FILE MERGED
2005/06/30 07:45:47 os 1.20.342.1: #i49017# prevent loop due to an overflow because of extreme map modes
-rw-r--r-- | svtools/source/control/ruler.cxx | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/svtools/source/control/ruler.cxx b/svtools/source/control/ruler.cxx index 91f7d145b217..49b018bce282 100644 --- a/svtools/source/control/ruler.cxx +++ b/svtools/source/control/ruler.cxx @@ -2,9 +2,9 @@ * * $RCSfile: ruler.cxx,v $ * - * $Revision: 1.20 $ + * $Revision: 1.21 $ * - * last change: $Author: rt $ $Date: 2004-09-20 15:12:35 $ + * last change: $Author: kz $ $Date: 2005-07-12 11:14:17 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -578,6 +578,7 @@ void Ruler::ImplDrawTicks( long nMin, long nMax, long nStart, long nCenter ) { long nTxtWidth2; long nTxtHeight2 = GetTextHeight()/2; + bool bBreak = true; while ( ((nStart-n) >= nMin) || ((nStart+n) <= nMax) ) { // Null-Punkt @@ -654,7 +655,9 @@ void Ruler::ImplDrawTicks( long nMin, long nMax, long nStart, long nCenter ) ImplVDrawLine( nT, nT1, nT, nT2 ); } } - + // #i49017# with some zoom factors the value nTick can overflow + if( ((ULONG)nTick + (ULONG)nTickCount) > (ULONG)LONG_MAX) + break; nTick += nTickCount; } } |