tdf#145610: lists should not have includeUpperLevels < 1

Unlike its name, this variable stores *total* amount of levels
to includes, so during conversion even empty list format to
prefix/suffix/includeupperlevels we should keep last one above
zero so list even in future will not have issues with levels
to display.

Change-Id: I4992c1ac0194f381df9f7b965ecdb2d688892b30
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125022
Tested-by: Jenkins
Reviewed-by: Vasily Melenchuk <vasily.melenchuk@cib.de>
This commit is contained in:
Vasily Melenchuk 2021-11-11 10:33:08 +03:00
parent ec1a54ca60
commit a4485bd8e0

View file

@ -640,6 +640,13 @@ void SvxNumberFormat::SetListFormat(std::optional<OUString> oSet)
nPercents++;
}
nInclUpperLevels = nPercents/2;
if (nInclUpperLevels < 1)
{
// There should be always at least one level. This will be not required
// in future (when we get rid of prefix/suffix), but nowadays there
// are too many conversions "list format" <-> "prefix/suffix/inclUpperLevel"
nInclUpperLevels = 1;
}
}
OUString SvxNumberFormat::GetListFormat(bool bIncludePrefixSuffix /*= true*/) const