summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustin Luth <justin_luth@sil.org>2021-08-25 08:39:33 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2021-08-25 11:33:43 +0200
commit824a46920348451a483dd195bb6ca651cf1d4f4c (patch)
tree13e1af1f00ecadbff309dda01e3ee018f82b8f3a
parenttdf#137737 i18n search: don't expand start/end with regex ^ or $ (diff)
downloadcore-824a46920348451a483dd195bb6ca651cf1d4f4c.tar.gz
core-824a46920348451a483dd195bb6ca651cf1d4f4c.zip
tdf#135164 add unit test
fixed by tdf#143605, but that was a bit different, so adding a specific docx unit test. Change-Id: I9f5a6b225277f1c1fdbfed7759919b3fd6e5dea5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121010 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
-rw-r--r--solenv/clang-format/excludelist1
-rw-r--r--sw/CppunitTest_sw_ooxmlexport17.mk14
-rw-r--r--sw/Module_sw.mk1
-rwxr-xr-xsw/qa/extras/ooxmlexport/data/tdf135164_cancelledNumbering.docxbin0 -> 19962 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport17.cxx47
5 files changed, 63 insertions, 0 deletions
diff --git a/solenv/clang-format/excludelist b/solenv/clang-format/excludelist
index 13a5f25ac5ff..6d6605c30c3a 100644
--- a/solenv/clang-format/excludelist
+++ b/solenv/clang-format/excludelist
@@ -12320,6 +12320,7 @@ sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
sw/qa/extras/ooxmlexport/ooxmlexport16.cxx
+sw/qa/extras/ooxmlexport/ooxmlexport17.cxx
sw/qa/extras/ooxmlexport/ooxmlexport2.cxx
sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
diff --git a/sw/CppunitTest_sw_ooxmlexport17.mk b/sw/CppunitTest_sw_ooxmlexport17.mk
new file mode 100644
index 000000000000..80316e1c0ca4
--- /dev/null
+++ b/sw/CppunitTest_sw_ooxmlexport17.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,17))
+
+# vim: set noet sw=4 ts=4:
diff --git a/sw/Module_sw.mk b/sw/Module_sw.mk
index f4530e2a139d..3f200348d0a3 100644
--- a/sw/Module_sw.mk
+++ b/sw/Module_sw.mk
@@ -88,6 +88,7 @@ $(eval $(call gb_Module_add_slowcheck_targets,sw,\
CppunitTest_sw_ooxmlexport14 \
CppunitTest_sw_ooxmlexport15 \
CppunitTest_sw_ooxmlexport16 \
+ CppunitTest_sw_ooxmlexport17 \
CppunitTest_sw_ooxmlexport_template \
CppunitTest_sw_ooxmlfieldexport \
CppunitTest_sw_ooxmllinks \
diff --git a/sw/qa/extras/ooxmlexport/data/tdf135164_cancelledNumbering.docx b/sw/qa/extras/ooxmlexport/data/tdf135164_cancelledNumbering.docx
new file mode 100755
index 000000000000..47008b69d98f
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf135164_cancelledNumbering.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx
new file mode 100644
index 000000000000..4eb9d0d6aa1b
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx
@@ -0,0 +1,47 @@
+/* -*- 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 <sal/config.h>
+
+#include <string_view>
+
+#include <swmodeltestbase.hxx>
+
+constexpr OUStringLiteral DATA_DIRECTORY = u"/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(testTdf135164_cancelledNumbering, "tdf135164_cancelledNumbering.docx")
+{
+ uno::Reference<beans::XPropertySet> xPara(getParagraph(1, u"TBMM DÖNEMİ"), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(OUString(""), getProperty<OUString>(xPara, "ListLabelString"));
+
+ xPara.set(getParagraph(2, "Numbering explicitly cancelled"), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(OUString(""), getProperty<OUString>(xPara, "ListLabelString"));
+
+ xPara.set(getParagraph(6, "Default style has roman numbering"), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(OUString("i"), getProperty<OUString>(xPara, "ListLabelString"));
+}
+
+CPPUNIT_PLUGIN_IMPLEMENT();
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */