From b8727666969156534c05b54a1addb54046969a50 Mon Sep 17 00:00:00 2001 From: Justin Luth Date: Wed, 21 Apr 2021 11:40:20 +0200 Subject: tdf#123405 doc import: inherit from all Outline styles Good - an example document that proves that inheritance needs to happen with more than the first 9 items which contain the Heading styles that are most often associated with Chapter Numbering. Change-Id: I69ab1dd3fdab4d54695d9b321b0d2970509090a6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114403 Tested-by: Jenkins Reviewed-by: Justin Luth --- .../data/tdf106541_inheritOutlineNumbering.doc | Bin 0 -> 40448 bytes sw/qa/extras/ww8export/ww8export3.cxx | 7 +++++++ sw/source/filter/ww8/ww8par.cxx | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 sw/qa/extras/ww8export/data/tdf106541_inheritOutlineNumbering.doc (limited to 'sw') diff --git a/sw/qa/extras/ww8export/data/tdf106541_inheritOutlineNumbering.doc b/sw/qa/extras/ww8export/data/tdf106541_inheritOutlineNumbering.doc new file mode 100644 index 000000000000..2fe243fe800a Binary files /dev/null and b/sw/qa/extras/ww8export/data/tdf106541_inheritOutlineNumbering.doc differ diff --git a/sw/qa/extras/ww8export/ww8export3.cxx b/sw/qa/extras/ww8export/ww8export3.cxx index a09edd763fa1..2ecde65c6bfb 100644 --- a/sw/qa/extras/ww8export/ww8export3.cxx +++ b/sw/qa/extras/ww8export/ww8export3.cxx @@ -806,6 +806,13 @@ DECLARE_WW8EXPORT_TEST(testTdf106541_inheritChapterNumberingB, "tdf106541_inheri CPPUNIT_ASSERT_EQUAL(OUString("1.1"), getProperty(xPara, "ListLabelString")); } +DECLARE_WW8EXPORT_TEST(testTdf106541_inheritOutlineNumbering, "tdf106541_inheritOutlineNumbering.doc") +{ + // The level and numbering are inherited from Level2. + uno::Reference xPara(getParagraph(2, "This should be a sub-point."), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("1.1"), getProperty(xPara, "ListLabelString")); +} + DECLARE_WW8EXPORT_TEST(testTdf120394, "tdf120394.doc") { CPPUNIT_ASSERT_EQUAL(1, getPages()); diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 9c9f06e62032..9721a3f8cf4d 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -5921,7 +5921,7 @@ void SwWW8ImplReader::SetOutlineStyles() // Copy inherited numbering info since LO drops inheritance after ChapterNumbering // and only applies listLevel via style with the selected ChapterNumbering LFO. bool bReRegister = false; - if (rSI.m_nBase && rSI.m_nBase < 10 && rSI.m_nBase < m_vColl.size() + if (rSI.m_nBase && rSI.m_nBase < m_vColl.size() && m_vColl[rSI.m_nBase].HasWW8OutlineLevel()) { if (rSI.m_nLFOIndex == USHRT_MAX) -- cgit