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

Caolán McNamara caolanm at redhat.com
Sun Jul 24 07:52:04 UTC 2016


 sw/source/core/inc/tabfrm.hxx    |    2 --
 sw/source/core/layout/tabfrm.cxx |   25 +++----------------------
 2 files changed, 3 insertions(+), 24 deletions(-)

New commits:
commit e22122e20ca69d0f2b0e8831e9ebf3afd2064329
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Jul 23 21:48:25 2016 +0100

    Resolves: tdf#101058 crash on deleting certain table row
    
    regression from...
    
    commit 15d8b51bf82610c663f80fe552a1c0315e137ad3
    Author: Caolán McNamara <caolanm at redhat.com>
    Date:   Tue Feb 5 17:33:49 2013 +0000
    
        Resolves: rhbz#907933 crash on removing second last para in cell...
    
        if (basically) the last para is on next page
    
    so revert that and try a different fix which now works to keep the original
    problem crash-free and fix this one too
    
    Change-Id: Ia6b3ef48c43ceceb7ee7cc2b8b803314349f3785

diff --git a/sw/source/core/inc/tabfrm.hxx b/sw/source/core/inc/tabfrm.hxx
index bd42457..92da368 100644
--- a/sw/source/core/inc/tabfrm.hxx
+++ b/sw/source/core/inc/tabfrm.hxx
@@ -156,8 +156,6 @@ public:
 
     bool HasFollowFlowLine() const { return m_bHasFollowFlowLine; }
     void SetFollowFlowLine(bool bNew) { m_bHasFollowFlowLine = bNew; }
-    //return the SwTabFrame (if any) that this SwTabFrame is a follow flow line for
-    SwTabFrame* GetFollowFlowLineFor();
 
     bool IsRebuildLastLine() const { return m_bIsRebuildLastLine; }
     void SetRebuildLastLine(bool bNew) { m_bIsRebuildLastLine = bNew; }
diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index 3295980..e4edd2b 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -129,28 +129,8 @@ extern const SwTable   *g_pRowCacheLastTable;
 extern const SwTabFrame  *g_pRowCacheLastTabFrame;
 extern const SwFrame     *g_pRowCacheLastCellFrame;
 
-//return the SwTabFrame (if any) that this SwTabFrame is a follow flow line for
-SwTabFrame* SwTabFrame::GetFollowFlowLineFor()
-{
-    SwFlowFrame *pPrec = GetPrecede();
-    if (pPrec && pPrec->GetFrame().IsTabFrame())
-    {
-        SwTabFrame *pPrevTabFrame = static_cast<SwTabFrame*>(pPrec);
-        assert(this == pPrevTabFrame->GetFollow());
-        if (pPrevTabFrame->HasFollowFlowLine() && pPrevTabFrame->GetFollow() == this)
-            return pPrevTabFrame;
-    }
-    return nullptr;
-}
-
 void SwTabFrame::DestroyImpl()
 {
-    //rhbz#907933, we are a follow flow line for something and have been
-    //deleted, remove ourself as a follow flowline
-    SwTabFrame* pFlowFrameFor = GetFollowFlowLineFor();
-    if (pFlowFrameFor)
-        pFlowFrameFor->RemoveFollowFlowLine();
-
     // There is some terrible code in fetab.cxx, that
     // makes use of these global pointers. Obviously
     // this code did not consider that a TabFrame can be
@@ -838,7 +818,8 @@ static long lcl_GetMaximumLayoutRowSpan( const SwRowFrame& rRow )
 bool SwTabFrame::RemoveFollowFlowLine()
 {
     // find FollowFlowLine
-    SwRowFrame* pFollowFlowLine = GetFollow()->GetFirstNonHeadlineRow();
+    SwTabFrame *pFoll = GetFollow();
+    SwRowFrame* pFollowFlowLine = pFoll ? pFoll->GetFirstNonHeadlineRow() : nullptr;
 
     // find last row in master
     SwFrame* pLastLine = GetLastLower();
@@ -1270,7 +1251,7 @@ bool SwTabFrame::Join()
 
     SwTabFrame *pFoll = GetFollow();
 
-    if ( !pFoll->IsJoinLocked() )
+    if (pFoll && !pFoll->IsJoinLocked())
     {
         SWRECTFN( this )
         pFoll->Cut();   //Cut out first to avoid unnecessary notifications.


More information about the Libreoffice-commits mailing list