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 /xmloff/source/draw | |
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 'xmloff/source/draw')
-rw-r--r-- | xmloff/source/draw/XMLImageMapContext.cxx | 2 | ||||
-rw-r--r-- | xmloff/source/draw/XMLImageMapExport.cxx | 22 | ||||
-rw-r--r-- | xmloff/source/draw/animexp.cxx | 24 | ||||
-rw-r--r-- | xmloff/source/draw/animimp.cxx | 24 | ||||
-rw-r--r-- | xmloff/source/draw/sdxmlexp.cxx | 2 | ||||
-rw-r--r-- | xmloff/source/draw/sdxmlimp_impl.hxx | 4 | ||||
-rw-r--r-- | xmloff/source/draw/shapeexport.cxx | 40 | ||||
-rw-r--r-- | xmloff/source/draw/shapeimport.cxx | 8 |
8 files changed, 63 insertions, 63 deletions
diff --git a/xmloff/source/draw/XMLImageMapContext.cxx b/xmloff/source/draw/XMLImageMapContext.cxx index c1504079eca4..d822f363400e 100644 --- a/xmloff/source/draw/XMLImageMapContext.cxx +++ b/xmloff/source/draw/XMLImageMapContext.cxx @@ -554,7 +554,7 @@ void XMLImageMapCircleContext::Prepare( } -const OUStringLiteral gsImageMap("ImageMap"); +const OUStringLiteral gsImageMap(u"ImageMap"); XMLImageMapContext::XMLImageMapContext( SvXMLImport& rImport, diff --git a/xmloff/source/draw/XMLImageMapExport.cxx b/xmloff/source/draw/XMLImageMapExport.cxx index 709214a7664a..25117838ac88 100644 --- a/xmloff/source/draw/XMLImageMapExport.cxx +++ b/xmloff/source/draw/XMLImageMapExport.cxx @@ -53,17 +53,17 @@ using ::com::sun::star::document::XEventsSupplier; using ::com::sun::star::lang::XServiceInfo; using ::com::sun::star::drawing::PointSequence; -const OUStringLiteral gsBoundary("Boundary"); -const OUStringLiteral gsCenter("Center"); -const OUStringLiteral gsDescription("Description"); -const OUStringLiteral gsImageMap("ImageMap"); -const OUStringLiteral gsIsActive("IsActive"); -const OUStringLiteral gsName("Name"); -const OUStringLiteral gsPolygon("Polygon"); -const OUStringLiteral gsRadius("Radius"); -const OUStringLiteral gsTarget("Target"); -const OUStringLiteral gsURL("URL"); -const OUStringLiteral gsTitle("Title"); +const OUStringLiteral gsBoundary(u"Boundary"); +const OUStringLiteral gsCenter(u"Center"); +const OUStringLiteral gsDescription(u"Description"); +const OUStringLiteral gsImageMap(u"ImageMap"); +const OUStringLiteral gsIsActive(u"IsActive"); +const OUStringLiteral gsName(u"Name"); +const OUStringLiteral gsPolygon(u"Polygon"); +const OUStringLiteral gsRadius(u"Radius"); +const OUStringLiteral gsTarget(u"Target"); +const OUStringLiteral gsURL(u"URL"); +const OUStringLiteral gsTitle(u"Title"); XMLImageMapExport::XMLImageMapExport(SvXMLExport& rExp) : mrExport(rExp) diff --git a/xmloff/source/draw/animexp.cxx b/xmloff/source/draw/animexp.cxx index e671bd7f7fbb..cc1beefbdd07 100644 --- a/xmloff/source/draw/animexp.cxx +++ b/xmloff/source/draw/animexp.cxx @@ -233,18 +233,18 @@ class AnimExpImpl public: list<XMLEffectHint> maEffects; - static constexpr OUStringLiteral gsDimColor = "DimColor"; - static constexpr OUStringLiteral gsDimHide = "DimHide"; - static constexpr OUStringLiteral gsDimPrev = "DimPrevious"; - static constexpr OUStringLiteral gsEffect = "Effect"; - static constexpr OUStringLiteral gsPlayFull = "PlayFull"; - static constexpr OUStringLiteral gsPresOrder = "PresentationOrder"; - static constexpr OUStringLiteral gsSound = "Sound"; - static constexpr OUStringLiteral gsSoundOn = "SoundOn"; - static constexpr OUStringLiteral gsSpeed = "Speed"; - static constexpr OUStringLiteral gsTextEffect = "TextEffect"; - static constexpr OUStringLiteral gsIsAnimation = "IsAnimation"; - static constexpr OUStringLiteral gsAnimPath = "AnimationPath"; + static constexpr OUStringLiteral gsDimColor = u"DimColor"; + static constexpr OUStringLiteral gsDimHide = u"DimHide"; + static constexpr OUStringLiteral gsDimPrev = u"DimPrevious"; + static constexpr OUStringLiteral gsEffect = u"Effect"; + static constexpr OUStringLiteral gsPlayFull = u"PlayFull"; + static constexpr OUStringLiteral gsPresOrder = u"PresentationOrder"; + static constexpr OUStringLiteral gsSound = u"Sound"; + static constexpr OUStringLiteral gsSoundOn = u"SoundOn"; + static constexpr OUStringLiteral gsSpeed = u"Speed"; + static constexpr OUStringLiteral gsTextEffect = u"TextEffect"; + static constexpr OUStringLiteral gsIsAnimation = u"IsAnimation"; + static constexpr OUStringLiteral gsAnimPath = u"AnimationPath"; }; XMLAnimationsExporter::XMLAnimationsExporter() diff --git a/xmloff/source/draw/animimp.cxx b/xmloff/source/draw/animimp.cxx index 9e1d3ca38c6f..c0c471f92f50 100644 --- a/xmloff/source/draw/animimp.cxx +++ b/xmloff/source/draw/animimp.cxx @@ -318,18 +318,18 @@ AnimationEffect ImplSdXMLgetEffect( XMLEffect eKind, XMLEffectDirection eDirecti namespace { - constexpr OUStringLiteral gsDimColor = "DimColor"; - constexpr OUStringLiteral gsDimHide = "DimHide"; - constexpr OUStringLiteral gsDimPrev = "DimPrevious"; - constexpr OUStringLiteral gsEffect = "Effect"; - constexpr OUStringLiteral gsPlayFull = "PlayFull"; - constexpr OUStringLiteral gsSound = "Sound"; - constexpr OUStringLiteral gsSoundOn = "SoundOn"; - constexpr OUStringLiteral gsSpeed = "Speed"; - constexpr OUStringLiteral gsTextEffect = "TextEffect"; - constexpr OUStringLiteral gsPresShapeService = "com.sun.star.presentation.Shape"; - constexpr OUStringLiteral gsAnimPath = "AnimationPath"; - constexpr OUStringLiteral gsIsAnimation = "IsAnimation"; + constexpr OUStringLiteral gsDimColor = u"DimColor"; + constexpr OUStringLiteral gsDimHide = u"DimHide"; + constexpr OUStringLiteral gsDimPrev = u"DimPrevious"; + constexpr OUStringLiteral gsEffect = u"Effect"; + constexpr OUStringLiteral gsPlayFull = u"PlayFull"; + constexpr OUStringLiteral gsSound = u"Sound"; + constexpr OUStringLiteral gsSoundOn = u"SoundOn"; + constexpr OUStringLiteral gsSpeed = u"Speed"; + constexpr OUStringLiteral gsTextEffect = u"TextEffect"; + constexpr OUStringLiteral gsPresShapeService = u"com.sun.star.presentation.Shape"; + constexpr OUStringLiteral gsAnimPath = u"AnimationPath"; + constexpr OUStringLiteral gsIsAnimation = u"IsAnimation"; }; namespace { diff --git a/xmloff/source/draw/sdxmlexp.cxx b/xmloff/source/draw/sdxmlexp.cxx index 691e6ed49762..0297c6f4e285 100644 --- a/xmloff/source/draw/sdxmlexp.cxx +++ b/xmloff/source/draw/sdxmlexp.cxx @@ -368,7 +368,7 @@ ImpXMLAutoLayoutInfo::ImpXMLAutoLayoutInfo(sal_uInt16 nTyp, ImpXMLEXPPageMasterI maPresRect.SetSize(aLayoutSize); } -const OUStringLiteral gsPageLayoutNames( "PageLayoutNames" ); +const OUStringLiteral gsPageLayoutNames( u"PageLayoutNames" ); SdXMLExport::SdXMLExport( const css::uno::Reference< css::uno::XComponentContext >& xContext, diff --git a/xmloff/source/draw/sdxmlimp_impl.hxx b/xmloff/source/draw/sdxmlimp_impl.hxx index 29ffde9a2de4..8d4f3e7407fd 100644 --- a/xmloff/source/draw/sdxmlimp_impl.hxx +++ b/xmloff/source/draw/sdxmlimp_impl.hxx @@ -119,8 +119,8 @@ class SdXMLImport: public SvXMLImport bool mbLoadDoc; bool mbPreview; - static constexpr OUStringLiteral gsPageLayouts = "PageLayouts"; - static constexpr OUStringLiteral gsPreview = "Preview"; + static constexpr OUStringLiteral gsPageLayouts = u"PageLayouts"; + static constexpr OUStringLiteral gsPreview = u"Preview"; HeaderFooterDeclMap maHeaderDeclsMap; HeaderFooterDeclMap maFooterDeclsMap; diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx index 5c5d81201f93..6b3559200d02 100644 --- a/xmloff/source/draw/shapeexport.cxx +++ b/xmloff/source/draw/shapeexport.cxx @@ -146,26 +146,26 @@ bool supportsText(XmlShapeType eShapeType) } -const OUStringLiteral gsZIndex( "ZOrder" ); -const OUStringLiteral gsPrintable( "Printable" ); -const OUStringLiteral gsVisible( "Visible" ); -const OUStringLiteral gsModel( "Model" ); -const OUStringLiteral gsStartShape( "StartShape" ); -const OUStringLiteral gsEndShape( "EndShape" ); -const OUStringLiteral gsOnClick( "OnClick" ); -const OUStringLiteral gsEventType( "EventType" ); -const OUStringLiteral gsPresentation( "Presentation" ); -const OUStringLiteral gsMacroName( "MacroName" ); -const OUStringLiteral gsScript( "Script" ); -const OUStringLiteral gsLibrary( "Library" ); -const OUStringLiteral gsClickAction( "ClickAction" ); -const OUStringLiteral gsBookmark( "Bookmark" ); -const OUStringLiteral gsEffect( "Effect" ); -const OUStringLiteral gsPlayFull( "PlayFull" ); -const OUStringLiteral gsVerb( "Verb" ); -const OUStringLiteral gsSoundURL( "SoundURL" ); -const OUStringLiteral gsSpeed( "Speed" ); -const OUStringLiteral gsStarBasic( "StarBasic" ); +const OUStringLiteral gsZIndex( u"ZOrder" ); +const OUStringLiteral gsPrintable( u"Printable" ); +const OUStringLiteral gsVisible( u"Visible" ); +const OUStringLiteral gsModel( u"Model" ); +const OUStringLiteral gsStartShape( u"StartShape" ); +const OUStringLiteral gsEndShape( u"EndShape" ); +const OUStringLiteral gsOnClick( u"OnClick" ); +const OUStringLiteral gsEventType( u"EventType" ); +const OUStringLiteral gsPresentation( u"Presentation" ); +const OUStringLiteral gsMacroName( u"MacroName" ); +const OUStringLiteral gsScript( u"Script" ); +const OUStringLiteral gsLibrary( u"Library" ); +const OUStringLiteral gsClickAction( u"ClickAction" ); +const OUStringLiteral gsBookmark( u"Bookmark" ); +const OUStringLiteral gsEffect( u"Effect" ); +const OUStringLiteral gsPlayFull( u"PlayFull" ); +const OUStringLiteral gsVerb( u"Verb" ); +const OUStringLiteral gsSoundURL( u"SoundURL" ); +const OUStringLiteral gsSpeed( u"Speed" ); +const OUStringLiteral gsStarBasic( u"StarBasic" ); XMLShapeExport::XMLShapeExport(SvXMLExport& rExp, SvXMLExportPropertyMapper *pExtMapper ) diff --git a/xmloff/source/draw/shapeimport.cxx b/xmloff/source/draw/shapeimport.cxx index fc4deec1a801..8797425eb8c7 100644 --- a/xmloff/source/draw/shapeimport.cxx +++ b/xmloff/source/draw/shapeimport.cxx @@ -110,10 +110,10 @@ struct XMLShapeImportHelperImpl bool mbIsPresentationShapesSupported; }; -const OUStringLiteral gsStartShape("StartShape"); -const OUStringLiteral gsEndShape("EndShape"); -const OUStringLiteral gsStartGluePointIndex("StartGluePointIndex"); -const OUStringLiteral gsEndGluePointIndex("EndGluePointIndex"); +const OUStringLiteral gsStartShape(u"StartShape"); +const OUStringLiteral gsEndShape(u"EndShape"); +const OUStringLiteral gsStartGluePointIndex(u"StartGluePointIndex"); +const OUStringLiteral gsEndGluePointIndex(u"EndGluePointIndex"); XMLShapeImportHelper::XMLShapeImportHelper( SvXMLImport& rImporter, |