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 /writerperfect | |
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 'writerperfect')
-rw-r--r-- | writerperfect/source/common/WPFTEncodingDialog.cxx | 92 | ||||
-rw-r--r-- | writerperfect/source/writer/exp/xmlimp.cxx | 2 |
2 files changed, 47 insertions, 47 deletions
diff --git a/writerperfect/source/common/WPFTEncodingDialog.cxx b/writerperfect/source/common/WPFTEncodingDialog.cxx index fe812fc71ee2..109b0ef9be73 100644 --- a/writerperfect/source/common/WPFTEncodingDialog.cxx +++ b/writerperfect/source/common/WPFTEncodingDialog.cxx @@ -29,52 +29,52 @@ namespace writerperfect namespace { std::pair<OUStringLiteral, OUStringLiteral> const s_encodings[] - = { { "MacArabic", "Arabic (Apple Macintosh)" }, - { "CP864", "Arabic (DOS/OS2-864)" }, - { "CP1006", "Arabic (IBM-1006)" }, - { "CP1256", "Arabic (Windows-1256)" }, - { "CP775", "Baltic (DOS/OS2-775)" }, - { "CP1257", "Baltic (Windows-1257)" }, - { "MacCeltic", "Celtic (Apple Macintosh)" }, - { "MacCyrillic", "Cyrillic (Apple Macintosh)" }, - { "CP855", "Cyrillic (DOS/OS2-855)" }, - { "CP866", "Cyrillic (DOS/OS2-866/Russian)" }, - { "CP1251", "Cyrillic (Windows-1251)" }, - { "MacCEurope", "Eastern Europe (Apple Macintosh)" }, - { "MacCroatian", "Eastern Europe (Apple Macintosh/Croatian)" }, - { "MacRomanian", "Eastern Europe (Apple Macintosh/Romanian)" }, - { "CP852", "Eastern Europe (DOS/OS2-852)" }, - { "CP1250", "Eastern Europe (Windows-1250/WinLatin 2)" }, - { "MacGreek", "Greek (Apple Macintosh)" }, - { "CP737", "Greek (DOS/OS2-737)" }, - { "CP869", "Greek (DOS/OS2-869/Greek-2)" }, - { "CP875", "Greek (DOS/OS2-875)" }, - { "CP1253", "Greek (Windows-1253)" }, - { "MacHebrew", "Hebrew (Apple Macintosh)" }, - { "CP424", "Hebrew (DOS/OS2-424)" }, - { "CP856", "Hebrew (DOS/OS2-856)" }, - { "CP862", "Hebrew (DOS/OS2-862)" }, - { "CP1255", "Hebrew (Windows-1255)" }, - { "CP500", "International (DOS/OS2-500)" }, - { "CP932", "Japanese (Windows-932)" }, - { "MacThai", "Thai (Apple Macintosh)" }, - { "CP874", "Thai (DOS/OS2-874)" }, - { "CP950", "Traditional Chinese (Windows-950)" }, - { "MacTurkish", "Turkish (Apple Macintosh)" }, - { "CP857", "Turkish (DOS/OS2-857)" }, - { "CP1026", "Turkish (DOS/OS2-1026)" }, - { "CP1254", "Turkish (Windows-1254)" }, - { "CP1258", "Vietnamese (Windows-1258)" }, - { "MacRoman", "Western Europe (Apple Macintosh)" }, - { "MacIceland", "Western Europe (Apple Macintosh/Icelandic)" }, - { "CP037", "Western Europe (DOS/OS2-037/US-Canada)" }, - { "CP437", "Western Europe (DOS/OS2-437/US)" }, - { "CP850", "Western Europe (DOS/OS2-850)" }, - { "CP860", "Western Europe (DOS/OS2-860/Portuguese)" }, - { "CP861", "Western Europe (DOS/OS2-861/Icelandic)" }, - { "CP863", "Western Europe (DOS/OS2-863/French)" }, - { "CP865", "Western Europe (DOS/OS2-865/Nordic)" }, - { "CP1252", "Western Europe (Windows-1252/WinLatin 1)" } }; + = { { u"MacArabic", u"Arabic (Apple Macintosh)" }, + { u"CP864", u"Arabic (DOS/OS2-864)" }, + { u"CP1006", u"Arabic (IBM-1006)" }, + { u"CP1256", u"Arabic (Windows-1256)" }, + { u"CP775", u"Baltic (DOS/OS2-775)" }, + { u"CP1257", u"Baltic (Windows-1257)" }, + { u"MacCeltic", u"Celtic (Apple Macintosh)" }, + { u"MacCyrillic", u"Cyrillic (Apple Macintosh)" }, + { u"CP855", u"Cyrillic (DOS/OS2-855)" }, + { u"CP866", u"Cyrillic (DOS/OS2-866/Russian)" }, + { u"CP1251", u"Cyrillic (Windows-1251)" }, + { u"MacCEurope", u"Eastern Europe (Apple Macintosh)" }, + { u"MacCroatian", u"Eastern Europe (Apple Macintosh/Croatian)" }, + { u"MacRomanian", u"Eastern Europe (Apple Macintosh/Romanian)" }, + { u"CP852", u"Eastern Europe (DOS/OS2-852)" }, + { u"CP1250", u"Eastern Europe (Windows-1250/WinLatin 2)" }, + { u"MacGreek", u"Greek (Apple Macintosh)" }, + { u"CP737", u"Greek (DOS/OS2-737)" }, + { u"CP869", u"Greek (DOS/OS2-869/Greek-2)" }, + { u"CP875", u"Greek (DOS/OS2-875)" }, + { u"CP1253", u"Greek (Windows-1253)" }, + { u"MacHebrew", u"Hebrew (Apple Macintosh)" }, + { u"CP424", u"Hebrew (DOS/OS2-424)" }, + { u"CP856", u"Hebrew (DOS/OS2-856)" }, + { u"CP862", u"Hebrew (DOS/OS2-862)" }, + { u"CP1255", u"Hebrew (Windows-1255)" }, + { u"CP500", u"International (DOS/OS2-500)" }, + { u"CP932", u"Japanese (Windows-932)" }, + { u"MacThai", u"Thai (Apple Macintosh)" }, + { u"CP874", u"Thai (DOS/OS2-874)" }, + { u"CP950", u"Traditional Chinese (Windows-950)" }, + { u"MacTurkish", u"Turkish (Apple Macintosh)" }, + { u"CP857", u"Turkish (DOS/OS2-857)" }, + { u"CP1026", u"Turkish (DOS/OS2-1026)" }, + { u"CP1254", u"Turkish (Windows-1254)" }, + { u"CP1258", u"Vietnamese (Windows-1258)" }, + { u"MacRoman", u"Western Europe (Apple Macintosh)" }, + { u"MacIceland", u"Western Europe (Apple Macintosh/Icelandic)" }, + { u"CP037", u"Western Europe (DOS/OS2-037/US-Canada)" }, + { u"CP437", u"Western Europe (DOS/OS2-437/US)" }, + { u"CP850", u"Western Europe (DOS/OS2-850)" }, + { u"CP860", u"Western Europe (DOS/OS2-860/Portuguese)" }, + { u"CP861", u"Western Europe (DOS/OS2-861/Icelandic)" }, + { u"CP863", u"Western Europe (DOS/OS2-863/French)" }, + { u"CP865", u"Western Europe (DOS/OS2-865/Nordic)" }, + { u"CP1252", u"Western Europe (Windows-1252/WinLatin 1)" } }; std::size_t const numEncodings = SAL_N_ELEMENTS(s_encodings); diff --git a/writerperfect/source/writer/exp/xmlimp.cxx b/writerperfect/source/writer/exp/xmlimp.cxx index 9ade95990987..25d33aa0fd5a 100644 --- a/writerperfect/source/writer/exp/xmlimp.cxx +++ b/writerperfect/source/writer/exp/xmlimp.cxx @@ -104,7 +104,7 @@ OUString FindCoverImage(const OUString& rDocumentBaseURL, OUString& rMimeType, return aRet; static const std::initializer_list<OUStringLiteral> vExtensions - = { "gif", "jpg", "png", "svg" }; + = { u"gif", u"jpg", u"png", u"svg" }; OUString aMediaDir = FindMediaDir(rDocumentBaseURL, rFilterData); for (const auto& rExtension : vExtensions) |