diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-07-23 21:48:25 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-07-24 08:51:33 +0100 |
commit | e22122e20ca69d0f2b0e8831e9ebf3afd2064329 (patch) | |
tree | eab4a28c8343d2c161c8fab774807d39b2700eb9 /sw | |
parent | f9f090d0d0f2b454d6c1dd14fe735e7e83fda9da (diff) |
Resolves: tdf#101058 crash on deleting certain table row
regression from...
commit 15d8b51bf82610c663f80fe552a1c0315e137ad3
Author: Caolán McNamara <caolanm@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
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/inc/tabfrm.hxx | 2 | ||||
-rw-r--r-- | sw/source/core/layout/tabfrm.cxx | 25 |
2 files changed, 3 insertions, 24 deletions
diff --git a/sw/source/core/inc/tabfrm.hxx b/sw/source/core/inc/tabfrm.hxx index bd4245757bbe..92da3687dba0 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 3295980254c9..e4edd2b4d70a 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. |