sw/qa/core/data/html/pass/ofz5007-1.html  |    1 
 sw/qa/core/data/html/pass/ofz53680-1.html |binary
 sw/source/filter/html/htmltab.cxx         |   73 ------------------------------
 sw/source/filter/html/swhtml.hxx          |    2 
 4 files changed, 1 insertion(+), 75 deletions(-)

New commits:
commit 83596187cdf75f29472bd800dc4e16df3f185299
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Sun Dec 4 20:19:42 2022 +0000
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Mon Dec 5 08:47:22 2022 +0000

    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 <caol...@redhat.com>

diff --git a/sw/qa/core/data/html/pass/ofz5007-1.html 
b/sw/qa/core/data/html/pass/ofz5007-1.html
new file mode 100644
index 000000000000..f427c4c6069f
--- /dev/null
+++ b/sw/qa/core/data/html/pass/ofz5007-1.html
@@ -0,0 +1 @@
+<table> <caption> <table><td></td><caption><table align="right"><td><MARQUEE>
\ No newline at end of file
diff --git a/sw/qa/core/data/html/pass/ofz53680-1.html 
b/sw/qa/core/data/html/pass/ofz53680-1.html
new file mode 100644
index 000000000000..d7fbcb2ebbce
Binary files /dev/null and b/sw/qa/core/data/html/pass/ofz53680-1.html differ
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>

Reply via email to