summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2017-05-12 18:34:17 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2017-05-16 12:33:32 +0200
commit23c333b10c270397dd7ff4bb36c94d6076dec003 (patch)
treebea9520f342c75b08b74d818e0f470f493e607e0
parentc4b55ea03da881590e5fac1ffc97177e4ce16b0b (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 (cherry picked from commit c9fb347642729017ad0c613fe26310befd021db8) Reviewed-on: https://gerrit.libreoffice.org/37562 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
-rw-r--r--sw/source/core/layout/tabfrm.cxx16
-rw-r--r--sw/source/core/txtnode/thints.cxx4
2 files changed, 20 insertions, 0 deletions
diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index b2e56e8bbbc6..d08468aaa1e1 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -3463,6 +3463,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( (Frame().*aRectFnSet->fnGetHeight)() )
{
// OD 26.08.2003 #i18103# - *no* 'ColUnlock' of section -
diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx
index 0e6f73fd5939..eb2180702b1e 100644
--- a/sw/source/core/txtnode/thints.cxx
+++ b/sw/source/core/txtnode/thints.cxx
@@ -1400,6 +1400,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();
+ }
}
}