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>
This commit is contained in:
Caolán McNamara
2013-02-05 17:33:49 +00:00
committed by Michael Stahl
parent 8418a12236
commit 15d8b51bf8
2 changed files with 22 additions and 0 deletions

View File

@@ -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; }

View File

@@ -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