From bfcd952dc7820c4cf8761c4222d29ede039391dc Mon Sep 17 00:00:00 2001 From: Justin Luth Date: Tue, 15 Dec 2020 10:01:03 +0300 Subject: tdf#138892 writerfilter: cancel style list if bNoNumbering This fixes 6.1 regression e24e2d2fb02239753c1520a0458b44683ea4cc2e. Starting in 7.0 (tdf#131321), paragraph styles kept their numbering property. But even before that, non-paragraphs marked by bNoNumbering we 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 --- .../ooxmlexport/data/tdf138892_noNumbering.docx | Bin 0 -> 18468 bytes sw/qa/extras/ooxmlexport/ooxmlexport16.cxx | 43 +++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 sw/qa/extras/ooxmlexport/data/tdf138892_noNumbering.docx create mode 100644 sw/qa/extras/ooxmlexport/ooxmlexport16.cxx (limited to 'sw/qa') 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 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf138892_noNumbering.docx 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 + +#include +#include +#include +#include + +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(getParagraph(1), "NumberingStyleName").isEmpty()); + CPPUNIT_ASSERT_MESSAGE("Para2: ", getProperty(getParagraph(2), "NumberingStyleName").isEmpty()); + CPPUNIT_ASSERT_MESSAGE("Para3: ", getProperty(getParagraph(3), "NumberingStyleName").isEmpty()); +} + +CPPUNIT_PLUGIN_IMPLEMENT(); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit