summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorJustin Luth <justin_luth@sil.org>2021-06-26 07:52:14 +0200
committerJustin Luth <justin_luth@sil.org>2021-06-28 06:48:30 +0200
commit5f9fb51ba84619c60f304afda76a013a8f3dc14c (patch)
treeff97a734359866512e03d1ccaacf77e55621ea8e /sw
parent3618d847a44bb485a3564c600d5005797934b9bb (diff)
tdf#104239 doc import: listLevel 9 is body text
MS Word formats only have 9 list levels (0-8), and listLevel 9 is used to indicate body-level as a way to cancel the inheritance of a listLevel. LibreOffice however has 10 levels (0-9), so it was treating this as 10th level numbering. Nope - it needs to be no numbering at all. Change-Id: I3fd58ba518ba8bc7d15a08cf896fbeed8e6a38c2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117921 Tested-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Justin Luth <justin_luth@sil.org>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/ww8export/ww8export3.cxx4
-rw-r--r--sw/source/filter/ww8/ww8par3.cxx7
2 files changed, 9 insertions, 2 deletions
diff --git a/sw/qa/extras/ww8export/ww8export3.cxx b/sw/qa/extras/ww8export/ww8export3.cxx
index 1ca05650da55..abbf414dc01d 100644
--- a/sw/qa/extras/ww8export/ww8export3.cxx
+++ b/sw/qa/extras/ww8export/ww8export3.cxx
@@ -842,9 +842,9 @@ DECLARE_WW8EXPORT_TEST(testTdf104239_chapterNumberTortureTest, "tdf104239_chapte
if (!mbExported)
CPPUNIT_ASSERT_EQUAL(OUString(""), getProperty<OUString>(xPara, "ListLabelString"));
xPara.set(getParagraph(11, "direct formatting - Body listLvl(9)."), uno::UNO_QUERY);
- //CPPUNIT_ASSERT_EQUAL(OUString(""), getProperty<OUString>(xPara, "ListLabelString"));
+ CPPUNIT_ASSERT_EQUAL(OUString(""), getProperty<OUString>(xPara, "ListLabelString"));
xPara.set(getParagraph(12, "direct numId, inherit listLvl."), uno::UNO_QUERY);
- //CPPUNIT_ASSERT_EQUAL(OUString("2nd.ii.a.1.I"), getProperty<OUString>(xPara, "ListLabelString"));
+ CPPUNIT_ASSERT_EQUAL(OUString("2nd.ii.a.1.I"), getProperty<OUString>(xPara, "ListLabelString"));
CPPUNIT_ASSERT_EQUAL(sal_Int16(4), getProperty<sal_Int16>(xPara, "NumberingLevel")); // Level 5
xPara.set(getParagraph(13, "Style numId0 cancels inherited numbering."), uno::UNO_QUERY);
CPPUNIT_ASSERT_EQUAL(OUString(""), getProperty<OUString>(xPara, "ListLabelString"));
diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx
index a7a246d4952f..7c33ea08829a 100644
--- a/sw/source/filter/ww8/ww8par3.cxx
+++ b/sw/source/filter/ww8/ww8par3.cxx
@@ -1808,6 +1808,13 @@ void SwWW8ImplReader::RegisterNumFormatOnTextNode(sal_uInt16 nCurrentLFO,
if (!pTextNd)
return;
+ // WW8ListManager::nMaxLevel indicates body text, cancelling an inherited numbering.
+ if (nCurrentLFO < USHRT_MAX && nCurrentLevel == WW8ListManager::nMaxLevel)
+ {
+ pTextNd->SetAttr(SwNumRuleItem(OUString()));
+ return;
+ }
+
// Undefined listLevel is treated as the first level with valid numbering rule.
// TODO:This doesn't allow for inheriting from a style(HOW?), but it matches previous behaviour.
if (nCurrentLFO < USHRT_MAX && nCurrentLevel == MAXLEVEL)