summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorYong Lin Ma <mayongl@apache.org>2012-06-16 06:47:30 +0000
committerMichael Meeks <michael.meeks@suse.com>2012-12-17 21:20:11 +0000
commit6560cae1b5f81cb753a7216cb22d4e7f9d175cd1 (patch)
tree0731c0c81c0eef395ba89f4532e0c461d0c6be12 /sw
parent092a4385c2616943baccc8ec43ca29c1dcfba9fa (diff)
118878: Writer crash after column number and width of frame are modified
Patch by: Lin Yuan Review by: mayongl Reported by: Ji Yan
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/layout/colfrm.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/sw/source/core/layout/colfrm.cxx b/sw/source/core/layout/colfrm.cxx
index 654657a26f62..f8522c17107f 100644
--- a/sw/source/core/layout/colfrm.cxx
+++ b/sw/source/core/layout/colfrm.cxx
@@ -349,7 +349,7 @@ void SwLayoutFrm::AdjustColumns( const SwFmtCol *pAttr, sal_Bool bAdjustAttribut
const sal_Bool bOrtho = pAttr->IsOrtho() && pAttr->GetNumCols() > 0;
long nGutter = 0;
- for ( sal_uInt16 i = 0; i < pAttr->GetNumCols(); ++i )
+ for ( sal_uInt16 i = 0; i < pAttr->GetNumCols() && pCol; ++i ) //i118878, value returned by GetNumCols() can't be trusted
{
if( !bOrtho )
{
@@ -426,7 +426,7 @@ void SwLayoutFrm::AdjustColumns( const SwFmtCol *pAttr, sal_Bool bAdjustAttribut
{
long nInnerWidth = ( nAvail - nGutter ) / pAttr->GetNumCols();
pCol = Lower();
- for( sal_uInt16 i = 0; i < pAttr->GetNumCols(); pCol = pCol->GetNext(), ++i )
+ for( sal_uInt16 i = 0; i < pAttr->GetNumCols() && pCol; pCol = pCol->GetNext(), ++i ) //i118878, value returned by GetNumCols() can't be trusted
{
SwTwips nWidth;
if ( i == pAttr->GetNumCols() - 1 )