From 116b9d6ddf2b61186b29f0370234eec9c1bbe306 Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Sun, 2 Apr 2023 01:18:42 +0300 Subject: Avoid conversions between OUString and OString in VCL Standardize on OUString, which is the main internal string class. Convert from/to OUString only when communicating with respective external APIs. Removes about 200 conversions from the code. Change-Id: I96ecee7c6fd271bb76639220e96d69d2964bed26 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149930 Tested-by: Jenkins Reviewed-by: Mike Kaganski --- vcl/source/app/svdata.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'vcl/source/app/svdata.cxx') diff --git a/vcl/source/app/svdata.cxx b/vcl/source/app/svdata.cxx index febed41cb98c..ac1fd6b2c623 100644 --- a/vcl/source/app/svdata.cxx +++ b/vcl/source/app/svdata.cxx @@ -22,6 +22,7 @@ #include #include #include +#include #include #include @@ -280,12 +281,12 @@ const FieldUnitStringList& ImplGetFieldUnits() namespace vcl { - FieldUnit EnglishStringToMetric(std::string_view rEnglishMetricString) + FieldUnit EnglishStringToMetric(std::u16string_view rEnglishMetricString) { sal_uInt32 nUnits = SAL_N_ELEMENTS(SV_FUNIT_STRINGS); for (sal_uInt32 i = 0; i < nUnits; ++i) { - if (rEnglishMetricString == SV_FUNIT_STRINGS[i].first.mpId) + if (o3tl::equalsAscii(rEnglishMetricString, SV_FUNIT_STRINGS[i].first.mpId)) return SV_FUNIT_STRINGS[i].second; } return FieldUnit::NONE; -- cgit