diff options
author | Justin Luth <justin_luth@sil.org> | 2021-06-23 09:21:32 +0200 |
---|---|---|
committer | Justin Luth <justin_luth@sil.org> | 2021-06-24 19:21:24 +0200 |
commit | 8bfa14e831f31f372b98d7283fa4abc73bcb5532 (patch) | |
tree | bbc3223c39f32d5eb234c0daf6f198062aa60f1c | |
parent | f446a203fa2897bab8ae7686c948a8bf060675c6 (diff) |
tdf#104239 doc import: accept outlineLvl0 == (listLvl = MAXLEVEL)
If listLvl is undefined, it is treated as level 0,
so when testing that outlineLvl is equal to listLvl,
then consider MAXLEVEL to be equivalent to zero.
The opposite is not true. An undefined outlineLvl
is not considered to be level 0.
This doesn't fix bug 104239, but it is one step
in the right direction.
Two unit tests followed this path,
(transparent-text.doc and tdf80635_pageLeft.doc)
but neither one sets a numbering style,
so they don't make good unit tests.
Change-Id: I62cd7f5500fcd6dc06327900c33f12c129610a04
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117745
Tested-by: Jenkins
Reviewed-by: Justin Luth <justin_luth@sil.org>
-rw-r--r-- | sw/qa/extras/ww8export/data/tdf104239_sharedOutlineNumId.doc | bin | 0 -> 33280 bytes | |||
-rw-r--r-- | sw/qa/extras/ww8export/ww8export3.cxx | 8 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par.cxx | 3 |
3 files changed, 10 insertions, 1 deletions
diff --git a/sw/qa/extras/ww8export/data/tdf104239_sharedOutlineNumId.doc b/sw/qa/extras/ww8export/data/tdf104239_sharedOutlineNumId.doc Binary files differnew file mode 100644 index 000000000000..c5deb4857f9c --- /dev/null +++ b/sw/qa/extras/ww8export/data/tdf104239_sharedOutlineNumId.doc diff --git a/sw/qa/extras/ww8export/ww8export3.cxx b/sw/qa/extras/ww8export/ww8export3.cxx index 2ecde65c6bfb..77c090f1f22d 100644 --- a/sw/qa/extras/ww8export/ww8export3.cxx +++ b/sw/qa/extras/ww8export/ww8export3.cxx @@ -813,6 +813,14 @@ DECLARE_WW8EXPORT_TEST(testTdf106541_inheritOutlineNumbering, "tdf106541_inherit CPPUNIT_ASSERT_EQUAL(OUString("1.1"), getProperty<OUString>(xPara, "ListLabelString")); } +DECLARE_WW8EXPORT_TEST(testTdf104239_sharedOutlineNumId, "tdf104239_sharedOutlineNumId.doc") +{ + // The list should show both level 1 and level 2 digits. It really ought to be "2.1." + uno::Reference<beans::XPropertySet> xPara(getParagraph(5, "Principes"), uno::UNO_QUERY); + // This was ".1." previously. + CPPUNIT_ASSERT(3 < getProperty<OUString>(xPara, "ListLabelString").getLength()); +} + 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 9721a3f8cf4d..d4c2ddc62cd6 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -6004,9 +6004,10 @@ void SwWW8ImplReader::SetOutlineStyles() continue; } + const sal_uInt8 nLvl = pStyleInf->m_nListLevel == MAXLEVEL ? 0 : pStyleInf->m_nListLevel; if (m_pChosenWW8OutlineStyle != nullptr && pStyleInf->mnWW8OutlineLevel < WW8ListManager::nMaxLevel - && pStyleInf->mnWW8OutlineLevel == pStyleInf->m_nListLevel) + && pStyleInf->mnWW8OutlineLevel == nLvl) { // LibreOffice's Chapter Numbering only works when outlineLevel == listLevel const SwNumFormat& rRule |