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 <jluth@mail.com>
diff --git a/editeng/source/items/numitem.cxx b/editeng/source/items/numitem.cxx
index cbbd7ef..1239ea5 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