Check string length before copying, tdf#115007 follow-up
Change-Id: I50b842afc505ce603225fb2d25281cc8e9240200 Reviewed-on: https://gerrit.libreoffice.org/56537 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
This commit is contained in:
parent
40e5ad1179
commit
d9388ab070
1 changed files with 2 additions and 1 deletions
|
@ -673,7 +673,8 @@ OUString NativeNumberSupplierService::getNativeNumberString(const OUString& aNum
|
|||
switch (Casings[nCasing].eCasing)
|
||||
{
|
||||
case CAPITALIZE:
|
||||
return xCharClass->toTitle(aStr, 0, 1, aLocale) + aStr.copy(1);
|
||||
return xCharClass->toTitle(aStr, 0, 1, aLocale) +
|
||||
(aStr.getLength() > 1 ? aStr.copy(1) : OUString());
|
||||
case UPPER:
|
||||
return xCharClass->toUpper(aStr, 0, aStr.getLength(), aLocale);
|
||||
case TITLE:
|
||||
|
|
Loading…
Reference in a new issue