diff options
author | Eike Rathke <erack@redhat.com> | 2018-06-27 17:26:23 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2018-06-27 20:08:08 +0200 |
commit | d9388ab070ff99055650bf54b0e683a4be9bcdc9 (patch) | |
tree | 03d1efe781a1b6a8ede3de9fd23c77bd06ea4a01 /i18npool/source/nativenumber | |
parent | 40e5ad1179ab97577dd4305c36820f8b6a23d17d (diff) |
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>
Diffstat (limited to 'i18npool/source/nativenumber')
-rw-r--r-- | i18npool/source/nativenumber/nativenumbersupplier.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/i18npool/source/nativenumber/nativenumbersupplier.cxx b/i18npool/source/nativenumber/nativenumbersupplier.cxx index d9bff101a08c..869ff60df4aa 100644 --- a/i18npool/source/nativenumber/nativenumbersupplier.cxx +++ b/i18npool/source/nativenumber/nativenumbersupplier.cxx @@ -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: |