editeng/source/items/numitem.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
New commits: commit a94db2e3b6e130fe90de31cbd909ce54f5450601 Author: Justin Luth <[email protected]> AuthorDate: Sat May 18 11:36:24 2024 -0400 Commit: Justin Luth <[email protected]> CommitDate: Mon May 20 15:40:58 2024 +0200 tdf#156105 sw: make SvxNumberFormat GetPrefix/Suffix more trustworthy As soon as SetPrefix or SetSuffix are called, any partially formed sListFormat is invalid (unless nothing changed). ListFormat creates sPrefix/sSuffix as a convenience/compat item, and changing it directly is NOT reflected in the sListFormat itself. Trying to keep them in sync would be very complicated. Any process that uses these functions OUGHT TO be doing it as building blocks to eventually call SetListFormat(prefix, suffix, lvl), at which point a proper sListFormat will be created. Change-Id: I05f681c812ea5207cb8127b30dafbd543ffea219 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167832 Reviewed-by: Justin Luth <[email protected]> Tested-by: Jenkins Reviewed-by: Vasily Melenchuk <[email protected]> diff --git a/editeng/source/items/numitem.cxx b/editeng/source/items/numitem.cxx index 0d677dfc6696..f0fe0085e157 100644 --- a/editeng/source/items/numitem.cxx +++ b/editeng/source/items/numitem.cxx @@ -571,7 +571,7 @@ OUString SvxNumberFormat::CreateRomanString( sal_Int32 nNo, bool bUpper ) void SvxNumberFormat::SetPrefix(const OUString& rSet) { // ListFormat manages the prefix. If badly changed via this function, sListFormat is invalidated - if (sListFormat && rSet.getLength() != sPrefix.getLength()) + if (sListFormat) sListFormat.reset(); sPrefix = rSet; @@ -580,7 +580,7 @@ void SvxNumberFormat::SetPrefix(const OUString& rSet) void SvxNumberFormat::SetSuffix(const OUString& rSet) { // ListFormat manages the suffix. If badly changed via this function, sListFormat is invalidated - if (sListFormat && rSet.getLength() != sSuffix.getLength()) + if (sListFormat) sListFormat.reset(); sSuffix = rSet;
