[Libreoffice-commits] core.git: svx/source

Stephan Bergmann sbergman at redhat.com
Wed Oct 29 02:51:23 PDT 2014


 svx/source/table/tablelayouter.cxx |   19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

New commits:
commit 87f5486dcb36177a0b5d374d3d684885efcd9c28
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Oct 29 10:47:41 2014 +0100

    Don't use output rArea when TableLayouter::getCellArea returns false
    
    ...when xCell->isMerged, as happens during CppunitTest_sd_filters_test.
    aCellArea will be "empty" (i.e., getMinX()==SAL_MAX_INT32 etc.) and the
    aCellRect.Move calculation will overflow for 32-bit long.
    
    Change-Id: I12649234c060edd9f2cab1792cf75335ae22b730

diff --git a/svx/source/table/tablelayouter.cxx b/svx/source/table/tablelayouter.cxx
index 0c53684..0793e77 100644
--- a/svx/source/table/tablelayouter.cxx
+++ b/svx/source/table/tablelayouter.cxx
@@ -860,15 +860,16 @@ void TableLayouter::updateCells( Rectangle& rRectangle )
             if( xCell.is() )
             {
                 basegfx::B2IRectangle aCellArea;
-                getCellArea( xCell, aPos, aCellArea );
-
-                Rectangle aCellRect;
-                aCellRect.Left() = aCellArea.getMinX();
-                aCellRect.Right() = aCellArea.getMaxX();
-                aCellRect.Top() = aCellArea.getMinY();
-                aCellRect.Bottom() = aCellArea.getMaxY();
-                aCellRect.Move( rRectangle.Left(), rRectangle.Top() );
-                xCell->setCellRect( aCellRect );
+                if( getCellArea( xCell, aPos, aCellArea ) )
+                {
+                    Rectangle aCellRect;
+                    aCellRect.Left() = aCellArea.getMinX();
+                    aCellRect.Right() = aCellArea.getMaxX();
+                    aCellRect.Top() = aCellArea.getMinY();
+                    aCellRect.Bottom() = aCellArea.getMaxY();
+                    aCellRect.Move( rRectangle.Left(), rRectangle.Top() );
+                    xCell->setCellRect( aCellRect );
+                }
             }
         }
     }


More information about the Libreoffice-commits mailing list