diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2020-08-27 11:40:59 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2020-08-28 08:07:09 +0200 |
commit | 33ecd0d5c4fff9511a8436513936a3f7044a775a (patch) | |
tree | c25809adda140ff89d9f2a2b6dfadba17e188fb0 /unotools | |
parent | 554834484a3323f73b5aeace246bcd9635368967 (diff) |
Change OUStringLiteral from char[] to char16_t[]
This is a prerequisite for making conversion from OUStringLiteral to OUString
more efficient at least for C++20 (by replacing its internals with a constexpr-
generated sal_uString-compatible layout with a SAL_STRING_STATIC_FLAG refCount,
conditionally for C++20 for now).
For a configure-wise bare-bones build on Linux, size reported by `du -bs
instdir` grew by 118792 bytes from 1155636636 to 1155755428.
In most places just a u"..." string literal prefix had to be added. In some
places
char const a[] = "...";
variables have been changed to char16_t, and a few places required even further
changes to code (which prompted the addition of include/o3tl/string_view.hxx
helper function o3tl::equalsIgnoreAsciiCase and the additional
OUString::createFromAscii overload).
For all uses of macros expanding to string literals, the relevant uses have been
rewritten as
u"" MACRO
instead of changing the macro definitions. It should be possible to change at
least some of those macro definitions (and drop the u"" from their call sites)
in follow-up commits.
Change-Id: Iec4ef1a057d412d22443312d40c6a8a290dc6144
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101483
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'unotools')
-rw-r--r-- | unotools/source/config/optionsdlg.cxx | 2 | ||||
-rw-r--r-- | unotools/source/misc/wincodepage.cxx | 140 |
2 files changed, 71 insertions, 71 deletions
diff --git a/unotools/source/config/optionsdlg.cxx b/unotools/source/config/optionsdlg.cxx index 18cd92386f03..f5f453f160e7 100644 --- a/unotools/source/config/optionsdlg.cxx +++ b/unotools/source/config/optionsdlg.cxx @@ -44,7 +44,7 @@ class SvtOptionsDlgOptions_Impl : public utl::ConfigItem private: typedef std::unordered_map< OUString, bool > OptionNodeList; - static constexpr OUStringLiteral g_sPathDelimiter = "/"; + static constexpr OUStringLiteral g_sPathDelimiter = u"/"; OptionNodeList m_aOptionNodeList; enum NodeType{ NT_Group, NT_Page, NT_Option }; diff --git a/unotools/source/misc/wincodepage.cxx b/unotools/source/misc/wincodepage.cxx index 1fefabecb049..da7e584aed71 100644 --- a/unotools/source/misc/wincodepage.cxx +++ b/unotools/source/misc/wincodepage.cxx @@ -24,37 +24,37 @@ rtl_TextEncoding impl_getWinTextEncodingFromLangStrANSI(const OUString& sLanguag { static constexpr LangEncodingDef aLanguageTab[] = { - { "en", RTL_TEXTENCODING_MS_1252 }, // Most used -> first in list - { "th", RTL_TEXTENCODING_MS_874 }, - { "ja", RTL_TEXTENCODING_MS_932 }, - { "zh-cn", RTL_TEXTENCODING_MS_936 }, // Chinese (simplified) - must go before "zh" - { "ko", RTL_TEXTENCODING_MS_949 }, - { "zh", RTL_TEXTENCODING_MS_950 }, // Chinese (traditional) - { "bs", RTL_TEXTENCODING_MS_1250 }, - { "cs", RTL_TEXTENCODING_MS_1250 }, - { "hr", RTL_TEXTENCODING_MS_1250 }, - { "hu", RTL_TEXTENCODING_MS_1250 }, - { "pl", RTL_TEXTENCODING_MS_1250 }, - { "ro", RTL_TEXTENCODING_MS_1250 }, - { "sk", RTL_TEXTENCODING_MS_1250 }, - { "sl", RTL_TEXTENCODING_MS_1250 }, + { u"en", RTL_TEXTENCODING_MS_1252 }, // Most used -> first in list + { u"th", RTL_TEXTENCODING_MS_874 }, + { u"ja", RTL_TEXTENCODING_MS_932 }, + { u"zh-cn", RTL_TEXTENCODING_MS_936 }, // Chinese (simplified) - must go before "zh" + { u"ko", RTL_TEXTENCODING_MS_949 }, + { u"zh", RTL_TEXTENCODING_MS_950 }, // Chinese (traditional) + { u"bs", RTL_TEXTENCODING_MS_1250 }, + { u"cs", RTL_TEXTENCODING_MS_1250 }, + { u"hr", RTL_TEXTENCODING_MS_1250 }, + { u"hu", RTL_TEXTENCODING_MS_1250 }, + { u"pl", RTL_TEXTENCODING_MS_1250 }, + { u"ro", RTL_TEXTENCODING_MS_1250 }, + { u"sk", RTL_TEXTENCODING_MS_1250 }, + { u"sl", RTL_TEXTENCODING_MS_1250 }, // { "sr", RTL_TEXTENCODING_MS_1250 }, - { "sq", RTL_TEXTENCODING_MS_1250 }, - { "be", RTL_TEXTENCODING_MS_1251 }, - { "bg", RTL_TEXTENCODING_MS_1251 }, - { "mk", RTL_TEXTENCODING_MS_1251 }, - { "ru", RTL_TEXTENCODING_MS_1251 }, - { "sr", RTL_TEXTENCODING_MS_1251 }, - { "uk", RTL_TEXTENCODING_MS_1251 }, - { "es", RTL_TEXTENCODING_MS_1252 }, - { "el", RTL_TEXTENCODING_MS_1253 }, - { "tr", RTL_TEXTENCODING_MS_1254 }, - { "he", RTL_TEXTENCODING_MS_1255 }, - { "ar", RTL_TEXTENCODING_MS_1256 }, - { "et", RTL_TEXTENCODING_MS_1257 }, - { "lt", RTL_TEXTENCODING_MS_1257 }, - { "lv", RTL_TEXTENCODING_MS_1257 }, - { "vi", RTL_TEXTENCODING_MS_1258 }, + { u"sq", RTL_TEXTENCODING_MS_1250 }, + { u"be", RTL_TEXTENCODING_MS_1251 }, + { u"bg", RTL_TEXTENCODING_MS_1251 }, + { u"mk", RTL_TEXTENCODING_MS_1251 }, + { u"ru", RTL_TEXTENCODING_MS_1251 }, + { u"sr", RTL_TEXTENCODING_MS_1251 }, + { u"uk", RTL_TEXTENCODING_MS_1251 }, + { u"es", RTL_TEXTENCODING_MS_1252 }, + { u"el", RTL_TEXTENCODING_MS_1253 }, + { u"tr", RTL_TEXTENCODING_MS_1254 }, + { u"he", RTL_TEXTENCODING_MS_1255 }, + { u"ar", RTL_TEXTENCODING_MS_1256 }, + { u"et", RTL_TEXTENCODING_MS_1257 }, + { u"lt", RTL_TEXTENCODING_MS_1257 }, + { u"lv", RTL_TEXTENCODING_MS_1257 }, + { u"vi", RTL_TEXTENCODING_MS_1258 }, }; for (auto& def : aLanguageTab) @@ -74,47 +74,47 @@ rtl_TextEncoding impl_getWinTextEncodingFromLangStrOEM(const OUString& sLanguage { static constexpr LangEncodingDef aLanguageTab[] = { - { "de", RTL_TEXTENCODING_IBM_437 }, // OEM United States - { "en-us", RTL_TEXTENCODING_IBM_437 }, // OEM United States - { "fi", RTL_TEXTENCODING_IBM_437 }, // OEM United States - { "fr-ca", RTL_TEXTENCODING_IBM_863 }, // OEM French Canadian; French Canadian (DOS) - { "fr", RTL_TEXTENCODING_IBM_437 }, // OEM United States - { "it", RTL_TEXTENCODING_IBM_437 }, // OEM United States - { "nl", RTL_TEXTENCODING_IBM_437 }, // OEM United States - { "sv", RTL_TEXTENCODING_IBM_437 }, // OEM United States - { "el", RTL_TEXTENCODING_IBM_737 }, // OEM Greek (formerly 437G); Greek (DOS) - { "et", RTL_TEXTENCODING_IBM_775 }, // OEM Baltic; Baltic (DOS) - { "lt", RTL_TEXTENCODING_IBM_775 }, // OEM Baltic; Baltic (DOS) - { "lv", RTL_TEXTENCODING_IBM_775 }, // OEM Baltic; Baltic (DOS) - { "en", RTL_TEXTENCODING_IBM_850 }, // OEM Multilingual Latin 1; Western European (DOS) - { "bs", RTL_TEXTENCODING_IBM_852 }, // OEM Latin 2; Central European (DOS) - { "cs", RTL_TEXTENCODING_IBM_852 }, // OEM Latin 2; Central European (DOS) - { "hr", RTL_TEXTENCODING_IBM_852 }, // OEM Latin 2; Central European (DOS) - { "hu", RTL_TEXTENCODING_IBM_852 }, // OEM Latin 2; Central European (DOS) - { "pl", RTL_TEXTENCODING_IBM_852 }, // OEM Latin 2; Central European (DOS) - { "ro", RTL_TEXTENCODING_IBM_852 }, // OEM Latin 2; Central European (DOS) - { "sk", RTL_TEXTENCODING_IBM_852 }, // OEM Latin 2; Central European (DOS) - { "sl", RTL_TEXTENCODING_IBM_852 }, // OEM Latin 2; Central European (DOS) + { u"de", RTL_TEXTENCODING_IBM_437 }, // OEM United States + { u"en-us", RTL_TEXTENCODING_IBM_437 }, // OEM United States + { u"fi", RTL_TEXTENCODING_IBM_437 }, // OEM United States + { u"fr-ca", RTL_TEXTENCODING_IBM_863 }, // OEM French Canadian; French Canadian (DOS) + { u"fr", RTL_TEXTENCODING_IBM_437 }, // OEM United States + { u"it", RTL_TEXTENCODING_IBM_437 }, // OEM United States + { u"nl", RTL_TEXTENCODING_IBM_437 }, // OEM United States + { u"sv", RTL_TEXTENCODING_IBM_437 }, // OEM United States + { u"el", RTL_TEXTENCODING_IBM_737 }, // OEM Greek (formerly 437G); Greek (DOS) + { u"et", RTL_TEXTENCODING_IBM_775 }, // OEM Baltic; Baltic (DOS) + { u"lt", RTL_TEXTENCODING_IBM_775 }, // OEM Baltic; Baltic (DOS) + { u"lv", RTL_TEXTENCODING_IBM_775 }, // OEM Baltic; Baltic (DOS) + { u"en", RTL_TEXTENCODING_IBM_850 }, // OEM Multilingual Latin 1; Western European (DOS) + { u"bs", RTL_TEXTENCODING_IBM_852 }, // OEM Latin 2; Central European (DOS) + { u"cs", RTL_TEXTENCODING_IBM_852 }, // OEM Latin 2; Central European (DOS) + { u"hr", RTL_TEXTENCODING_IBM_852 }, // OEM Latin 2; Central European (DOS) + { u"hu", RTL_TEXTENCODING_IBM_852 }, // OEM Latin 2; Central European (DOS) + { u"pl", RTL_TEXTENCODING_IBM_852 }, // OEM Latin 2; Central European (DOS) + { u"ro", RTL_TEXTENCODING_IBM_852 }, // OEM Latin 2; Central European (DOS) + { u"sk", RTL_TEXTENCODING_IBM_852 }, // OEM Latin 2; Central European (DOS) + { u"sl", RTL_TEXTENCODING_IBM_852 }, // OEM Latin 2; Central European (DOS) // { "sr", RTL_TEXTENCODING_IBM_852 }, // OEM Latin 2; Central European (DOS) - { "bg", RTL_TEXTENCODING_IBM_855 }, // OEM Cyrillic (primarily Russian) - { "mk", RTL_TEXTENCODING_IBM_855 }, // OEM Cyrillic (primarily Russian) - { "sr", RTL_TEXTENCODING_IBM_855 }, // OEM Cyrillic (primarily Russian) - { "tr", RTL_TEXTENCODING_IBM_857 }, // OEM Turkish; Turkish (DOS) - { "pt", RTL_TEXTENCODING_IBM_860 }, // OEM Portuguese; Portuguese (DOS) - { "is", RTL_TEXTENCODING_IBM_861 }, // OEM Icelandic; Icelandic (DOS) - { "he", RTL_TEXTENCODING_IBM_862 }, // OEM Hebrew; Hebrew (DOS) - { "ar", RTL_TEXTENCODING_IBM_864 }, // OEM Arabic; Arabic (864) - { "da", RTL_TEXTENCODING_IBM_865 }, // OEM Nordic; Nordic (DOS) - { "nn", RTL_TEXTENCODING_IBM_865 }, // OEM Nordic; Nordic (DOS) - { "be", RTL_TEXTENCODING_IBM_866 }, // OEM Russian; Cyrillic (DOS) - { "ru", RTL_TEXTENCODING_IBM_866 }, // OEM Russian; Cyrillic (DOS) - { "uk", RTL_TEXTENCODING_IBM_866 }, // OEM Russian; Cyrillic (DOS) - { "th", RTL_TEXTENCODING_MS_874 }, // ANSI/OEM Thai (ISO 8859-11); Thai (Windows) - { "ja", RTL_TEXTENCODING_MS_932 }, // ANSI/OEM Japanese; Japanese (Shift-JIS) - { "zh-cn", RTL_TEXTENCODING_MS_936 }, // ANSI/OEM Simplified Chinese (PRC, Singapore); Chinese Simplified (GB2312) - { "ko", RTL_TEXTENCODING_MS_949 }, // ANSI/OEM Korean (Unified Hangul Code) - { "zh", RTL_TEXTENCODING_MS_950 }, // ANSI/OEM Traditional Chinese (Taiwan; Hong Kong SAR, PRC); Chinese Traditional (Big5) - { "vi", RTL_TEXTENCODING_MS_1258 }, // ANSI/OEM Vietnamese; Vietnamese (Windows) + { u"bg", RTL_TEXTENCODING_IBM_855 }, // OEM Cyrillic (primarily Russian) + { u"mk", RTL_TEXTENCODING_IBM_855 }, // OEM Cyrillic (primarily Russian) + { u"sr", RTL_TEXTENCODING_IBM_855 }, // OEM Cyrillic (primarily Russian) + { u"tr", RTL_TEXTENCODING_IBM_857 }, // OEM Turkish; Turkish (DOS) + { u"pt", RTL_TEXTENCODING_IBM_860 }, // OEM Portuguese; Portuguese (DOS) + { u"is", RTL_TEXTENCODING_IBM_861 }, // OEM Icelandic; Icelandic (DOS) + { u"he", RTL_TEXTENCODING_IBM_862 }, // OEM Hebrew; Hebrew (DOS) + { u"ar", RTL_TEXTENCODING_IBM_864 }, // OEM Arabic; Arabic (864) + { u"da", RTL_TEXTENCODING_IBM_865 }, // OEM Nordic; Nordic (DOS) + { u"nn", RTL_TEXTENCODING_IBM_865 }, // OEM Nordic; Nordic (DOS) + { u"be", RTL_TEXTENCODING_IBM_866 }, // OEM Russian; Cyrillic (DOS) + { u"ru", RTL_TEXTENCODING_IBM_866 }, // OEM Russian; Cyrillic (DOS) + { u"uk", RTL_TEXTENCODING_IBM_866 }, // OEM Russian; Cyrillic (DOS) + { u"th", RTL_TEXTENCODING_MS_874 }, // ANSI/OEM Thai (ISO 8859-11); Thai (Windows) + { u"ja", RTL_TEXTENCODING_MS_932 }, // ANSI/OEM Japanese; Japanese (Shift-JIS) + { u"zh-cn", RTL_TEXTENCODING_MS_936 }, // ANSI/OEM Simplified Chinese (PRC, Singapore); Chinese Simplified (GB2312) + { u"ko", RTL_TEXTENCODING_MS_949 }, // ANSI/OEM Korean (Unified Hangul Code) + { u"zh", RTL_TEXTENCODING_MS_950 }, // ANSI/OEM Traditional Chinese (Taiwan; Hong Kong SAR, PRC); Chinese Traditional (Big5) + { u"vi", RTL_TEXTENCODING_MS_1258 }, // ANSI/OEM Vietnamese; Vietnamese (Windows) }; for (auto& def : aLanguageTab) |