summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2011-07-08 22:49:56 +0100
committerCaolán McNamara <caolanm@redhat.com>2011-07-08 22:51:11 +0100
commit3ad93e1151fbe1fb5a39d92e9a3a99fa6942236c (patch)
treebfb77d42886a18d52be62800e557bd13fcdd6991 /sw
parent393981bab8f83998258f54d1f38af065d00c0c92 (diff)
Resolves: fdo#33012 crash on 0 width FrmFmt table cell layout
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/table/swtable.cxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx
index 2205ef3aa2ad..524ebcbdef4d 100644
--- a/sw/source/core/table/swtable.cxx
+++ b/sw/source/core/table/swtable.cxx
@@ -460,6 +460,7 @@ void lcl_SortedTabColInsert( SwTabCols &rToFill, const SwTableBox *pBox,
const bool bRefreshHidden )
{
const long nWish = pTabFmt->GetFrmSize().GetWidth();
+ OSL_ENSURE(nWish, "weird <= 0 width frmfrm");
const long nAct = rToFill.GetRight() - rToFill.GetLeft(); // +1 why?
//Der Wert fuer die linke Kante der Box errechnet sich aus den
@@ -471,13 +472,18 @@ void lcl_SortedTabColInsert( SwTabCols &rToFill, const SwTableBox *pBox,
const SwTableBox *pCur = pBox;
const SwTableLine *pLine = pBox->GetUpper();
while ( pLine )
- { const SwTableBoxes &rBoxes = pLine->GetTabBoxes();
+ {
+ const SwTableBoxes &rBoxes = pLine->GetTabBoxes();
for ( sal_uInt16 i = 0; i < rBoxes.Count(); ++i )
{
SwTwips nWidth = rBoxes[i]->GetFrmFmt()->GetFrmSize().GetWidth();
nSum = (sal_uInt16)(nSum + nWidth);
sal_uInt64 nTmp = nSum;
nTmp *= nAct;
+
+ if (nWish == 0) //fdo#33012 0 width frmfmt
+ continue;
+
nTmp /= nWish;
if (rBoxes[i] != pCur)
{