summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-02-05 17:33:49 +0000
committerMichael Stahl <mstahl@redhat.com>2013-02-06 16:10:23 +0100
commitdc65bfac2597430ea087a9dcbcded7316d9319b7 (patch)
treea1a598e8194f0b8fd14f3cd11f0d82325c817f95 /sw
parent232b93e7f0e0ca90b54fe96d2c1adc5766d6706c (diff)
Resolves: rhbz#907933 crash on removing second last para in cell...
if (basically) the last para is on next page Change-Id: Iaff610ea94a829e73bfb8c694a27e0e9b4f6e295 Reviewed-on: https://gerrit.libreoffice.org/2012 Tested-by: Michael Stahl <mstahl@redhat.com> Reviewed-by: Michael Stahl <mstahl@redhat.com> (cherry picked from commit 15d8b51bf82610c663f80fe552a1c0315e137ad3)
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/inc/tabfrm.hxx2
-rw-r--r--sw/source/core/layout/tabfrm.cxx20
2 files changed, 22 insertions, 0 deletions
diff --git a/sw/source/core/inc/tabfrm.hxx b/sw/source/core/inc/tabfrm.hxx
index 464fc9c69d6b..1041385562ba 100644
--- a/sw/source/core/inc/tabfrm.hxx
+++ b/sw/source/core/inc/tabfrm.hxx
@@ -151,6 +151,8 @@ public:
//
sal_Bool HasFollowFlowLine() const { return bHasFollowFlowLine; }
void SetFollowFlowLine( sal_Bool bNew ) { bHasFollowFlowLine = bNew; }
+ //return the SwTabFrm (if any) that this SwTabFrm is a follow flow line for
+ SwTabFrm* GetFollowFlowLineFor();
sal_Bool IsRebuildLastLine() const { return bIsRebuildLastLine; }
void SetRebuildLastLine( sal_Bool bNew ) { bIsRebuildLastLine = bNew; }
diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index 394538384079..6aa2cee62ba0 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -132,8 +132,28 @@ extern const SwTable *pRowCacheLastTable;
extern const SwTabFrm *pRowCacheLastTabFrm;
extern const SwFrm *pRowCacheLastCellFrm;
+//return the SwTabFrm (if any) that this SwTabFrm is a follow flow line for
+SwTabFrm* SwTabFrm::GetFollowFlowLineFor()
+{
+ SwFlowFrm *pPrec = GetPrecede();
+ if (pPrec && pPrec->GetFrm()->IsTabFrm())
+ {
+ SwTabFrm *pPrevTabFrm = (SwTabFrm*)pPrec;
+ assert(this == pPrevTabFrm->GetFollow());
+ if (pPrevTabFrm->HasFollowFlowLine() && pPrevTabFrm->GetFollow() == this)
+ return pPrevTabFrm;
+ }
+ return NULL;
+}
+
SwTabFrm::~SwTabFrm()
{
+ //rhbz#907933, we are a follow flow line for something and have been
+ //deleted, remove ourself as a follow flowline
+ SwTabFrm* 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 TabFrm can be