sw/qa/extras/htmlimport/data/tdf155011.html |   31 ++++++++++++++++++++++++++++
 sw/qa/extras/htmlimport/htmlimport.cxx      |    6 +++++
 sw/source/core/layout/sectfrm.cxx           |    4 +--
 3 files changed, 39 insertions(+), 2 deletions(-)

New commits:
commit 26d5005f4e7500beed4d6041b9e9ccc74e7dec6a
Author:     Mike Kaganski <mike.kagan...@collabora.com>
AuthorDate: Tue Apr 25 14:08:32 2023 +0300
Commit:     Mike Kaganski <mike.kagan...@collabora.com>
CommitDate: Thu Apr 27 17:47:57 2023 +0200

    tdf#155011: Fix assert/check
    
    pFrameStartAfter may be a section frame itself, thus its FindSctFrame
    would not return this. Same for pSav.
    
    Change-Id: Ib592965b30eb47f37ba54fe7f39af0b8689b3175
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150981
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>
    (cherry picked from commit 9ca317ff313958706c63b132113d3f706813587d)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151015
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>

diff --git a/sw/qa/extras/htmlimport/data/tdf155011.html 
b/sw/qa/extras/htmlimport/data/tdf155011.html
new file mode 100644
index 000000000000..b3bc7845b56a
--- /dev/null
+++ b/sw/qa/extras/htmlimport/data/tdf155011.html
@@ -0,0 +1,31 @@
+<html>
+ <body>
+  <table>
+   <tr>
+    <td>
+     <div id="foo1">
+      <table>
+       <tr>
+        <td>
+         <div id="foo2">
+          <form>
+           <table>
+            <tr>
+             <td>
+              <input type="radio"/>
+             </td>
+            </tr>
+           </table>
+          </form>
+          <div id="foo3"/>
+          <div id="foo4"/>
+         </div>
+        </td>
+       </tr>
+      </table>
+     </div>
+    </td>
+   </tr>
+  </table>
+ </body>
+</html>
\ No newline at end of file
diff --git a/sw/qa/extras/htmlimport/htmlimport.cxx 
b/sw/qa/extras/htmlimport/htmlimport.cxx
index e4547d02a008..3ed2ce922c68 100644
--- a/sw/qa/extras/htmlimport/htmlimport.cxx
+++ b/sw/qa/extras/htmlimport/htmlimport.cxx
@@ -548,6 +548,12 @@ CPPUNIT_TEST_FIXTURE(HtmlImportTest, testRGBAColor)
     CPPUNIT_ASSERT_EQUAL(nBackColor, getProperty<Color>(xRun, 
"CharBackColor"));
 }
 
+CPPUNIT_TEST_FIXTURE(HtmlImportTest, testTdf155011)
+{
+    load(mpTestDocumentPath, "tdf155011.html");
+    // Must not crash / fail asserts
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/layout/sectfrm.cxx 
b/sw/source/core/layout/sectfrm.cxx
index fded9b2dc36b..111c31f7d3b6 100644
--- a/sw/source/core/layout/sectfrm.cxx
+++ b/sw/source/core/layout/sectfrm.cxx
@@ -518,9 +518,9 @@ void SwSectionFrame::MergeNext( SwSectionFrame* pNxt )
 |*/
 SwSectionFrame* SwSectionFrame::SplitSect( SwFrame* pFrameStartAfter, SwFrame* 
pFramePutAfter )
 {
-    assert(!pFrameStartAfter || pFrameStartAfter->FindSctFrame() == this);
+    assert(!pFrameStartAfter || IsAnLower(pFrameStartAfter));
     SwFrame* pSav = pFrameStartAfter ? pFrameStartAfter->FindNext() : 
ContainsAny();
-    if (pSav && pSav->FindSctFrame() != this)
+    if (pSav && !IsAnLower(pSav))
         pSav = nullptr; // we are at the very end
 
     // Put the content aside

Reply via email to