sw/source/core/layout/tabfrm.cxx  |   16 ++++++++++++++++
 sw/source/core/txtnode/thints.cxx |    4 ++++
 2 files changed, 20 insertions(+)

New commits:
commit 23c333b10c270397dd7ff4bb36c94d6076dec003
Author: Michael Stahl <mst...@redhat.com>
Date:   Fri May 12 18:34:17 2017 +0200

    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 <c...@libreoffice.org>
    Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk>

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();
+                        }
                     }
                 }
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to