diff options
author | Vasily Melenchuk <vasily.melenchuk@cib.de> | 2021-09-25 19:06:11 +0300 |
---|---|---|
committer | Vasily Melenchuk <vasily.melenchuk@cib.de> | 2021-10-04 15:29:07 +0200 |
commit | 66a7f8a49d2db1829dd533f32ae5818499f8544b (patch) | |
tree | 8d811e40fc4e9a90c187ea2df55d3017819b658c /sw | |
parent | 1ecc5d98aefbf1779d157aee80308d26ff28458a (diff) |
tdf#144609: numbering "None" should still show prefix/suffix
Unlike it was implemented in tdf#143605, prefix and suffix
should be displayed anyway, we do not display only numbers.
Moreover tdf#143605 did accidentally fix tdf#135164
in a invalid way. So this patch is also providing a better
fix for it: untittest is already created and failing without it.
Problem in tdf#135164 is inability to distingush missing level
text (bullet char in given case) and empty ("") one. In first
case we should use abstract level definition. In second - not.
Change-Id: Ica3a714d22de4d2f14ebbcb12f0e1311dbc9b801
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122609
Tested-by: Jenkins
Reviewed-by: Vasily Melenchuk <vasily.melenchuk@cib.de>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/odfexport/odfexport2.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/doc/number.cxx | 9 |
2 files changed, 7 insertions, 6 deletions
diff --git a/sw/qa/extras/odfexport/odfexport2.cxx b/sw/qa/extras/odfexport/odfexport2.cxx index c73dc611db04..28d0cd873944 100644 --- a/sw/qa/extras/odfexport/odfexport2.cxx +++ b/sw/qa/extras/odfexport/odfexport2.cxx @@ -81,8 +81,8 @@ DECLARE_ODFEXPORT_TEST(testTdf137199, "tdf137199.docx") DECLARE_ODFEXPORT_TEST(testTdf143605, "tdf143605.odt") { CPPUNIT_ASSERT_EQUAL(1, getPages()); - // With numbering type "none" there should be nothing - CPPUNIT_ASSERT_EQUAL(OUString(""), getProperty<OUString>(getParagraph(1), "ListLabelString")); + // With numbering type "none" there should be just prefix & suffix + CPPUNIT_ASSERT_EQUAL(OUString("."), getProperty<OUString>(getParagraph(1), "ListLabelString")); } DECLARE_ODFEXPORT_TEST(testListFormatDocx, "listformat.docx") diff --git a/sw/source/core/doc/number.cxx b/sw/source/core/doc/number.cxx index 6884418752ad..2f4cdf32b304 100644 --- a/sw/source/core/doc/number.cxx +++ b/sw/source/core/doc/number.cxx @@ -656,9 +656,6 @@ OUString SwNumRule::MakeNumString( const SwNumberTree::tNumberVector & rNumVecto const SwNumFormat& rMyNFormat = Get( o3tl::narrowing<sal_uInt16>(nLevel) ); - if (rMyNFormat.GetNumberingType() == SVX_NUM_NUMBER_NONE) - return OUString(); - css::lang::Locale aLocale( LanguageTag::convertToLocale(nLang)); if (rMyNFormat.HasListFormat()) @@ -670,7 +667,11 @@ OUString SwNumRule::MakeNumString( const SwNumberTree::tNumberVector & rNumVecto for (SwNumberTree::tNumberVector::size_type i=0; i <= nLevel; ++i) { OUString sReplacement; - if (rNumVector[i]) + if (rMyNFormat.GetNumberingType() == SVX_NUM_NUMBER_NONE) + { + // Numbering disabled - replacement is empty + } + else if (rNumVector[i]) { if (bOnlyArabic) sReplacement = OUString::number(rNumVector[i]); |