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

Caolán McNamara caolanm at redhat.com
Fri Feb 13 02:34:41 PST 2015


 sw/source/core/undo/untbl.cxx |   25 +++++++++++++------------
 1 file changed, 13 insertions(+), 12 deletions(-)

New commits:
commit 21796a5fb92fd9773017b782a654a8b5a190cc66
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Feb 13 10:33:37 2015 +0000

    Resolves: tdf#79569 crash undoing tricky cell merge
    
    Change-Id: I68d774d0d3758cdb67864d7939a7e1167dd9a7df

diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx
index 9f1e754..9778de2 100644
--- a/sw/source/core/undo/untbl.cxx
+++ b/sw/source/core/undo/untbl.cxx
@@ -1351,21 +1351,22 @@ void _SaveBox::CreateNew( SwTable& rTbl, SwTableLine& rParent, _SaveTable& rSTbl
     {
         // search box for StartNode in old table
         SwTableBox* pBox = rTbl.GetTblBox( nSttNode );
-        OSL_ENSURE( pBox, "Where is my TableBox?" );
-
-        SwFrmFmt* pOld = pBox->GetFrmFmt();
-        pBox->RegisterToFormat( *pFmt );
-        if( !pOld->GetDepends() )
-            delete pOld;
+        if (pBox)
+        {
+            SwFrmFmt* pOld = pBox->GetFrmFmt();
+            pBox->RegisterToFormat( *pFmt );
+            if( !pOld->GetDepends() )
+                delete pOld;
 
-        pBox->setRowSpan( nRowSpan );
+            pBox->setRowSpan( nRowSpan );
 
-        SwTableBoxes* pTBoxes = &pBox->GetUpper()->GetTabBoxes();
-        pTBoxes->erase( std::find( pTBoxes->begin(), pTBoxes->end(), pBox ) );
+            SwTableBoxes* pTBoxes = &pBox->GetUpper()->GetTabBoxes();
+            pTBoxes->erase( std::find( pTBoxes->begin(), pTBoxes->end(), pBox ) );
 
-        pBox->SetUpper( &rParent );
-        pTBoxes = &rParent.GetTabBoxes();
-        pTBoxes->push_back( pBox );
+            pBox->SetUpper( &rParent );
+            pTBoxes = &rParent.GetTabBoxes();
+            pTBoxes->push_back( pBox );
+        }
     }
 
     if( pNext )


More information about the Libreoffice-commits mailing list