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 /filter | |
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 'filter')
-rw-r--r-- | filter/source/graphicfilter/ieps/ieps.cxx | 8 | ||||
-rw-r--r-- | filter/source/msfilter/msocximex.cxx | 2 | ||||
-rw-r--r-- | filter/source/msfilter/msvbahelper.cxx | 4 | ||||
-rw-r--r-- | filter/source/svg/svgexport.cxx | 2 | ||||
-rw-r--r-- | filter/source/svg/svgwriter.cxx | 2 |
5 files changed, 9 insertions, 9 deletions
diff --git a/filter/source/graphicfilter/ieps/ieps.cxx b/filter/source/graphicfilter/ieps/ieps.cxx index a6c764adaff2..c5ed1970865f 100644 --- a/filter/source/graphicfilter/ieps/ieps.cxx +++ b/filter/source/graphicfilter/ieps/ieps.cxx @@ -374,7 +374,7 @@ static bool RenderAsBMPThroughConvert(const sal_uInt8* pBuf, sal_uInt32 nBytesRe arg1.pData, arg2.pData, arg3.pData, arg4.pData }; return RenderAsBMPThroughHelper(pBuf, nBytesRead, rGraphic, - { "convert" EXESUFFIX }, + { u"convert" EXESUFFIX }, args, SAL_N_ELEMENTS(args)); } @@ -403,11 +403,11 @@ static bool RenderAsBMPThroughGS(const sal_uInt8* pBuf, sal_uInt32 nBytesRead, #ifdef _WIN32 // Try both 32-bit and 64-bit ghostscript executable name { - "gswin32c" EXESUFFIX, - "gswin64c" EXESUFFIX, + u"gswin32c" EXESUFFIX, + u"gswin64c" EXESUFFIX, }, #else - { "gs" EXESUFFIX }, + { u"gs" EXESUFFIX }, #endif args, SAL_N_ELEMENTS(args)); diff --git a/filter/source/msfilter/msocximex.cxx b/filter/source/msfilter/msocximex.cxx index f353b4830307..ae4198cec178 100644 --- a/filter/source/msfilter/msocximex.cxx +++ b/filter/source/msfilter/msocximex.cxx @@ -31,7 +31,7 @@ using namespace ::com::sun::star; -OUStringLiteral const sWW8_form( "WW-Standard" ); +OUStringLiteral const sWW8_form( u"WW-Standard" ); SvxMSConvertOCXControls::SvxMSConvertOCXControls( const uno::Reference< frame::XModel >& rxModel) : mxModel(rxModel) { diff --git a/filter/source/msfilter/msvbahelper.cxx b/filter/source/msfilter/msvbahelper.cxx index 3f03c7f6ed53..6beab7cb82ad 100644 --- a/filter/source/msfilter/msvbahelper.cxx +++ b/filter/source/msfilter/msvbahelper.cxx @@ -48,8 +48,8 @@ using namespace ::com::sun::star; namespace ooo::vba { -const OUStringLiteral sUrlPart0( "vnd.sun.star.script:" ); -const OUStringLiteral sUrlPart1( "?language=Basic&location=document" ); +const OUStringLiteral sUrlPart0( u"vnd.sun.star.script:" ); +const OUStringLiteral sUrlPart1( u"?language=Basic&location=document" ); OUString makeMacroURL( const OUString& sMacroName ) { diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx index 19d37247cd07..615c60004c2b 100644 --- a/filter/source/svg/svgexport.cxx +++ b/filter/source/svg/svgexport.cxx @@ -81,7 +81,7 @@ using namespace ::xmloff::token; #define SVG_PROP_POSITIONED_CHARACTERS "UsePositionedCharacters" // ooo xml elements -const char aOOOElemTextField[] = NSPREFIX "text_field"; +const char16_t aOOOElemTextField[] = u"" NSPREFIX "text_field"; // ooo xml attributes for meta_slide diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx index c14683634c22..ba6bdfd534cd 100644 --- a/filter/source/svg/svgwriter.cxx +++ b/filter/source/svg/svgwriter.cxx @@ -2131,7 +2131,7 @@ void SVGActionWriter::ImplStartClipRegion(sal_Int32 nClipPathId) if (nClipPathId == 0) return; - OUString aUrl = OUStringLiteral("url(#") + aPrefixClipPathId + OUString::number( nClipPathId ) + ")"; + OUString aUrl = OUStringLiteral(u"url(#") + aPrefixClipPathId + OUString::number( nClipPathId ) + ")"; mrExport.AddAttribute( XML_NAMESPACE_NONE, "clip-path", aUrl ); mpCurrentClipRegionElem.reset( new SvXMLElementExport( mrExport, XML_NAMESPACE_NONE, aXMLElemG, true, true ) ); } |