diff options
author | Vasily Melenchuk <vasily.melenchuk@cib.de> | 2020-05-15 18:17:34 +0300 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2020-05-17 03:06:52 +0200 |
commit | d8329149394e4e5758a9e293b0162db050379a4e (patch) | |
tree | 33b5c6c7e8e5bdaee7744de3556bc4611fea51e3 /sw/source | |
parent | 047de8a887628dc45d5b8df7b297abd6fa2fafc5 (diff) |
tdf#120394: list format string can be empty
We need to distunguish when we have list format string, but it
is empty (no level text will be diplayed) or it does not exist
at all, so we need to fallback to old prefix-suffix syntax.
Change-Id: Ifd4ccd5a676db86c39d2ef48e91d191d92b9b2a0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94322
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/core/doc/number.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/unocore/unosett.cxx | 7 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtw8num.cxx | 2 |
3 files changed, 7 insertions, 6 deletions
diff --git a/sw/source/core/doc/number.cxx b/sw/source/core/doc/number.cxx index 0c7810f058f4..fa58d9ed789f 100644 --- a/sw/source/core/doc/number.cxx +++ b/sw/source/core/doc/number.cxx @@ -644,9 +644,9 @@ OUString SwNumRule::MakeNumString( const SwNumberTree::tNumberVector & rNumVecto { css::lang::Locale aLocale( LanguageTag::convertToLocale(nLang)); - OUString sLevelFormat = rMyNFormat.GetListFormat(); - if (!sLevelFormat.isEmpty()) + if (rMyNFormat.HasListFormat()) { + OUString sLevelFormat = rMyNFormat.GetListFormat(); // In this case we are ignoring GetIncludeUpperLevels: we put all // level numbers requested by level format for (SwNumberTree::tNumberVector::size_type i=0; i <= nLevel; ++i) diff --git a/sw/source/core/unocore/unosett.cxx b/sw/source/core/unocore/unosett.cxx index ebffc9ae2852..817938749bf7 100644 --- a/sw/source/core/unocore/unosett.cxx +++ b/sw/source/core/unocore/unosett.cxx @@ -1335,11 +1335,12 @@ uno::Sequence<beans::PropertyValue> SwXNumberingRules::GetPropertiesForNumFormat aPropertyValues.push_back(comphelper::makePropertyValue("Suffix", aUString)); //listformat - aUString = rFormat.GetListFormat(); - aPropertyValues.push_back(comphelper::makePropertyValue("ListFormat", aUString)); + if (rFormat.HasListFormat()) + { + aPropertyValues.push_back(comphelper::makePropertyValue("ListFormat", rFormat.GetListFormat())); + } //char style name - aUString.clear(); SwStyleNameMapper::FillProgName( rCharFormatName, aUString, SwGetPoolIdFromName::ChrFmt); aPropertyValues.push_back(comphelper::makePropertyValue("CharStyleName", aUString)); diff --git a/sw/source/filter/ww8/wrtw8num.cxx b/sw/source/filter/ww8/wrtw8num.cxx index ca3a026f2323..e2aad33206d3 100644 --- a/sw/source/filter/ww8/wrtw8num.cxx +++ b/sw/source/filter/ww8/wrtw8num.cxx @@ -494,7 +494,7 @@ void MSWordExportBase::NumberingLevel( const vcl::Font* pBulletFont=nullptr; rtl_TextEncoding eChrSet=0; FontFamily eFamily=FAMILY_DECORATIVE; - if (!rRule.Get(nLvl).GetListFormat().isEmpty()) + if (rRule.Get(nLvl).HasListFormat()) { // Nothing to construct: we have it already sNumStr = rRule.Get(nLvl).GetListFormat(); |