diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-01-01 16:12:21 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-01-01 18:15:16 +0100 |
commit | 5670a9619b77a6a9e53b0cf20c059ea66ca5f450 (patch) | |
tree | b845bc9eec953635d2f941018e1e483007e4f5b3 /sw/source | |
parent | ee29c944868a578b002103bb58595029bf385473 (diff) |
ofz#4767 Bad-cast
Change-Id: Ibf8285efae7c570452954feb41a1a36bf44504a4
Reviewed-on: https://gerrit.libreoffice.org/47235
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/filter/html/htmltab.cxx | 21 |
1 files changed, 20 insertions, 1 deletions
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 ); } } |