summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2020-08-27 11:40:59 +0200
committerStephan Bergmann <sbergman@redhat.com>2020-08-28 08:07:09 +0200
commit33ecd0d5c4fff9511a8436513936a3f7044a775a (patch)
treec25809adda140ff89d9f2a2b6dfadba17e188fb0 /editeng
parent554834484a3323f73b5aeace246bcd9635368967 (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 'editeng')
-rw-r--r--editeng/source/accessibility/AccessibleEditableTextPara.cxx6
-rw-r--r--editeng/source/uno/unofield.cxx62
-rw-r--r--editeng/source/uno/unotext.cxx18
-rw-r--r--editeng/source/uno/unotext2.cxx18
-rw-r--r--editeng/source/xml/xmltxtexp.cxx8
-rw-r--r--editeng/source/xml/xmltxtimp.cxx8
6 files changed, 60 insertions, 60 deletions
diff --git a/editeng/source/accessibility/AccessibleEditableTextPara.cxx b/editeng/source/accessibility/AccessibleEditableTextPara.cxx
index 989818a33e9a..46561bea798d 100644
--- a/editeng/source/accessibility/AccessibleEditableTextPara.cxx
+++ b/editeng/source/accessibility/AccessibleEditableTextPara.cxx
@@ -94,9 +94,9 @@ namespace accessibility
SVX_UNOEDIT_CHAR_PROPERTIES,
SVX_UNOEDIT_PARA_PROPERTIES,
SVX_UNOEDIT_NUMBERING_PROPERTIE,
- { "TextUserDefinedAttributes", EE_CHAR_XMLATTRIBS, cppu::UnoType<css::container::XNameContainer>::get(), 0, 0},
- { "ParaUserDefinedAttributes", EE_PARA_XMLATTRIBS, cppu::UnoType<css::container::XNameContainer>::get(), 0, 0},
- { "", 0, css::uno::Type(), 0, 0 }
+ { u"TextUserDefinedAttributes", EE_CHAR_XMLATTRIBS, cppu::UnoType<css::container::XNameContainer>::get(), 0, 0},
+ { u"ParaUserDefinedAttributes", EE_PARA_XMLATTRIBS, cppu::UnoType<css::container::XNameContainer>::get(), 0, 0},
+ { u"", 0, css::uno::Type(), 0, 0 }
};
static SvxItemPropertySet aPropSet( aPropMap, EditEngine::GetGlobalItemPool() );
return &aPropSet;
diff --git a/editeng/source/uno/unofield.cxx b/editeng/source/uno/unofield.cxx
index 6e4d7987f9a5..9fdc097132da 100644
--- a/editeng/source/uno/unofield.cxx
+++ b/editeng/source/uno/unofield.cxx
@@ -71,73 +71,73 @@ static const SfxItemPropertySet* ImplGetFieldItemPropertySet( sal_Int32 mnId )
{
static const SfxItemPropertyMapEntry aExDateTimeFieldPropertyMap_Impl[] =
{
- { UNO_TC_PROP_DATE_TIME, WID_DATE, ::cppu::UnoType<util::DateTime>::get(), 0, 0 },
- { UNO_TC_PROP_IS_FIXED, WID_BOOL1, cppu::UnoType<bool>::get(), 0, 0 },
- { UNO_TC_PROP_IS_DATE, WID_BOOL2, cppu::UnoType<bool>::get(), 0, 0 },
- { UNO_TC_PROP_NUMFORMAT, WID_INT32, ::cppu::UnoType<sal_Int32>::get(), 0, 0 },
- { "", 0, css::uno::Type(), 0, 0 }
+ { u"" UNO_TC_PROP_DATE_TIME, WID_DATE, ::cppu::UnoType<util::DateTime>::get(), 0, 0 },
+ { u"" UNO_TC_PROP_IS_FIXED, WID_BOOL1, cppu::UnoType<bool>::get(), 0, 0 },
+ { u"" UNO_TC_PROP_IS_DATE, WID_BOOL2, cppu::UnoType<bool>::get(), 0, 0 },
+ { u"" UNO_TC_PROP_NUMFORMAT, WID_INT32, ::cppu::UnoType<sal_Int32>::get(), 0, 0 },
+ { u"", 0, css::uno::Type(), 0, 0 }
};
static const SfxItemPropertySet aExDateTimeFieldPropertySet_Impl(aExDateTimeFieldPropertyMap_Impl);
static const SfxItemPropertyMapEntry aDateTimeFieldPropertyMap_Impl[] =
{
- { UNO_TC_PROP_IS_DATE, WID_BOOL2, cppu::UnoType<bool>::get(), 0, 0 },
- { "", 0, css::uno::Type(), 0, 0 }
+ { u"" UNO_TC_PROP_IS_DATE, WID_BOOL2, cppu::UnoType<bool>::get(), 0, 0 },
+ { u"", 0, css::uno::Type(), 0, 0 }
};
static const SfxItemPropertySet aDateTimeFieldPropertySet_Impl(aDateTimeFieldPropertyMap_Impl);
static const SfxItemPropertyMapEntry aUrlFieldPropertyMap_Impl[] =
{
- { UNO_TC_PROP_URL_FORMAT, WID_INT16, ::cppu::UnoType<sal_Int16>::get(), 0, 0 },
- { UNO_TC_PROP_URL_REPRESENTATION, WID_STRING1, ::cppu::UnoType<OUString>::get(), 0, 0 },
- { UNO_TC_PROP_URL_TARGET, WID_STRING2, ::cppu::UnoType<OUString>::get(), 0, 0 },
- { UNO_TC_PROP_URL, WID_STRING3, ::cppu::UnoType<OUString>::get(), 0, 0 },
- { "", 0, css::uno::Type(), 0, 0 }
+ { u"" UNO_TC_PROP_URL_FORMAT, WID_INT16, ::cppu::UnoType<sal_Int16>::get(), 0, 0 },
+ { u"" UNO_TC_PROP_URL_REPRESENTATION, WID_STRING1, ::cppu::UnoType<OUString>::get(), 0, 0 },
+ { u"" UNO_TC_PROP_URL_TARGET, WID_STRING2, ::cppu::UnoType<OUString>::get(), 0, 0 },
+ { u"" UNO_TC_PROP_URL, WID_STRING3, ::cppu::UnoType<OUString>::get(), 0, 0 },
+ { u"", 0, css::uno::Type(), 0, 0 }
};
static const SfxItemPropertySet aUrlFieldPropertySet_Impl(aUrlFieldPropertyMap_Impl);
static const SfxItemPropertyMapEntry aEmptyPropertyMap_Impl[] =
{
- { "", 0, css::uno::Type(), 0, 0 }
+ { u"", 0, css::uno::Type(), 0, 0 }
};
static const SfxItemPropertySet aEmptyPropertySet_Impl(aEmptyPropertyMap_Impl);
static const SfxItemPropertyMapEntry aExtFileFieldPropertyMap_Impl[] =
{
- { UNO_TC_PROP_IS_FIXED, WID_BOOL1, cppu::UnoType<bool>::get(), 0, 0 },
- { UNO_TC_PROP_FILE_FORMAT, WID_INT16, ::cppu::UnoType<sal_Int16>::get(), 0, 0 },
- { UNO_TC_PROP_CURRENT_PRESENTATION, WID_STRING1, ::cppu::UnoType<OUString>::get(), 0, 0 },
- { "", 0, css::uno::Type(), 0, 0 }
+ { u"" UNO_TC_PROP_IS_FIXED, WID_BOOL1, cppu::UnoType<bool>::get(), 0, 0 },
+ { u"" UNO_TC_PROP_FILE_FORMAT, WID_INT16, ::cppu::UnoType<sal_Int16>::get(), 0, 0 },
+ { u"" UNO_TC_PROP_CURRENT_PRESENTATION, WID_STRING1, ::cppu::UnoType<OUString>::get(), 0, 0 },
+ { u"", 0, css::uno::Type(), 0, 0 }
};
static const SfxItemPropertySet aExtFileFieldPropertySet_Impl(aExtFileFieldPropertyMap_Impl);
static const SfxItemPropertyMapEntry aAuthorFieldPropertyMap_Impl[] =
{
- { UNO_TC_PROP_IS_FIXED, WID_BOOL1, cppu::UnoType<bool>::get(), 0, 0 },
- { UNO_TC_PROP_CURRENT_PRESENTATION, WID_STRING1,::cppu::UnoType<OUString>::get(), 0, 0 },
- { UNO_TC_PROP_AUTHOR_CONTENT, WID_STRING2,::cppu::UnoType<OUString>::get(), 0, 0 },
- { UNO_TC_PROP_AUTHOR_FORMAT, WID_INT16, ::cppu::UnoType<sal_Int16>::get(), 0, 0 },
- { UNO_TC_PROP_AUTHOR_FULLNAME, WID_BOOL2, cppu::UnoType<bool>::get(), 0, 0 },
- { "", 0, css::uno::Type(), 0, 0 }
+ { u"" UNO_TC_PROP_IS_FIXED, WID_BOOL1, cppu::UnoType<bool>::get(), 0, 0 },
+ { u"" UNO_TC_PROP_CURRENT_PRESENTATION, WID_STRING1,::cppu::UnoType<OUString>::get(), 0, 0 },
+ { u"" UNO_TC_PROP_AUTHOR_CONTENT, WID_STRING2,::cppu::UnoType<OUString>::get(), 0, 0 },
+ { u"" UNO_TC_PROP_AUTHOR_FORMAT, WID_INT16, ::cppu::UnoType<sal_Int16>::get(), 0, 0 },
+ { u"" UNO_TC_PROP_AUTHOR_FULLNAME, WID_BOOL2, cppu::UnoType<bool>::get(), 0, 0 },
+ { u"", 0, css::uno::Type(), 0, 0 }
};
static const SfxItemPropertySet aAuthorFieldPropertySet_Impl(aAuthorFieldPropertyMap_Impl);
static const SfxItemPropertyMapEntry aMeasureFieldPropertyMap_Impl[] =
{
- { UNO_TC_PROP_MEASURE_KIND, WID_INT16, ::cppu::UnoType<sal_Int16>::get(), 0, 0 },
- { "", 0, css::uno::Type(), 0, 0 }
+ { u"" UNO_TC_PROP_MEASURE_KIND, WID_INT16, ::cppu::UnoType<sal_Int16>::get(), 0, 0 },
+ { u"", 0, css::uno::Type(), 0, 0 }
};
static const SfxItemPropertySet aMeasureFieldPropertySet_Impl(aMeasureFieldPropertyMap_Impl);
static const SfxItemPropertyMapEntry aDocInfoCustomFieldPropertyMap_Impl[] =
{
- { UNO_TC_PROP_NAME, WID_STRING1, cppu::UnoType<OUString>::get(), 0, 0 },
- { UNO_TC_PROP_CURRENT_PRESENTATION, WID_STRING2, cppu::UnoType<OUString>::get(), 0, 0 },
- { UNO_TC_PROP_IS_FIXED, WID_BOOL1, cppu::UnoType<bool>::get(), 0, 0 },
- { UNO_TC_PROP_NUMFORMAT, WID_INT32, cppu::UnoType<sal_Int32>::get(), 0, 0 },
- { UNO_TC_PROP_IS_FIXED_LANGUAGE, WID_BOOL2, cppu::UnoType<bool>::get(), 0, 0 },
- { "", 0, css::uno::Type(), 0, 0 }
+ { u"" UNO_TC_PROP_NAME, WID_STRING1, cppu::UnoType<OUString>::get(), 0, 0 },
+ { u"" UNO_TC_PROP_CURRENT_PRESENTATION, WID_STRING2, cppu::UnoType<OUString>::get(), 0, 0 },
+ { u"" UNO_TC_PROP_IS_FIXED, WID_BOOL1, cppu::UnoType<bool>::get(), 0, 0 },
+ { u"" UNO_TC_PROP_NUMFORMAT, WID_INT32, cppu::UnoType<sal_Int32>::get(), 0, 0 },
+ { u"" UNO_TC_PROP_IS_FIXED_LANGUAGE, WID_BOOL2, cppu::UnoType<bool>::get(), 0, 0 },
+ { u"", 0, css::uno::Type(), 0, 0 }
};
static const SfxItemPropertySet aDocInfoCustomFieldPropertySet_Impl(aDocInfoCustomFieldPropertyMap_Impl);
diff --git a/editeng/source/uno/unotext.cxx b/editeng/source/uno/unotext.cxx
index a801a5a79d8f..392c0cd37255 100644
--- a/editeng/source/uno/unotext.cxx
+++ b/editeng/source/uno/unotext.cxx
@@ -89,11 +89,11 @@ const SfxItemPropertyMapEntry* ImplGetSvxTextPortionPropertyMap()
SVX_UNOEDIT_FONT_PROPERTIES,
SVX_UNOEDIT_OUTLINER_PROPERTIES,
SVX_UNOEDIT_PARA_PROPERTIES,
- { "TextField", EE_FEATURE_FIELD, cppu::UnoType<text::XTextField>::get(), beans::PropertyAttribute::READONLY, 0 },
- { "TextPortionType", WID_PORTIONTYPE, ::cppu::UnoType<OUString>::get(), beans::PropertyAttribute::READONLY, 0 },
- { "TextUserDefinedAttributes", EE_CHAR_XMLATTRIBS, cppu::UnoType<css::container::XNameContainer>::get(), 0, 0},
- { "ParaUserDefinedAttributes", EE_PARA_XMLATTRIBS, cppu::UnoType<css::container::XNameContainer>::get(), 0, 0},
- { "", 0, css::uno::Type(), 0, 0 }
+ { u"TextField", EE_FEATURE_FIELD, cppu::UnoType<text::XTextField>::get(), beans::PropertyAttribute::READONLY, 0 },
+ { u"TextPortionType", WID_PORTIONTYPE, ::cppu::UnoType<OUString>::get(), beans::PropertyAttribute::READONLY, 0 },
+ { u"TextUserDefinedAttributes", EE_CHAR_XMLATTRIBS, cppu::UnoType<css::container::XNameContainer>::get(), 0, 0},
+ { u"ParaUserDefinedAttributes", EE_PARA_XMLATTRIBS, cppu::UnoType<css::container::XNameContainer>::get(), 0, 0},
+ { u"", 0, css::uno::Type(), 0, 0 }
};
return aSvxTextPortionPropertyMap;
}
@@ -118,9 +118,9 @@ const SfxItemPropertyMapEntry* ImplGetSvxUnoOutlinerTextCursorPropertyMap()
SVX_UNOEDIT_FONT_PROPERTIES,
SVX_UNOEDIT_OUTLINER_PROPERTIES,
SVX_UNOEDIT_PARA_PROPERTIES,
- { "TextUserDefinedAttributes", EE_CHAR_XMLATTRIBS, cppu::UnoType<css::container::XNameContainer>::get(), 0, 0},
- { "ParaUserDefinedAttributes", EE_PARA_XMLATTRIBS, cppu::UnoType<css::container::XNameContainer>::get(), 0, 0},
- { "", 0, css::uno::Type(), 0, 0 }
+ { u"TextUserDefinedAttributes", EE_CHAR_XMLATTRIBS, cppu::UnoType<css::container::XNameContainer>::get(), 0, 0},
+ { u"ParaUserDefinedAttributes", EE_PARA_XMLATTRIBS, cppu::UnoType<css::container::XNameContainer>::get(), 0, 0},
+ { u"", 0, css::uno::Type(), 0, 0 }
};
return aSvxUnoOutlinerTextCursorPropertyMap;
@@ -2160,7 +2160,7 @@ uno::Sequence< OUString > SAL_CALL SvxUnoTextBase::getSupportedServiceNames_Stat
{
return comphelper::concatSequences(
SvxUnoTextRangeBase::getSupportedServiceNames_Static(),
- std::initializer_list<OUStringLiteral>{ "com.sun.star.text.Text" });
+ std::initializer_list<OUStringLiteral>{ u"com.sun.star.text.Text" });
}
namespace
diff --git a/editeng/source/uno/unotext2.cxx b/editeng/source/uno/unotext2.cxx
index eb0d377140c8..a4573057df65 100644
--- a/editeng/source/uno/unotext2.cxx
+++ b/editeng/source/uno/unotext2.cxx
@@ -365,11 +365,11 @@ uno::Sequence< OUString > SAL_CALL SvxUnoTextContent::getSupportedServiceNames()
{
return comphelper::concatSequences(
SvxUnoTextRangeBase::getSupportedServiceNames(),
- std::initializer_list<OUStringLiteral>{ "com.sun.star.style.ParagraphProperties",
- "com.sun.star.style.ParagraphPropertiesComplex",
- "com.sun.star.style.ParagraphPropertiesAsian",
- "com.sun.star.text.TextContent",
- "com.sun.star.text.Paragraph" });
+ std::initializer_list<OUStringLiteral>{ u"com.sun.star.style.ParagraphProperties",
+ u"com.sun.star.style.ParagraphPropertiesComplex",
+ u"com.sun.star.style.ParagraphPropertiesAsian",
+ u"com.sun.star.text.TextContent",
+ u"com.sun.star.text.Paragraph" });
}
@@ -644,10 +644,10 @@ uno::Sequence< OUString > SAL_CALL SvxUnoTextCursor::getSupportedServiceNames()
{
return comphelper::concatSequences(
SvxUnoTextRangeBase::getSupportedServiceNames(),
- std::initializer_list<OUStringLiteral>{ "com.sun.star.style.ParagraphProperties",
- "com.sun.star.style.ParagraphPropertiesComplex",
- "com.sun.star.style.ParagraphPropertiesAsian",
- "com.sun.star.text.TextCursor" });
+ std::initializer_list<OUStringLiteral>{ u"com.sun.star.style.ParagraphProperties",
+ u"com.sun.star.style.ParagraphPropertiesComplex",
+ u"com.sun.star.style.ParagraphPropertiesAsian",
+ u"com.sun.star.text.TextCursor" });
}
diff --git a/editeng/source/xml/xmltxtexp.cxx b/editeng/source/xml/xmltxtexp.cxx
index a45848887273..af20aeb2ffb0 100644
--- a/editeng/source/xml/xmltxtexp.cxx
+++ b/editeng/source/xml/xmltxtexp.cxx
@@ -275,11 +275,11 @@ SvxXMLTextExportComponent::SvxXMLTextExportComponent(
{
SVX_UNOEDIT_CHAR_PROPERTIES,
SVX_UNOEDIT_FONT_PROPERTIES,
- { UNO_NAME_NUMBERING_RULES, EE_PARA_NUMBULLET, cppu::UnoType<css::container::XIndexReplace>::get(), 0, 0 },
- { UNO_NAME_NUMBERING, EE_PARA_BULLETSTATE,cppu::UnoType<bool>::get(), 0, 0 },
- { UNO_NAME_NUMBERING_LEVEL, EE_PARA_OUTLLEVEL, ::cppu::UnoType<sal_Int16>::get(), 0, 0 },
+ { u"" UNO_NAME_NUMBERING_RULES, EE_PARA_NUMBULLET, cppu::UnoType<css::container::XIndexReplace>::get(), 0, 0 },
+ { u"" UNO_NAME_NUMBERING, EE_PARA_BULLETSTATE,cppu::UnoType<bool>::get(), 0, 0 },
+ { u"" UNO_NAME_NUMBERING_LEVEL, EE_PARA_OUTLLEVEL, ::cppu::UnoType<sal_Int16>::get(), 0, 0 },
SVX_UNOEDIT_PARA_PROPERTIES,
- { "", 0, css::uno::Type(), 0, 0 }
+ { u"", 0, css::uno::Type(), 0, 0 }
};
static SvxItemPropertySet aSvxXMLTextExportComponentPropertySet( SvxXMLTextExportComponentPropertyMap, EditEngine::GetGlobalItemPool() );
diff --git a/editeng/source/xml/xmltxtimp.cxx b/editeng/source/xml/xmltxtimp.cxx
index 79443d850933..c6607cef4d87 100644
--- a/editeng/source/xml/xmltxtimp.cxx
+++ b/editeng/source/xml/xmltxtimp.cxx
@@ -157,11 +157,11 @@ EditPaM SvxReadXML( EditEngine& rEditEngine, SvStream& rStream, const ESelection
SVX_UNOEDIT_CHAR_PROPERTIES,
SVX_UNOEDIT_FONT_PROPERTIES,
// bullets & numbering props, tdf#128046
- { UNO_NAME_NUMBERING_RULES, EE_PARA_NUMBULLET, cppu::UnoType<css::container::XIndexReplace>::get(), 0, 0 },
- { UNO_NAME_NUMBERING, EE_PARA_BULLETSTATE,cppu::UnoType<bool>::get(), 0, 0 },
- { UNO_NAME_NUMBERING_LEVEL, EE_PARA_OUTLLEVEL, ::cppu::UnoType<sal_Int16>::get(), 0, 0 },
+ { u"" UNO_NAME_NUMBERING_RULES, EE_PARA_NUMBULLET, cppu::UnoType<css::container::XIndexReplace>::get(), 0, 0 },
+ { u"" UNO_NAME_NUMBERING, EE_PARA_BULLETSTATE,cppu::UnoType<bool>::get(), 0, 0 },
+ { u"" UNO_NAME_NUMBERING_LEVEL, EE_PARA_OUTLLEVEL, ::cppu::UnoType<sal_Int16>::get(), 0, 0 },
SVX_UNOEDIT_PARA_PROPERTIES,
- { "", 0, css::uno::Type(), 0, 0 }
+ { u"", 0, css::uno::Type(), 0, 0 }
};
static SvxItemPropertySet aSvxXMLTextImportComponentPropertySet( SvxXMLTextImportComponentPropertyMap, EditEngine::GetGlobalItemPool() );