summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorJustin Luth <justin.luth@collabora.com>2020-12-15 10:01:03 +0300
committerMiklos Vajna <vmiklos@collabora.com>2020-12-16 15:57:54 +0100
commit88aa8f5343705008b86ef41512993a00d331a668 (patch)
treeaee6b5829c81a498523615a891c8d623404ffee7 /sw
parentb4e9f8093daecec90e8294287029070262a634ac (diff)
tdf#138892 writerfilter: cancel style list if bNoNumbering
This fixes 6.1 regression from tdf#95377's commit e24e2d2fb02239753c1520a0458b44683ea4cc2e. Starting in 7.0 (tdf#131321), paragraph styles kept their numbering property. But even before that, non-paragraphs marked by bNoNumbering were having their direct numbering removed, and then finishParagraph applied para-style numbering since there was no direct numbering. So, we need to pass the bNoNumbering to finishParagraph so that it can cancel out a style-assigned numbering. Change-Id: I0c24af4e9bd0ea3712179a47ed3550f91c8f44b7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107738 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org> (cherry picked from commit bfcd952dc7820c4cf8761c4222d29ede039391dc) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107795 (cherry picked from commit e901ffcb93d217f2cc09021a3b2fecb36f9884f6) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107796 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Justin Luth <justin_luth@sil.org>
Diffstat (limited to 'sw')
-rw-r--r--sw/CppunitTest_sw_ooxmlexport16.mk14
-rw-r--r--sw/Module_sw.mk1
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf138892_noNumbering.docxbin0 -> 18468 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport16.cxx43
4 files changed, 58 insertions, 0 deletions
diff --git a/sw/CppunitTest_sw_ooxmlexport16.mk b/sw/CppunitTest_sw_ooxmlexport16.mk
new file mode 100644
index 000000000000..4e78cef57760
--- /dev/null
+++ b/sw/CppunitTest_sw_ooxmlexport16.mk
@@ -0,0 +1,14 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#*************************************************************************
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+#*************************************************************************
+
+$(eval $(call sw_ooxmlexport_test,16))
+
+# vim: set noet sw=4 ts=4:
diff --git a/sw/Module_sw.mk b/sw/Module_sw.mk
index be2e7e8d86c7..c1dff1df5c5a 100644
--- a/sw/Module_sw.mk
+++ b/sw/Module_sw.mk
@@ -81,6 +81,7 @@ $(eval $(call gb_Module_add_slowcheck_targets,sw,\
CppunitTest_sw_ooxmlexport13 \
CppunitTest_sw_ooxmlexport14 \
CppunitTest_sw_ooxmlexport15 \
+ CppunitTest_sw_ooxmlexport16 \
CppunitTest_sw_ooxmlexport_template \
CppunitTest_sw_ooxmlfieldexport \
CppunitTest_sw_ooxmllinks \
diff --git a/sw/qa/extras/ooxmlexport/data/tdf138892_noNumbering.docx b/sw/qa/extras/ooxmlexport/data/tdf138892_noNumbering.docx
new file mode 100644
index 000000000000..5c0a0176e37c
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf138892_noNumbering.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx
new file mode 100644
index 000000000000..174f2f0f7330
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx
@@ -0,0 +1,43 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include <swmodeltestbase.hxx>
+
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/text/XTextViewCursorSupplier.hpp>
+#include <com/sun/star/text/XTextTable.hpp>
+#include <com/sun/star/text/XTextTablesSupplier.hpp>
+
+char const DATA_DIRECTORY[] = "/sw/qa/extras/ooxmlexport/data/";
+
+class Test : public SwModelTestBase
+{
+public:
+ Test() : SwModelTestBase(DATA_DIRECTORY, "Office Open XML Text") {}
+
+protected:
+ /**
+ * Denylist handling
+ */
+ bool mustTestImportOf(const char* filename) const override {
+ // If the testcase is stored in some other format, it's pointless to test.
+ return OString(filename).endsWith(".docx");
+ }
+};
+
+DECLARE_OOXMLEXPORT_TEST(testTdf138892_noNumbering, "tdf138892_noNumbering.docx")
+{
+ CPPUNIT_ASSERT_MESSAGE("Para1: Bullet point", !getProperty<OUString>(getParagraph(1), "NumberingStyleName").isEmpty());
+ CPPUNIT_ASSERT_MESSAGE("Para2: <blank line>", getProperty<OUString>(getParagraph(2), "NumberingStyleName").isEmpty());
+ CPPUNIT_ASSERT_MESSAGE("Para3: <blank line>", getProperty<OUString>(getParagraph(3), "NumberingStyleName").isEmpty());
+}
+
+CPPUNIT_PLUGIN_IMPLEMENT();
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */