diff options
author | Justin Luth <justin_luth@sil.org> | 2021-08-25 08:39:33 +0200 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2021-08-25 11:33:43 +0200 |
commit | 824a46920348451a483dd195bb6ca651cf1d4f4c (patch) | |
tree | 13e1af1f00ecadbff309dda01e3ee018f82b8f3a /sw | |
parent | 42a62ab46af52fae0592150ffe5e9ce8b39314b5 (diff) |
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>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/CppunitTest_sw_ooxmlexport17.mk | 14 | ||||
-rw-r--r-- | sw/Module_sw.mk | 1 | ||||
-rwxr-xr-x | sw/qa/extras/ooxmlexport/data/tdf135164_cancelledNumbering.docx | bin | 0 -> 19962 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport17.cxx | 47 |
4 files changed, 62 insertions, 0 deletions
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 Binary files differnew file mode 100755 index 000000000000..47008b69d98f --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf135164_cancelledNumbering.docx 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: */ |