solenv/clang-format/excludelist | 1 sw/CppunitTest_sw_ooxmlexport17.mk | 14 ++ sw/Module_sw.mk | 1 sw/qa/extras/ooxmlexport/data/tdf135164_cancelledNumbering.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport17.cxx | 47 ++++++++++ 5 files changed, 63 insertions(+)
New commits: commit 226ab4d444dbbf8a257b38e08b138713466fe7cd Author: Justin Luth <justin_l...@sil.org> AuthorDate: Wed Aug 25 08:39:33 2021 +0200 Commit: Justin Luth <justin_l...@sil.org> CommitDate: Thu Aug 26 11:49:08 2021 +0200 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/+/121008 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_l...@sil.org> diff --git a/solenv/clang-format/excludelist b/solenv/clang-format/excludelist index 9e4985f4601c..4489b1991fbe 100644 --- a/solenv/clang-format/excludelist +++ b/solenv/clang-format/excludelist @@ -12314,6 +12314,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 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf135164_cancelledNumbering.docx 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: */