diff options
author | Ivo Hinkelmann <ihi@openoffice.org> | 2008-01-14 15:21:57 +0000 |
---|---|---|
committer | Ivo Hinkelmann <ihi@openoffice.org> | 2008-01-14 15:21:57 +0000 |
commit | fe348e390bccd7d6184581d0a13840363cfa9282 (patch) | |
tree | 15f332e4ddc96a2bfe6b42da46744f741717f72e /vcl/source | |
parent | b9c6661aaf71b8c39c5220d9f931d1f51ababde1 (diff) |
INTEGRATION: CWS aquavcl04 (1.34.16); FILE MERGED
2007/12/11 17:17:28 pl 1.34.16.1: #i84470# catch a division by zero
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/control/tabctrl.cxx | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx index f8937483bebe..1a0924da1ed1 100644 --- a/vcl/source/control/tabctrl.cxx +++ b/vcl/source/control/tabctrl.cxx @@ -4,9 +4,9 @@ * * $RCSfile: tabctrl.cxx,v $ * - * $Revision: 1.34 $ + * $Revision: 1.35 $ * - * last change: $Author: hr $ $Date: 2007-11-02 12:52:27 $ + * last change: $Author: ihi $ $Date: 2008-01-14 16:21:57 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -608,8 +608,17 @@ Rectangle TabControl::ImplGetTabRect( USHORT nItemPos, long nWidth, long nHeight break; nIDX = 0; - nDX = (nWidth-nOffsetX-nLineWidthAry[n]) / (nLinePosAry[n+1]-i); - nModDX = (nWidth-nOffsetX-nLineWidthAry[n]) % (nLinePosAry[n+1]-i); + if( nLinePosAry[n+1]-i > 0 ) + { + nDX = (nWidth-nOffsetX-nLineWidthAry[n]) / (nLinePosAry[n+1]-i); + nModDX = (nWidth-nOffsetX-nLineWidthAry[n]) % (nLinePosAry[n+1]-i); + } + else + { + // FIXME: this is a bad case of tabctrl way too small + nDX = 0; + nModDX = 0; + } n++; } |