diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2020-12-11 17:44:34 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2020-12-11 21:25:10 +0100 |
commit | 35e471bb4d1388cf5afcdcee214cf5111edf44e3 (patch) | |
tree | bb78f4f13f131f0cb206a9707cc3cfc495a3876a /include/i18nlangtag | |
parent | align anchor south-west to dropdown north-east (diff) | |
download | core-35e471bb4d1388cf5afcdcee214cf5111edf44e3.tar.gz core-35e471bb4d1388cf5afcdcee214cf5111edf44e3.zip |
Adapt the remaining OUString functions to std string_view
...for LIBO_INTERNAL_ONLY. These had been missed by
1b43cceaea2084a0489db68cd0113508f34b6643 "Make many OUString functions take
std::u16string_view parameters" because they did not match the multi-overload
pattern that was addressed there, but they nevertheless benefit from being
changed just as well (witness e.g. the various resulting changes from copy() to
subView()).
This showed a conversion from OStringChar to std::string_view to be missing
(while the corresponding conversion form OUStringChar to std::u16string_view was
already present).
The improvement to loplugin:stringadd became necessary to fix
> [CPT] compilerplugins/clang/test/stringadd.cxx
> error: 'error' diagnostics expected but not seen:
> File ~/lo/core/compilerplugins/clang/test/stringadd.cxx Line 43 (directive at ~/lo/core/compilerplugins/clang/test/stringadd.cxx:42): simplify by merging with the preceding assignment [loplugin:stringadd]
> File ~/lo/core/compilerplugins/clang/test/stringadd.cxx Line 61 (directive at ~/lo/core/compilerplugins/clang/test/stringadd.cxx:60): simplify by merging with the preceding assignment [loplugin:stringadd]
> 2 errors generated.
Change-Id: Ie40de0616a66e60e289c1af0ca60aed6f9ecc279
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107602
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'include/i18nlangtag')
-rw-r--r-- | include/i18nlangtag/languagetagicu.hxx | 5 | ||||
-rw-r--r-- | include/i18nlangtag/mslangid.hxx | 4 |
2 files changed, 7 insertions, 2 deletions
diff --git a/include/i18nlangtag/languagetagicu.hxx b/include/i18nlangtag/languagetagicu.hxx index e2c9f7ce2b0e..3025734231ad 100644 --- a/include/i18nlangtag/languagetagicu.hxx +++ b/include/i18nlangtag/languagetagicu.hxx @@ -11,6 +11,9 @@ #define INCLUDED_I18NLANGTAG_LANGUAGETAGICU_HXX #include <sal/config.h> + +#include <string_view> + #include <i18nlangtag/i18nlangtagdllapi.h> #include <rtl/ustring.hxx> #include <unicode/locid.h> @@ -46,7 +49,7 @@ public: Always resolves an empty tag to the system locale. */ - static icu::Locale getIcuLocale( const LanguageTag & rLanguageTag, const OUString & rVariant, const OUString & rKeywords); + static icu::Locale getIcuLocale( const LanguageTag & rLanguageTag, std::u16string_view rVariant, std::u16string_view rKeywords); }; #endif // INCLUDED_I18NLANGTAG_LANGUAGETAGICU_HXX diff --git a/include/i18nlangtag/mslangid.hxx b/include/i18nlangtag/mslangid.hxx index fde9087a4f7f..9376458bdf6f 100644 --- a/include/i18nlangtag/mslangid.hxx +++ b/include/i18nlangtag/mslangid.hxx @@ -25,6 +25,8 @@ #include <i18nlangtag/i18nlangtagdllapi.h> #include <i18nlangtag/lang.h> #include <com/sun/star/lang/Locale.hpp> + +#include <string_view> #include <vector> struct IsoLanguageCountryEntry; @@ -251,7 +253,7 @@ public: /** Used by convertUnxByteStringToLanguage(OString) */ I18NLANGTAG_DLLPRIVATE static LanguageType convertIsoNamesToLanguage( - const OString& rLang, const OString& rCountry ); + std::string_view rLang, std::string_view rCountry ); /** Used by lookupFallbackLocale(Locale) */ |