[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - 2 commits - sw/source

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


 sw/source/core/layout/tabfrm.cxx |    2 +-
 sw/source/core/undo/untbl.cxx    |   25 +++++++++++++------------
 2 files changed, 14 insertions(+), 13 deletions(-)

New commits:
commit b273a7b723d95f5feabf79b6e8a83beead1ce1bf
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
    (cherry picked from commit 21796a5fb92fd9773017b782a654a8b5a190cc66)
    Reviewed-on: https://gerrit.libreoffice.org/14468
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Eike Rathke <erack at redhat.com>

diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx
index e1d4833..7652462 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 )
commit a3c8e7deea306ba3efb513c8fa7311a995f7fc73
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Feb 13 09:50:15 2015 +0000

    Resolves: tdf#76636 crash on merging certain cells imported from a .doc
    
    Change-Id: I61d5088a6f2e0b444b2943a2f9ce9feeb2e09c11
    (cherry picked from commit e1f4022b9ea7ae99a31773c445d8229ba3bdea93)
    Reviewed-on: https://gerrit.libreoffice.org/14464
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Eike Rathke <erack at redhat.com>

diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index 110459d..556fe22 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -4965,7 +4965,7 @@ long SwCellFrm::GetLayoutRowSpan() const
     if ( nRet < 1 )
     {
         const SwFrm* pRow = GetUpper();
-        const SwTabFrm* pTab = static_cast<const SwTabFrm*>(pRow->GetUpper());
+        const SwTabFrm* pTab = pRow ? static_cast<const SwTabFrm*>(pRow->GetUpper()) : NULL;
 
         if ( pTab && pTab->IsFollow() && pRow == pTab->GetFirstNonHeadlineRow() )
             nRet = -nRet;


More information about the Libreoffice-commits mailing list