summaryrefslogtreecommitdiff
path: root/sw/source/core
diff options
context:
space:
mode:
authorVasily Melenchuk <vasily.melenchuk@cib.de>2020-05-17 13:35:46 +0300
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2020-06-12 01:13:55 +0200
commit129006ee5bec721bfb8bae9cd55586b353e230b7 (patch)
treeb4751962829a7a7dcdea51786a33af2a83d8cd99 /sw/source/core
parent0d97bcee3505cf70828aaf4f053c079127b7f94d (diff)
tdf#120394: DOCX list import: simplify zero width space hack
Since introducion of list format string hack with creation of zero-width-space can be much more simple. It was being used to indicate existing, but empty list label suffix to avoid stripping down numbering. Change-Id: I9a0c6047f806b2c656ef5dbab0c6b38200818bd2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94383 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95346
Diffstat (limited to 'sw/source/core')
-rw-r--r--sw/source/core/doc/number.cxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/sw/source/core/doc/number.cxx b/sw/source/core/doc/number.cxx
index 481ebfada8eb..c636273e6f54 100644
--- a/sw/source/core/doc/number.cxx
+++ b/sw/source/core/doc/number.cxx
@@ -664,6 +664,13 @@ OUString SwNumRule::MakeNumString( const SwNumberTree::tNumberVector & rNumVecto
if (nPosition >= 0)
sLevelFormat = sLevelFormat.replaceAt(nPosition, sFind.getLength(), sReplacement);
}
+
+ // As a fallback: caller code expects nonempty string as a result.
+ // But if we have empty string (and had no errors before) this is valid result.
+ // So use classical hack with zero-width-space as a string filling.
+ if (sLevelFormat.isEmpty())
+ sLevelFormat = OUStringChar(CHAR_ZWSP);
+
aStr = sLevelFormat;
}
else