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 <jluth@mail.com>
Tested-by: Jenkins
Reviewed-by: Vasily Melenchuk <vasily.melenchuk@cib.de>
diff --git a/editeng/source/items/numitem.cxx b/editeng/source/items/numitem.cxx
index 0d677df..f0fe008 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;