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 /sd/source/core/stlsheet.cxx | |
parent | filter: svg export: error when playing an animated empty text field (diff) | |
download | core-33ecd0d5c4fff9511a8436513936a3f7044a775a.tar.gz core-33ecd0d5c4fff9511a8436513936a3f7044a775a.zip |
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 'sd/source/core/stlsheet.cxx')
-rw-r--r-- | sd/source/core/stlsheet.cxx | 84 |
1 files changed, 42 insertions, 42 deletions
diff --git a/sd/source/core/stlsheet.cxx b/sd/source/core/stlsheet.cxx index 576c68cddb77..4c4703e188aa 100644 --- a/sd/source/core/stlsheet.cxx +++ b/sd/source/core/stlsheet.cxx @@ -81,10 +81,10 @@ static SvxItemPropertySet& GetStylePropertySet() { static const SfxItemPropertyMapEntry aFullPropertyMap_Impl[] = { - { "Family", WID_STYLE_FAMILY, ::cppu::UnoType<OUString>::get(), PropertyAttribute::READONLY, 0}, - { "UserDefinedAttributes", SDRATTR_XMLATTRIBUTES, cppu::UnoType<XNameContainer>::get(), 0, 0}, - { "DisplayName", WID_STYLE_DISPNAME, ::cppu::UnoType<OUString>::get(), PropertyAttribute::READONLY, 0}, - { "Hidden", WID_STYLE_HIDDEN, cppu::UnoType<bool>::get(), 0, 0}, + { u"Family", WID_STYLE_FAMILY, ::cppu::UnoType<OUString>::get(), PropertyAttribute::READONLY, 0}, + { u"UserDefinedAttributes", SDRATTR_XMLATTRIBUTES, cppu::UnoType<XNameContainer>::get(), 0, 0}, + { u"DisplayName", WID_STYLE_DISPNAME, ::cppu::UnoType<OUString>::get(), PropertyAttribute::READONLY, 0}, + { u"Hidden", WID_STYLE_HIDDEN, cppu::UnoType<bool>::get(), 0, 0}, SVX_UNOEDIT_NUMBERING_PROPERTIE, SHADOW_PROPERTIES @@ -95,11 +95,11 @@ static SvxItemPropertySet& GetStylePropertySet() TEXT_PROPERTIES_DEFAULTS CONNECTOR_PROPERTIES SPECIAL_DIMENSIONING_PROPERTIES_DEFAULTS - { "TopBorder", SDRATTR_TABLE_BORDER, ::cppu::UnoType<BorderLine>::get(), 0, TOP_BORDER }, - { "BottomBorder", SDRATTR_TABLE_BORDER, ::cppu::UnoType<BorderLine>::get(), 0, BOTTOM_BORDER }, - { "LeftBorder", SDRATTR_TABLE_BORDER, ::cppu::UnoType<BorderLine>::get(), 0, LEFT_BORDER }, - { "RightBorder", SDRATTR_TABLE_BORDER, ::cppu::UnoType<BorderLine>::get(), 0, RIGHT_BORDER }, - { "", 0, css::uno::Type(), 0, 0 } + { u"TopBorder", SDRATTR_TABLE_BORDER, ::cppu::UnoType<BorderLine>::get(), 0, TOP_BORDER }, + { u"BottomBorder", SDRATTR_TABLE_BORDER, ::cppu::UnoType<BorderLine>::get(), 0, BOTTOM_BORDER }, + { u"LeftBorder", SDRATTR_TABLE_BORDER, ::cppu::UnoType<BorderLine>::get(), 0, LEFT_BORDER }, + { u"RightBorder", SDRATTR_TABLE_BORDER, ::cppu::UnoType<BorderLine>::get(), 0, RIGHT_BORDER }, + { u"", 0, css::uno::Type(), 0, 0 } }; static SvxItemPropertySet aPropSet( aFullPropertyMap_Impl, SdrObject::GetGlobalDrawObjectItemPool() ); @@ -575,39 +575,39 @@ struct ApiNameMap OUStringLiteral mpApiName; sal_uInt32 mnHelpId; } const pApiNameMap[] - = { { OUStringLiteral("title"), HID_PSEUDOSHEET_TITLE }, - { OUStringLiteral("subtitle"), HID_PSEUDOSHEET_SUBTITLE }, - { OUStringLiteral("background"), HID_PSEUDOSHEET_BACKGROUND }, - { OUStringLiteral("backgroundobjects"), HID_PSEUDOSHEET_BACKGROUNDOBJECTS }, - { OUStringLiteral("notes"), HID_PSEUDOSHEET_NOTES }, - { OUStringLiteral("standard"), HID_STANDARD_STYLESHEET_NAME }, - { OUStringLiteral("objectwithoutfill"), HID_POOLSHEET_OBJWITHOUTFILL }, - - { OUStringLiteral("Text"), HID_POOLSHEET_TEXT }, - { OUStringLiteral("A4"), HID_POOLSHEET_A4 }, - { OUStringLiteral("Title A4"), HID_POOLSHEET_A4_TITLE }, - { OUStringLiteral("Heading A4"), HID_POOLSHEET_A4_HEADLINE }, - { OUStringLiteral("Text A4"), HID_POOLSHEET_A4_TEXT }, - { OUStringLiteral("A4"), HID_POOLSHEET_A0 }, - { OUStringLiteral("Title A0"), HID_POOLSHEET_A0_TITLE }, - { OUStringLiteral("Heading A0"), HID_POOLSHEET_A0_HEADLINE }, - { OUStringLiteral("Text A0"), HID_POOLSHEET_A0_TEXT }, - - { OUStringLiteral("Graphic"), HID_POOLSHEET_GRAPHIC }, - { OUStringLiteral("Shapes"), HID_POOLSHEET_SHAPES }, - { OUStringLiteral("Filled"), HID_POOLSHEET_FILLED }, - { OUStringLiteral("Filled Blue"), HID_POOLSHEET_FILLED_BLUE }, - { OUStringLiteral("Filled Green"), HID_POOLSHEET_FILLED_GREEN }, - { OUStringLiteral("Filled Red"), HID_POOLSHEET_FILLED_RED }, - { OUStringLiteral("Filled Yellow"), HID_POOLSHEET_FILLED_YELLOW }, - { OUStringLiteral("Outlined"), HID_POOLSHEET_OUTLINE }, - { OUStringLiteral("Outlined Blue"), HID_POOLSHEET_OUTLINE_BLUE }, - { OUStringLiteral("Outlined Green"), HID_POOLSHEET_OUTLINE_GREEN }, - { OUStringLiteral("Outlined Red"), HID_POOLSHEET_OUTLINE_RED }, - { OUStringLiteral("Outlined Yellow"), HID_POOLSHEET_OUTLINE_YELLOW }, - { OUStringLiteral("Lines"), HID_POOLSHEET_LINES }, - { OUStringLiteral("Arrow Line"), HID_POOLSHEET_MEASURE }, - { OUStringLiteral("Arrow Dashed"), HID_POOLSHEET_LINES_DASHED } + = { { OUStringLiteral(u"title"), HID_PSEUDOSHEET_TITLE }, + { OUStringLiteral(u"subtitle"), HID_PSEUDOSHEET_SUBTITLE }, + { OUStringLiteral(u"background"), HID_PSEUDOSHEET_BACKGROUND }, + { OUStringLiteral(u"backgroundobjects"), HID_PSEUDOSHEET_BACKGROUNDOBJECTS }, + { OUStringLiteral(u"notes"), HID_PSEUDOSHEET_NOTES }, + { OUStringLiteral(u"standard"), HID_STANDARD_STYLESHEET_NAME }, + { OUStringLiteral(u"objectwithoutfill"), HID_POOLSHEET_OBJWITHOUTFILL }, + + { OUStringLiteral(u"Text"), HID_POOLSHEET_TEXT }, + { OUStringLiteral(u"A4"), HID_POOLSHEET_A4 }, + { OUStringLiteral(u"Title A4"), HID_POOLSHEET_A4_TITLE }, + { OUStringLiteral(u"Heading A4"), HID_POOLSHEET_A4_HEADLINE }, + { OUStringLiteral(u"Text A4"), HID_POOLSHEET_A4_TEXT }, + { OUStringLiteral(u"A4"), HID_POOLSHEET_A0 }, + { OUStringLiteral(u"Title A0"), HID_POOLSHEET_A0_TITLE }, + { OUStringLiteral(u"Heading A0"), HID_POOLSHEET_A0_HEADLINE }, + { OUStringLiteral(u"Text A0"), HID_POOLSHEET_A0_TEXT }, + + { OUStringLiteral(u"Graphic"), HID_POOLSHEET_GRAPHIC }, + { OUStringLiteral(u"Shapes"), HID_POOLSHEET_SHAPES }, + { OUStringLiteral(u"Filled"), HID_POOLSHEET_FILLED }, + { OUStringLiteral(u"Filled Blue"), HID_POOLSHEET_FILLED_BLUE }, + { OUStringLiteral(u"Filled Green"), HID_POOLSHEET_FILLED_GREEN }, + { OUStringLiteral(u"Filled Red"), HID_POOLSHEET_FILLED_RED }, + { OUStringLiteral(u"Filled Yellow"), HID_POOLSHEET_FILLED_YELLOW }, + { OUStringLiteral(u"Outlined"), HID_POOLSHEET_OUTLINE }, + { OUStringLiteral(u"Outlined Blue"), HID_POOLSHEET_OUTLINE_BLUE }, + { OUStringLiteral(u"Outlined Green"), HID_POOLSHEET_OUTLINE_GREEN }, + { OUStringLiteral(u"Outlined Red"), HID_POOLSHEET_OUTLINE_RED }, + { OUStringLiteral(u"Outlined Yellow"), HID_POOLSHEET_OUTLINE_YELLOW }, + { OUStringLiteral(u"Lines"), HID_POOLSHEET_LINES }, + { OUStringLiteral(u"Arrow Line"), HID_POOLSHEET_MEASURE }, + { OUStringLiteral(u"Arrow Dashed"), HID_POOLSHEET_LINES_DASHED } }; OUString GetApiNameForHelpId(sal_uLong nId) |