[Libreoffice-commits] core.git: sw/source

Caolán McNamara caolanm at redhat.com
Mon Jan 1 17:15:41 UTC 2018


 sw/source/filter/html/htmltab.cxx |   21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

New commits:
commit 5670a9619b77a6a9e53b0cf20c059ea66ca5f450
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Jan 1 16:12:21 2018 +0000

    ofz#4767 Bad-cast
    
    Change-Id: Ibf8285efae7c570452954feb41a1a36bf44504a4
    Reviewed-on: https://gerrit.libreoffice.org/47235
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/source/filter/html/htmltab.cxx b/sw/source/filter/html/htmltab.cxx
index 7c6fb3933d16..d05d3a1fe6e6 100644
--- a/sw/source/filter/html/htmltab.cxx
+++ b/sw/source/filter/html/htmltab.cxx
@@ -34,6 +34,7 @@
 #include <svl/urihelper.hxx>
 #include <o3tl/make_unique.hxx>
 
+#include <dcontact.hxx>
 #include <fmtornt.hxx>
 #include <frmfmt.hxx>
 #include <fmtfsize.hxx>
@@ -5241,7 +5242,25 @@ std::shared_ptr<HTMLTable> SwHTMLParser::BuildTable(SvxAdjust eParentAdjust,
         {
             m_pPam->SetMark();
             m_pPam->DeleteMark();
-            m_xDoc->getIDocumentContentOperations().DeleteSection( const_cast<SwStartNode *>(pCapStNd) );
+
+            SwStartNode* pSttNd = const_cast<SwStartNode*>(pCapStNd);
+
+            //if section to be deleted contains a pending m_pMarquee, it will be deleted
+            //so clear m_pMarquee pointer if that's the case
+            SwFrameFormat* pObjectFormat = m_pMarquee ? ::FindFrameFormat(m_pMarquee) : nullptr;
+            if (pObjectFormat)
+            {
+                const SwFormatAnchor& rAnch = pObjectFormat->GetAnchor();
+                if (const SwPosition* pPos = rAnch.GetContentAnchor())
+                {
+                    SwNodeIndex aMarqueeNodeIndex(pPos->nNode);
+                    SwNodeIndex aSttIdx(*pSttNd), aEndIdx(*pSttNd->EndOfSectionNode());
+                    if (aMarqueeNodeIndex >= aSttIdx && aMarqueeNodeIndex <= aEndIdx)
+                        m_pMarquee = nullptr;
+                }
+            }
+
+            m_xDoc->getIDocumentContentOperations().DeleteSection(pSttNd);
             xCurTable->SetCaption( nullptr, false );
         }
     }


More information about the Libreoffice-commits mailing list