solenv/clang-format/excludelist | 1 sw/CppunitTest_sw_ww8export4.mk | 14 +++++++ sw/Module_sw.mk | 1 sw/qa/extras/ww8export/data/tdf148360.doc |binary sw/qa/extras/ww8export/ww8export4.cxx | 55 ++++++++++++++++++++++++++++++ sw/source/filter/ww8/ww8par.cxx | 1 6 files changed, 72 insertions(+)
New commits: commit 2405a36f3bcd43f80371ccaed47f7523ff0d8757 Author: Justin Luth <jl...@mail.com> AuthorDate: Thu Aug 11 09:29:58 2022 -0400 Commit: Justin Luth <jl...@mail.com> CommitDate: Thu Aug 11 19:38:29 2022 +0200 tdf#148360 doc import: add NO_NUMBERING_SHOW_FOLLOWBY(true) Change-Id: I2bc595e13fd13f29b4bf22f71c6c6bb4b4483731 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138148 Tested-by: Jenkins Reviewed-by: Justin Luth <jl...@mail.com> diff --git a/solenv/clang-format/excludelist b/solenv/clang-format/excludelist index 0cd36cb7d1c3..44d5c3392974 100644 --- a/solenv/clang-format/excludelist +++ b/solenv/clang-format/excludelist @@ -12259,6 +12259,7 @@ sw/qa/extras/uiwriter/uiwriter.cxx sw/qa/extras/ww8export/ww8export.cxx sw/qa/extras/ww8export/ww8export2.cxx sw/qa/extras/ww8export/ww8export3.cxx +sw/qa/extras/ww8export/ww8export4.cxx sw/qa/extras/ww8import/ww8import.cxx sw/qa/inc/bordertest.hxx sw/qa/inc/swmodeltestbase.hxx diff --git a/sw/CppunitTest_sw_ww8export4.mk b/sw/CppunitTest_sw_ww8export4.mk new file mode 100644 index 000000000000..47ac483ba688 --- /dev/null +++ b/sw/CppunitTest_sw_ww8export4.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_ww8export_test,4)) + +# vim: set noet sw=4 ts=4: diff --git a/sw/Module_sw.mk b/sw/Module_sw.mk index 146b6c7bf138..e93ae26ceb42 100644 --- a/sw/Module_sw.mk +++ b/sw/Module_sw.mk @@ -100,6 +100,7 @@ $(eval $(call gb_Module_add_slowcheck_targets,sw,\ CppunitTest_sw_ww8export \ CppunitTest_sw_ww8export2 \ CppunitTest_sw_ww8export3 \ + CppunitTest_sw_ww8export4 \ CppunitTest_sw_ww8import \ CppunitTest_sw_rtfimport \ CppunitTest_sw_odfexport \ diff --git a/sw/qa/extras/ww8export/data/tdf148360.doc b/sw/qa/extras/ww8export/data/tdf148360.doc new file mode 100644 index 000000000000..3969a560999f Binary files /dev/null and b/sw/qa/extras/ww8export/data/tdf148360.doc differ diff --git a/sw/qa/extras/ww8export/ww8export4.cxx b/sw/qa/extras/ww8export/ww8export4.cxx new file mode 100644 index 000000000000..91b9477a996f --- /dev/null +++ b/sw/qa/extras/ww8export/ww8export4.cxx @@ -0,0 +1,55 @@ +/* -*- 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/container/XIndexAccess.hpp> +#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp> +#include <com/sun/star/graphic/XGraphic.hpp> +#include <com/sun/star/text/XTextDocument.hpp> + +#include <comphelper/sequenceashashmap.hxx> +#include <o3tl/string_view.hxx> + +#include <docsh.hxx> +#include <IDocumentSettingAccess.hxx> +#include <unotxdoc.hxx> + +class Test : public SwModelTestBase +{ +public: + Test() + : SwModelTestBase("/sw/qa/extras/ww8export/data/", "MS Word 97") + { + } + + bool mustTestImportOf(const char* filename) const override + { + // If the testcase is stored in some other format, it's pointless to test. + return o3tl::ends_with(filename, ".doc"); + } +}; + +CPPUNIT_TEST_FIXTURE(Test, testTdf148360) +{ + loadAndReload("tdf148360.doc"); + const auto& pLayout = parseLayoutDump(); + + // Ensure first element is a tab + assertXPath(pLayout, "/root/page[1]/body/txt[1]/Text[1]", "nType", "PortionType::TabLeft"); + // and only then goes content + assertXPath(pLayout, "/root/page[1]/body/txt[1]/Text[2]", "nType", "PortionType::Text"); +} + + + +CPPUNIT_PLUGIN_IMPLEMENT(); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 548726482993..1da871b4c9d1 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -1887,6 +1887,7 @@ void SwWW8ImplReader::ImportDop() m_rDoc.getIDocumentSettingAccess().set(DocumentSettingId::SURROUND_TEXT_WRAP_SMALL, true); m_rDoc.getIDocumentSettingAccess().set(DocumentSettingId::PROP_LINE_SPACING_SHRINKS_FIRST_LINE, true); m_rDoc.getIDocumentSettingAccess().set(DocumentSettingId::CONTINUOUS_ENDNOTES, true); + m_rDoc.getIDocumentSettingAccess().set(DocumentSettingId::NO_NUMBERING_SHOW_FOLLOWBY, true); // COMPATIBILITY FLAGS END