[Libreoffice-commits] .: sw/source

Caolán McNamara caolan at kemper.freedesktop.org
Fri Jul 8 14:51:20 PDT 2011


 sw/source/core/table/swtable.cxx |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

New commits:
commit 4a698ffcf5756b7a6e8a2d583b530951fdeba4db
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Jul 8 22:49:56 2011 +0100

    Resolves: fdo#33012 crash on 0 width FrmFmt table cell layout

diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx
index e8f33b4..812c272 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)
             {


More information about the Libreoffice-commits mailing list