diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-04-26 13:27:39 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-04-26 19:37:20 +0200 |
commit | 5fe702f1b69a02a274621a01db68256a94edfd36 (patch) | |
tree | 8b07b80a9046040ba7da685e4063f5f21e1f0eaa /i18nutil | |
parent | cf2dc247ff5f726238856e9b46a4926a30430e14 (diff) |
add o3tl::toUInt32
Change-Id: I07f11bf12fbe1d1c2d812fa0965d6e632e1e1aba
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133437
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'i18nutil')
-rw-r--r-- | i18nutil/source/utility/unicode.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/i18nutil/source/utility/unicode.cxx b/i18nutil/source/utility/unicode.cxx index be34ea58f44a..5e479989eae9 100644 --- a/i18nutil/source/utility/unicode.cxx +++ b/i18nutil/source/utility/unicode.cxx @@ -26,6 +26,7 @@ #include <unicode/numfmt.h> #include "unicode_data.h" #include <rtl/character.hxx> +#include <o3tl/string_view.hxx> #include <memory> // Workaround for glibc braindamage: @@ -1019,7 +1020,7 @@ OUString ToggleUnicodeCodepoint::StringToReplace() sIn = maInput.toString(); while( nUPlus != -1 ) { - nUnicode = sIn.copy(0, nUPlus).toUInt32(16); + nUnicode = o3tl::toUInt32(sIn.subView(0, nUPlus), 16); //prevent creating control characters or invalid Unicode values if( !rtl::isUnicodeCodePoint(nUnicode) || nUnicode < 0x20 ) maInput = sIn.subView(nUPlus); @@ -1062,7 +1063,7 @@ OUString ToggleUnicodeCodepoint::ReplacementString() } while( nUPlus > 0 ) { - nUnicode = sIn.copy(0, nUPlus).toUInt32(16); + nUnicode = o3tl::toUInt32(sIn.subView(0, nUPlus), 16); output.appendUtf32( nUnicode ); sIn = sIn.copy(nUPlus+2); |