From 5fe702f1b69a02a274621a01db68256a94edfd36 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 26 Apr 2022 13:27:39 +0200 Subject: add o3tl::toUInt32 Change-Id: I07f11bf12fbe1d1c2d812fa0965d6e632e1e1aba Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133437 Tested-by: Jenkins Reviewed-by: Noel Grandin --- i18nutil/source/utility/unicode.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'i18nutil') 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 #include "unicode_data.h" #include +#include #include // 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); -- cgit