[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - i18npool/source

Eike Rathke erack at redhat.com
Thu Jun 28 09:08:08 UTC 2018


 i18npool/source/nativenumber/nativenumbersupplier.cxx |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit e87b6121c5c26bf9d6fd0e29ac7d8480b24d1870
Author: Eike Rathke <erack at redhat.com>
Date:   Wed Jun 27 17:26:23 2018 +0200

    Check string length before copying, tdf#115007 follow-up
    
    Change-Id: I50b842afc505ce603225fb2d25281cc8e9240200
    Reviewed-on: https://gerrit.libreoffice.org/56537
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Eike Rathke <erack at redhat.com>
    (cherry picked from commit d9388ab070ff99055650bf54b0e683a4be9bcdc9)
    Reviewed-on: https://gerrit.libreoffice.org/56540
    Tested-by: Jenkins

diff --git a/i18npool/source/nativenumber/nativenumbersupplier.cxx b/i18npool/source/nativenumber/nativenumbersupplier.cxx
index 8c3698216b81..459d4bc97637 100644
--- a/i18npool/source/nativenumber/nativenumbersupplier.cxx
+++ b/i18npool/source/nativenumber/nativenumbersupplier.cxx
@@ -674,7 +674,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:


More information about the Libreoffice-commits mailing list