summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2017-05-12 18:34:17 +0200
committerMichael Stahl <mstahl@redhat.com>2017-05-12 21:18:59 +0200
commitc9fb347642729017ad0c613fe26310befd021db8 (patch)
tree4a904b116e4c05f65504a335297a2491242bc8b6 /sw
parentf6785b99a3f7e7531c8ef7ed16402cc4e02c9750 (diff)
sw: table-in-footnote: delete SwFootnoteFrame if it becomes empty
Crashed in a11y code with a SwFootnoteFrame that survived a JoinNode and subsequent deletion of its reference-containing SwTextFrame and thus had a stale "pRef" member; presumably the SwTableFrame needs to delete an empty footnote frame like the SwTextFrame does from SwContentFrame::Cut(), called from DelFrames(), called from CutImpl(). Change-Id: I5a30357ecd3bf474bfc4a5451de89beb245fb0ae
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/layout/tabfrm.cxx17
-rw-r--r--sw/source/core/txtnode/thints.cxx4
2 files changed, 21 insertions, 0 deletions
diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index 147f517914bb..1de4d238e270 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -3458,6 +3458,22 @@ void SwTabFrame::Cut()
pSct->InvalidateSize_();
}
}
+ // table-in-footnote: delete empty footnote frames (like SwContentFrame::Cut)
+ else if (!pUp->Lower() && pUp->IsFootnoteFrame() && !pUp->IsColLocked())
+ {
+ if (pUp->GetNext() && !pUp->GetPrev())
+ {
+ if (SwFrame *const pTmp = static_cast<SwLayoutFrame*>(pUp->GetNext())->ContainsAny())
+ {
+ pTmp->InvalidatePrt_();
+ }
+ }
+ if (!pUp->IsDeleteForbidden())
+ {
+ pUp->Cut();
+ SwFrame::DestroyFrame(pUp);
+ }
+ }
else if( aRectFnSet.GetHeight(Frame()) )
{
// OD 26.08.2003 #i18103# - *no* 'ColUnlock' of section -
@@ -3466,6 +3482,7 @@ void SwTabFrame::Cut()
}
}
+
if ( pPage && !IsFollow() && pPage->GetUpper() )
static_cast<SwRootFrame*>(pPage->GetUpper())->InvalidateBrowseWidth();
}
diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx
index 2737ddad4e8b..c590a6e5cab7 100644
--- a/sw/source/core/txtnode/thints.cxx
+++ b/sw/source/core/txtnode/thints.cxx
@@ -1384,6 +1384,10 @@ bool SwTextNode::InsertHint( SwTextAttr * const pAttr, const SetAttrMode nMode )
SwContentNode* pCNd = rNodes[ nSttIdx ]->GetContentNode();
if( nullptr != pCNd )
pCNd->DelFrames();
+ else if (SwTableNode *const pTable = rNodes[nSttIdx]->GetTableNode())
+ {
+ pTable->DelFrames();
+ }
}
}