editeng/source/items/numitem.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
New commits: commit 654454a32bd6dc40d131861fab5dbe0a9111a7c3 Author: Justin Luth <jl...@mail.com> AuthorDate: Mon Aug 1 09:29:10 2022 -0400 Commit: Justin Luth <jl...@mail.com> CommitDate: Mon Aug 1 23:41:54 2022 +0200 related tdf#150197 editeng: clear oListFormat on SetListFormat() Although a pre=existing prefix/suffix was cleared, a non-existing oListFormat should replace an earlier one if it is being reset. The hasValue only applies to setting backward compatiblity stuff. No real-world impact noticed - just cleaning up after a code read. I ALMOST needed this in my prior patch, but then I changed to use the other SetListFormat function call. Change-Id: I39eed26b7720f0f9a0d982a1cd1703a55c5ab986 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137675 Tested-by: Jenkins Reviewed-by: Justin Luth <jl...@mail.com> diff --git a/editeng/source/items/numitem.cxx b/editeng/source/items/numitem.cxx index cbbd7efb9dc4..1239ea529126 100644 --- a/editeng/source/items/numitem.cxx +++ b/editeng/source/items/numitem.cxx @@ -589,13 +589,13 @@ void SvxNumberFormat::SetListFormat(std::optional<OUString> oSet) sPrefix.clear(); sSuffix.clear(); + sListFormat = oSet; + if (!oSet.has_value()) { return; } - sListFormat = oSet; - // For backward compatibility and UI we should create something looking like // a prefix, suffix and included levels also. This is not possible in general case // since level format string is much more flexible. But for most cases is okay