summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorJustin Luth <jluth@mail.com>2023-02-22 11:19:40 -0500
committerJustin Luth <jluth@mail.com>2023-02-22 22:35:06 +0000
commitdbbfcb7e098c1c16f932785ef62ef7d3d819ad1a (patch)
tree71bc66ade3debb6605b20feaed1409d53a9a4e30 /sw
parent681f8e6e97ec45de3305e2056ccd8415582ba705 (diff)
tdf#153526 writerfilter: catch exception from no NumberingRules
This fixes a LO 7.5 regression (well, exposed some other flaws) from commit cf02b94bc513ee1b742b4c5d7174632b568e8b72. I first tried testing if hasPropertyByName, but that returns true(????), even though this is an editeng component. Well, ignoring the fundamental issues at play here (and there are many - like having a comment take over m_xPreviousParagraph) the issue is easily solved with a try/catch instead of a redundant if clause. Change-Id: I4f27fce3e2984235df19dc3ed4be558891b28a90 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147486 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf153526_commentInNumbering.docxbin0 -> 8910 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport18.cxx7
2 files changed, 7 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf153526_commentInNumbering.docx b/sw/qa/extras/ooxmlexport/data/tdf153526_commentInNumbering.docx
new file mode 100644
index 000000000000..f26240092c10
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf153526_commentInNumbering.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx
index 8b6795b726c5..2e71b5bcc7fe 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx
@@ -80,6 +80,13 @@ DECLARE_OOXMLEXPORT_TEST(testTdf147646, "tdf147646_mergedCellNumbering.docx")
CPPUNIT_ASSERT_EQUAL(OUString("2."),parseDump("/root/page/body/tab/row[4]/cell/txt/SwParaPortion/SwLineLayout/child::*[@type='PortionType::Number']","expand"));
}
+DECLARE_OOXMLEXPORT_TEST(testTdf153526_commentInNumbering, "tdf153526_commentInNumbering.docx")
+{
+ // an exception was prematurely ending finishParagraph, losing numbering and CRs
+ // so before the patch, this was 6.
+ CPPUNIT_ASSERT_EQUAL(13, getParagraphs());
+}
+
DECLARE_OOXMLEXPORT_TEST(testTdf153042_largeTab, "tdf153042_largeTab.docx")
{
// This is not the greatest test because it is slightly weird, and has a different layout