diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2023-04-25 14:08:32 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2023-04-26 05:58:58 +0200 |
commit | 9ca317ff313958706c63b132113d3f706813587d (patch) | |
tree | 677278ae562ca3d58aed087a88c3e45aa7e1976e | |
parent | d91dc9ffd57d749946dd6062a3d961fab47ec607 (diff) |
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.kaganski@collabora.com>
-rw-r--r-- | sw/qa/extras/htmlimport/data/tdf155011.html | 31 | ||||
-rw-r--r-- | sw/qa/extras/htmlimport/htmlimport.cxx | 6 | ||||
-rw-r--r-- | sw/source/core/layout/sectfrm.cxx | 4 |
3 files changed, 39 insertions, 2 deletions
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 d39d651560d6..34900529ada9 100644 --- a/sw/qa/extras/htmlimport/htmlimport.cxx +++ b/sw/qa/extras/htmlimport/htmlimport.cxx @@ -605,6 +605,12 @@ CPPUNIT_TEST_FIXTURE(HtmlImportTest, testTdf153341) CPPUNIT_ASSERT_EQUAL(Color(ColorTransparency, 0xB3, 0xFF, 0x00, 0x00), getProperty<Color>(xRun3, "CharColor")); } +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 |