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 4f5a196b4aaaaa86ccc5250f25d298e13a0fa952 Author: Mike Kaganski <mike.kagan...@collabora.com> AuthorDate: Tue Apr 25 14:08:32 2023 +0300 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Wed Apr 26 09:28:24 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/+/151013 Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> 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 c97d4e4cbde4..7b7f3a0269e3 100644 --- a/sw/qa/extras/htmlimport/htmlimport.cxx +++ b/sw/qa/extras/htmlimport/htmlimport.cxx @@ -574,6 +574,12 @@ CPPUNIT_TEST_FIXTURE(HtmlImportTest, testRGBAColor) CPPUNIT_ASSERT_EQUAL(nBackColor, getProperty<Color>(xRun, "CharBackColor")); } +CPPUNIT_TEST_FIXTURE(HtmlImportTest, testTdf155011) +{ + createSwWebDoc("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 cc6c3982d3a4..0b1ac612bfd9 100644 --- a/sw/source/core/layout/sectfrm.cxx +++ b/sw/source/core/layout/sectfrm.cxx @@ -522,9 +522,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