summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2023-04-25 14:08:32 +0300
committerMiklos Vajna <vmiklos@collabora.com>2023-04-27 17:00:33 +0200
commite8c1abfd7678eb2bfb6c411334f389ada515e14f (patch)
tree14c738e6c633491e507cfa6fd9c49800a14b3818
parenttdf#154113: do not forget to split the outermost section frame (diff)
downloadcore-e8c1abfd7678eb2bfb6c411334f389ada515e14f.tar.gz
core-e8c1abfd7678eb2bfb6c411334f389ada515e14f.zip
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> (cherry picked from commit 9ca317ff313958706c63b132113d3f706813587d) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151013 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> (cherry picked from commit 4f5a196b4aaaaa86ccc5250f25d298e13a0fa952) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151112 Tested-by: Aron Budea <aron.budea@collabora.com> Reviewed-by: Aron Budea <aron.budea@collabora.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
-rw-r--r--sw/qa/extras/htmlimport/data/tdf155011.html31
-rw-r--r--sw/qa/extras/htmlimport/htmlimport.cxx6
-rw-r--r--sw/source/core/layout/sectfrm.cxx4
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 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