sw/qa/extras/ooxmlexport/ooxmlexport16.cxx | 12 ++++++++++++ writerfilter/source/dmapper/DomainMapper_Impl.cxx | 7 ++++--- 2 files changed, 16 insertions(+), 3 deletions(-)
New commits: commit a45876adc36a3764cfeadb1737e5dcfb7ffee9da Author: Justin Luth <justin_l...@sil.org> AuthorDate: Fri Apr 30 13:25:54 2021 +0200 Commit: Justin Luth <justin_l...@sil.org> CommitDate: Fri Jul 9 07:24:16 2021 +0200 tdf#141964 writerfilter CN: listLevel 9 means no numbering and so does numId 0. Wow - this is REALLY FUNDAMENTAL stuff, and we weren't handling it? Did anyone look at any of the specs when they were implementing import of numbering? Change-Id: I3ea20baccfae34751328558a873ccdcfda0de0a2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115258 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_l...@sil.org> diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx index 7ef26bb13b4c..c65e59e2ff78 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx @@ -168,6 +168,18 @@ DECLARE_OOXMLEXPORT_TEST(testTdf141966_chapterNumberTortureTest, "tdf141966_chap // 2nd.iii in MS Word 2003. 2nd.ii in MS Word 2010/2016 where para5 is not numbered. Why not? CPPUNIT_ASSERT_EQUAL(OUString("2nd.iii"), getProperty<OUString>(xPara, "ListLabelString")); CPPUNIT_ASSERT_EQUAL(sal_Int16(1), getProperty<sal_Int16>(xPara, "NumberingLevel")); // Level 2 + + xPara.set(getParagraph(9, "outline with Body listLvl(9)."), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString(""), getProperty<OUString>(xPara, "ListLabelString")); + + xPara.set(getParagraph(10, "outline with Body listLvl(9) #2."), uno::UNO_QUERY); + 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")); + + xPara.set(getParagraph(13, "Style numId0 cancels inherited numbering."), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString(""), getProperty<OUString>(xPara, "ListLabelString")); } DECLARE_OOXMLEXPORT_TEST(testTdf132752, "tdf132752.docx") diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index 74550ec80245..01ea5230ecfa 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -1548,14 +1548,15 @@ void DomainMapper_Impl::finishParagraph( const PropertyMapPtr& pPropertyMap, con if (nListLevel == -1 && nListId > 0) nListLevel = 0; - if ( !bNoNumbering && !isNumberingViaRule && nListLevel >= 0 ) + if (!bNoNumbering && !isNumberingViaRule && nListLevel >= 0 && nListLevel < 9) pParaContext->Insert( PROP_NUMBERING_LEVEL, uno::makeAny(nListLevel), false ); auto const pList(GetListTable()->GetList(nListId)); if (pList && nListId >= 0 && !pParaContext->isSet(PROP_NUMBERING_STYLE_NAME)) { - if ( bNoNumbering ) - pParaContext->Insert( PROP_NUMBERING_STYLE_NAME, uno::makeAny(OUString()) ); + // ListLevel 9 means Body Level/no numbering. numId 0 means no numbering. + if (bNoNumbering || nListLevel == 9 || (!isNumberingViaRule && !nListId)) + pParaContext->Insert(PROP_NUMBERING_STYLE_NAME, uno::makeAny(OUString()), true); else if ( !isNumberingViaRule ) { isNumberingViaStyle = true; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits