Related: tdf#128314 Add NatNum12 modifier 'lower' attribute

Similar to capitalize, upper and title.

Change-Id: I5933362e69ebbc3cf31de4258aceec5677b76653
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115640
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
This commit is contained in:
Eike Rathke
2021-05-15 00:48:32 +02:00
parent eb7a2bd2f1
commit e8c373d1da

View File

@@ -637,12 +637,13 @@ OUString NativeNumberSupplierService::getNativeNumberString(const OUString& aNum
if (nNativeNumberMode == NativeNumberMode::NATNUM12)
{
// handle capitalization prefixes "capitalize", "upper" and "title"
// handle capitalization prefixes "capitalize", "upper", "lower" and "title"
enum WhichCasing
{
CAPITALIZE,
UPPER,
LOWER,
TITLE
};
@@ -656,6 +657,7 @@ OUString NativeNumberSupplierService::getNativeNumberString(const OUString& aNum
{
{ std::u16string_view(u"capitalize"), CAPITALIZE },
{ std::u16string_view(u"upper"), UPPER },
{ std::u16string_view(u"lower"), LOWER },
{ std::u16string_view(u"title"), TITLE }
};
@@ -685,6 +687,8 @@ OUString NativeNumberSupplierService::getNativeNumberString(const OUString& aNum
(aStr.getLength() > 1 ? aStr.copy(1) : OUString());
case UPPER:
return xCharClass->toUpper(aStr, 0, aStr.getLength(), aLocale);
case LOWER:
return xCharClass->toLower(aStr, 0, aStr.getLength(), aLocale);
case TITLE:
return xCharClass->toTitle(aStr, 0, aStr.getLength(), aLocale);
}