summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorobo <obo@openoffice.org>2010-09-14 07:53:51 +0200
committerobo <obo@openoffice.org>2010-09-14 07:53:51 +0200
commitdee0e9f293458f04283c4371e5bf3d93999e4e64 (patch)
tree23f618023f9653955ba2a9fa682014faf7267629 /sc
parent8c8d2a8a8f0721ebf8767ab2f0a058730d16996f (diff)
parent928468d1b7fe5da9964a5ec4fba22c8565f043e7 (diff)
CWS-TOOLING: integrate CWS impress200
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/data/table2.cxx11
1 files changed, 7 insertions, 4 deletions
diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index d54e16b8cbd7..4223c05c4f83 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -3100,10 +3100,13 @@ void ScTable::SetDrawPageSize(bool bResetStreamValid, bool bUpdateNoteCaptionPos
ScDrawLayer* pDrawLayer = pDocument->GetDrawLayer();
if( pDrawLayer )
{
- long x = GetColOffset( MAXCOL + 1 );
- long y = GetRowOffset( MAXROW + 1 );
- x = (long) ((double) x * HMM_PER_TWIPS);
- y = (long) ((double) y * HMM_PER_TWIPS);
+ double fValX = GetColOffset( MAXCOL + 1 ) * HMM_PER_TWIPS;
+ double fValY = GetRowOffset( MAXROW + 1 ) * HMM_PER_TWIPS;
+ const long nMax = ::std::numeric_limits<long>::max();
+ // #i113884# Avoid int32 overflow with possible negative results than can cause bad effects.
+ // If the draw page size is smaller than all rows, only the bottom of the sheet is affected.
+ long x = ( fValX > (double)nMax ) ? nMax : (long) fValX;
+ long y = ( fValY > (double)nMax ) ? nMax : (long) fValY;
if ( IsLayoutRTL() ) // IsNegativePage
x = -x;