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 --- comphelper/source/misc/sequenceashashmap.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'comphelper') diff --git a/comphelper/source/misc/sequenceashashmap.cxx b/comphelper/source/misc/sequenceashashmap.cxx index 21a7f0971b94..0f15823651f9 100644 --- a/comphelper/source/misc/sequenceashashmap.cxx +++ b/comphelper/source/misc/sequenceashashmap.cxx @@ -80,7 +80,7 @@ uno::Any jsonToUnoAny(const boost::property_tree::ptree& aTree) else if (aTypeClass == uno::TypeClass_SHORT) aAny <<= static_cast(o3tl::toInt32(rValue)); else if (aTypeClass == uno::TypeClass_UNSIGNED_SHORT) - aAny <<= static_cast(OString(rValue.c_str()).toUInt32()); + aAny <<= static_cast(o3tl::toUInt32(rValue)); else if (aTypeClass == uno::TypeClass_LONG) aAny <<= o3tl::toInt32(rValue); else if (aTypeClass == uno::TypeClass_UNSIGNED_LONG) @@ -331,7 +331,7 @@ std::vector JsonToPropertyValues(const OString& rJson else if (rType == "short") aValue.Value <<= sal_Int16(o3tl::toInt32(rValue)); else if (rType == "unsigned short") - aValue.Value <<= sal_uInt16(OString(rValue.c_str()).toUInt32()); + aValue.Value <<= sal_uInt16(o3tl::toUInt32(rValue)); else if (rType == "int64") aValue.Value <<= o3tl::toInt64(rValue); else if (rType == "int32") @@ -341,9 +341,9 @@ std::vector JsonToPropertyValues(const OString& rJson else if (rType == "uint64") aValue.Value <<= OString(rValue.c_str()).toUInt64(); else if (rType == "uint32") - aValue.Value <<= OString(rValue.c_str()).toUInt32(); + aValue.Value <<= o3tl::toUInt32(rValue); else if (rType == "uint16") - aValue.Value <<= sal_uInt16(OString(rValue.c_str()).toUInt32()); + aValue.Value <<= sal_uInt16(o3tl::toUInt32(rValue)); else if (rType == "[]byte") { aNodeValue = rPair.second.get_child("value", aNodeNull); -- cgit