diff options
author | Caolán McNamara <caolanm@redhat.com> | 2022-12-04 20:19:42 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2022-12-05 08:47:22 +0000 |
commit | 83596187cdf75f29472bd800dc4e16df3f185299 (patch) | |
tree | 3c51d4ff780ce06fefd2b083d353730d6f5517d1 /sw/source/filter/html | |
parent | 50329087b9a46e5dade8f924abf68cbd982be494 (diff) |
ofz#53680 drop workarounds
and add original test-cases which nowadays function without workaround.
Change-Id: Ie2366737f9eb82774260b2a57bbf177f2712f485
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143638
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw/source/filter/html')
-rw-r--r-- | sw/source/filter/html/htmltab.cxx | 73 | ||||
-rw-r--r-- | sw/source/filter/html/swhtml.hxx | 2 |
2 files changed, 0 insertions, 75 deletions
diff --git a/sw/source/filter/html/htmltab.cxx b/sw/source/filter/html/htmltab.cxx index 3f7f03f19d3c..c8fee89794cc 100644 --- a/sw/source/filter/html/htmltab.cxx +++ b/sw/source/filter/html/htmltab.cxx @@ -4869,75 +4869,6 @@ HTMLTableOptions::HTMLTableOptions( const HTMLOptions& rOptions, } } -namespace -{ - 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; - } - }; -} - -void SwHTMLParser::ClearFootnotesMarksInRange(const SwNodeIndex& rMkNdIdx, const SwNodeIndex& rPtNdIdx) -{ - //similarly for footnotes - if (m_pFootEndNoteImpl) - { - m_pFootEndNoteImpl->aTextFootnotes.erase(std::remove_if(m_pFootEndNoteImpl->aTextFootnotes.begin(), - m_pFootEndNoteImpl->aTextFootnotes.end(), IndexInRange(rMkNdIdx, rPtNdIdx)), m_pFootEndNoteImpl->aTextFootnotes.end()); - if (m_pFootEndNoteImpl->aTextFootnotes.empty()) - { - m_pFootEndNoteImpl.reset(); - } - } - - //follow DelFlyInRange pattern here - assert(rMkNdIdx.GetIndex() <= rPtNdIdx.GetIndex()); - - SwDoc& rDoc = rMkNdIdx.GetNode().GetDoc(); - - //ofz#9733 drop bookmarks in this range - IDocumentMarkAccess* const pMarkAccess = rDoc.getIDocumentMarkAccess(); - pMarkAccess->deleteMarks(rMkNdIdx.GetNode(), SwNodeIndex(rPtNdIdx, 1).GetNode(), nullptr, std::nullopt, std::nullopt); - - SwFrameFormats& rTable = *rDoc.GetSpzFrameFormats(); - for ( auto i = rTable.size(); i; ) - { - SwFrameFormat *pFormat = rTable[--i]; - const SwFormatAnchor &rAnch = pFormat->GetAnchor(); - SwNode const*const pAnchorNode = rAnch.GetAnchorNode(); - if (pAnchorNode && - ((rAnch.GetAnchorId() == RndStdIds::FLY_AT_PARA) || - (rAnch.GetAnchorId() == RndStdIds::FLY_AT_CHAR)) && - ( rMkNdIdx < *pAnchorNode && *pAnchorNode <= rPtNdIdx.GetNode() )) - { - if( rPtNdIdx != *pAnchorNode ) - { - // If the Fly is deleted, all Flys in its content have to be deleted too. - const SwFormatContent &rContent = pFormat->GetContent(); - // But only fly formats own their content, not draw formats. - if (rContent.GetContentIdx() && pFormat->Which() == RES_FLYFRMFMT) - { - ClearFootnotesMarksInRange(*rContent.GetContentIdx(), - SwNodeIndex(*rContent.GetContentIdx()->GetNode().EndOfSectionNode())); - } - } - } - } -} - void SwHTMLParser::DeleteSection(SwStartNode* pSttNd) { //if section to be deleted contains a pending m_pMarquee, it will be deleted @@ -4945,10 +4876,6 @@ void SwHTMLParser::DeleteSection(SwStartNode* pSttNd) SwFrameFormat* pObjectFormat = m_pMarquee ? ::FindFrameFormat(m_pMarquee.get()) : nullptr; FrameDeleteWatch aWatch(pObjectFormat); - //similarly for footnotes - SwNodeIndex aSttIdx(*pSttNd), aEndIdx(*pSttNd->EndOfSectionNode()); - ClearFootnotesMarksInRange(aSttIdx, aEndIdx); - m_xDoc->getIDocumentContentOperations().DeleteSection(pSttNd); if (pObjectFormat) diff --git a/sw/source/filter/html/swhtml.hxx b/sw/source/filter/html/swhtml.hxx index fa4811c6d416..8fa4d5bdfba7 100644 --- a/sw/source/filter/html/swhtml.hxx +++ b/sw/source/filter/html/swhtml.hxx @@ -659,8 +659,6 @@ class SwHTMLParser : public SfxHTMLParser, public SvtListener // tags realized via character styles void NewCharFormat( HtmlTokenId nToken ); - void ClearFootnotesMarksInRange(const SwNodeIndex& rSttIdx, const SwNodeIndex& rEndIdx); - void DeleteSection(SwStartNode* pSttNd); // <SDFIELD> |