diff options
Diffstat (limited to 'sw/source/filter/html/htmltab.cxx')
-rw-r--r-- | sw/source/filter/html/htmltab.cxx | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/sw/source/filter/html/htmltab.cxx b/sw/source/filter/html/htmltab.cxx index 92ec9aa5c928..59cc59c64e5f 100644 --- a/sw/source/filter/html/htmltab.cxx +++ b/sw/source/filter/html/htmltab.cxx @@ -58,6 +58,7 @@ #include "swhtml.hxx" #include "swcss1.hxx" #include <numrule.hxx> +#include <txtftn.hxx> #define NETSCAPE_DFLT_BORDER 1 #define NETSCAPE_DFLT_CELLSPACING 2 @@ -5021,6 +5022,24 @@ namespace m_pObjectFormat->Remove(this); } }; + + class IndexInRange + { + private: + SwNodeIndex maStart; + SwNodeIndex maEnd; + public: + explicit IndexInRange(const SwNodeIndex& rStart, const SwNodeIndex& rEnd) + : maStart(rStart) + , maEnd(rEnd) + { + } + bool operator()(const SwHTMLTextFootnote& rTextFootnote) const + { + const SwNodeIndex aTextIdx(rTextFootnote.pTextFootnote->GetTextNode()); + return aTextIdx >= maStart && aTextIdx <= maEnd; + } + }; } std::shared_ptr<HTMLTable> SwHTMLParser::BuildTable(SvxAdjust eParentAdjust, @@ -5294,6 +5313,19 @@ std::shared_ptr<HTMLTable> SwHTMLParser::BuildTable(SvxAdjust eParentAdjust, SwFrameFormat* pObjectFormat = m_pMarquee ? ::FindFrameFormat(m_pMarquee) : nullptr; FrameDeleteWatch aWatch(pObjectFormat); + //similarly for footnotes + if (m_pFootEndNoteImpl) + { + SwNodeIndex aSttIdx(*pSttNd), aEndIdx(*pSttNd->EndOfSectionNode()); + m_pFootEndNoteImpl->aTextFootnotes.erase(std::remove_if(m_pFootEndNoteImpl->aTextFootnotes.begin(), + m_pFootEndNoteImpl->aTextFootnotes.end(), IndexInRange(aSttIdx, aEndIdx)), m_pFootEndNoteImpl->aTextFootnotes.end()); + if (m_pFootEndNoteImpl->aTextFootnotes.empty()) + { + delete m_pFootEndNoteImpl; + m_pFootEndNoteImpl = nullptr; + } + } + m_xDoc->getIDocumentContentOperations().DeleteSection(pSttNd); xCurTable->SetCaption( nullptr, false ); |