summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-02-13 10:33:37 +0000
committerAndras Timar <andras.timar@collabora.com>2015-02-23 10:34:36 +0100
commit7b218f24b18f739e78f30b2f224ec52c6f4bd116 (patch)
tree1a9b0283c93fe70da0fe19029a303a1119a8d8ff
parentd8bd515d58b21552813bb16bdcec0b34193ae968 (diff)
Resolves: tdf#79569 crash undoing tricky cell merge
Change-Id: I68d774d0d3758cdb67864d7939a7e1167dd9a7df (cherry picked from commit 21796a5fb92fd9773017b782a654a8b5a190cc66) Reviewed-on: https://gerrit.libreoffice.org/14468 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com> (cherry picked from commit b273a7b723d95f5feabf79b6e8a83beead1ce1bf)
-rw-r--r--sw/source/core/undo/untbl.cxx25
1 files changed, 13 insertions, 12 deletions
diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx
index e1d4833bd85e..7652462f0c74 100644
--- a/sw/source/core/undo/untbl.cxx
+++ b/sw/source/core/undo/untbl.cxx
@@ -1344,21 +1344,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 )