summaryrefslogtreecommitdiff
path: root/xmloff/source/style
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 /xmloff/source/style
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 'xmloff/source/style')
-rw-r--r--xmloff/source/style/XMLPageExport.cxx4
-rw-r--r--xmloff/source/style/numehelp.cxx8
-rw-r--r--xmloff/source/style/prstylei.cxx8
-rw-r--r--xmloff/source/style/styleexp.cxx10
-rw-r--r--xmloff/source/style/xmlnume.cxx6
-rw-r--r--xmloff/source/style/xmlnumi.cxx10
-rw-r--r--xmloff/source/style/xmlstyle.cxx6
7 files changed, 26 insertions, 26 deletions
diff --git a/xmloff/source/style/XMLPageExport.cxx b/xmloff/source/style/XMLPageExport.cxx
index ea67dff753a8..27bbfbb942f5 100644
--- a/xmloff/source/style/XMLPageExport.cxx
+++ b/xmloff/source/style/XMLPageExport.cxx
@@ -41,8 +41,8 @@ using namespace ::com::sun::star::container;
using namespace ::com::sun::star::beans;
using namespace ::xmloff::token;
-const OUStringLiteral gsIsPhysical( "IsPhysical" );
-const OUStringLiteral gsFollowStyle( "FollowStyle" );
+const OUStringLiteral gsIsPhysical( u"IsPhysical" );
+const OUStringLiteral gsFollowStyle( u"FollowStyle" );
namespace {
diff --git a/xmloff/source/style/numehelp.cxx b/xmloff/source/style/numehelp.cxx
index 3264b71b530f..d1479cf0c4cc 100644
--- a/xmloff/source/style/numehelp.cxx
+++ b/xmloff/source/style/numehelp.cxx
@@ -38,10 +38,10 @@
using namespace com::sun::star;
using namespace xmloff::token;
-const OUStringLiteral gsStandardFormat("StandardFormat");
-const OUStringLiteral gsType("Type");
-const OUStringLiteral gsCurrencySymbol("CurrencySymbol");
-const OUStringLiteral gsCurrencyAbbreviation("CurrencyAbbreviation");
+const OUStringLiteral gsStandardFormat(u"StandardFormat");
+const OUStringLiteral gsType(u"Type");
+const OUStringLiteral gsCurrencySymbol(u"CurrencySymbol");
+const OUStringLiteral gsCurrencyAbbreviation(u"CurrencyAbbreviation");
XMLNumberFormatAttributesExportHelper::XMLNumberFormatAttributesExportHelper(
css::uno::Reference< css::util::XNumberFormatsSupplier > const & xTempNumberFormatsSupplier)
diff --git a/xmloff/source/style/prstylei.cxx b/xmloff/source/style/prstylei.cxx
index 412db9a75417..38c648e414de 100644
--- a/xmloff/source/style/prstylei.cxx
+++ b/xmloff/source/style/prstylei.cxx
@@ -143,8 +143,8 @@ namespace
-const OUStringLiteral gsIsPhysical( "IsPhysical" );
-const OUStringLiteral gsFollowStyle( "FollowStyle" );
+const OUStringLiteral gsIsPhysical( u"IsPhysical" );
+const OUStringLiteral gsFollowStyle( u"FollowStyle" );
XMLPropStyleContext::XMLPropStyleContext( SvXMLImport& rImport,
sal_Int32 nElement,
@@ -337,8 +337,8 @@ void XMLPropStyleContext::CreateAndInsert( bool bOverwrite )
{
Sequence< OUString > aPropNames(1);
aPropNames[0] = GetFamily() == XmlStyleFamily::TEXT_PARAGRAPH ?
- OUStringLiteral("ParaAutoStyleName") :
- OUStringLiteral("CharAutoStyleName");
+ OUStringLiteral(u"ParaAutoStyleName") :
+ OUStringLiteral(u"CharAutoStyleName");
Sequence< Any > aAny = xAutoStyle->getPropertyValues( aPropNames );
if( aAny.hasElements() )
{
diff --git a/xmloff/source/style/styleexp.cxx b/xmloff/source/style/styleexp.cxx
index c3dc6b6742c7..66cab27c9d19 100644
--- a/xmloff/source/style/styleexp.cxx
+++ b/xmloff/source/style/styleexp.cxx
@@ -52,11 +52,11 @@ using namespace ::xmloff::token;
using ::com::sun::star::document::XEventsSupplier;
-const OUStringLiteral gsIsPhysical( "IsPhysical" );
-const OUStringLiteral gsIsAutoUpdate( "IsAutoUpdate" );
-const OUStringLiteral gsFollowStyle( "FollowStyle" );
-const OUStringLiteral gsNumberingStyleName( "NumberingStyleName" );
-const OUStringLiteral gsOutlineLevel( "OutlineLevel" );
+const OUStringLiteral gsIsPhysical( u"IsPhysical" );
+const OUStringLiteral gsIsAutoUpdate( u"IsAutoUpdate" );
+const OUStringLiteral gsFollowStyle( u"FollowStyle" );
+const OUStringLiteral gsNumberingStyleName( u"NumberingStyleName" );
+const OUStringLiteral gsOutlineLevel( u"OutlineLevel" );
XMLStyleExport::XMLStyleExport(
SvXMLExport& rExp,
diff --git a/xmloff/source/style/xmlnume.cxx b/xmloff/source/style/xmlnume.cxx
index 4728ed8da4d7..3eca9cda1bc1 100644
--- a/xmloff/source/style/xmlnume.cxx
+++ b/xmloff/source/style/xmlnume.cxx
@@ -605,9 +605,9 @@ void SvxXMLNumRuleExport::exportLevelStyle( sal_Int32 nLevel,
}
-const OUStringLiteral gsNumberingRules( "NumberingRules" );
-const OUStringLiteral gsIsPhysical( "IsPhysical" );
-const OUStringLiteral gsIsContinuousNumbering( "IsContinuousNumbering" );
+const OUStringLiteral gsNumberingRules( u"NumberingRules" );
+const OUStringLiteral gsIsPhysical( u"IsPhysical" );
+const OUStringLiteral gsIsContinuousNumbering( u"IsContinuousNumbering" );
SvxXMLNumRuleExport::SvxXMLNumRuleExport( SvXMLExport& rExp ) :
rExport( rExp ),
diff --git a/xmloff/source/style/xmlnumi.cxx b/xmloff/source/style/xmlnumi.cxx
index 0cd3c1c21d80..eb500be374a5 100644
--- a/xmloff/source/style/xmlnumi.cxx
+++ b/xmloff/source/style/xmlnumi.cxx
@@ -249,8 +249,8 @@ public:
}
};
-const OUStringLiteral gsStarBats( "StarBats" );
-const OUStringLiteral gsStarMath( "StarMath" );
+const OUStringLiteral gsStarBats( u"StarBats" );
+const OUStringLiteral gsStarMath( u"StarMath" );
SvxXMLListLevelStyleContext_Impl::SvxXMLListLevelStyleContext_Impl(
SvXMLImport& rImport, sal_uInt16 nPrfx,
@@ -1013,9 +1013,9 @@ void SvxXMLListStyleContext::SetAttribute( sal_uInt16 nPrefixKey,
}
}
-const OUStringLiteral sIsPhysical( "IsPhysical" );
-const OUStringLiteral sNumberingRules( "NumberingRules" );
-const OUStringLiteral sIsContinuousNumbering( "IsContinuousNumbering" );
+const OUStringLiteral sIsPhysical( u"IsPhysical" );
+const OUStringLiteral sNumberingRules( u"NumberingRules" );
+const OUStringLiteral sIsContinuousNumbering( u"IsContinuousNumbering" );
SvxXMLListStyleContext::SvxXMLListStyleContext( SvXMLImport& rImport,
sal_uInt16 nPrfx,
diff --git a/xmloff/source/style/xmlstyle.cxx b/xmloff/source/style/xmlstyle.cxx
index 0c4c708352a8..458dda8030e8 100644
--- a/xmloff/source/style/xmlstyle.cxx
+++ b/xmloff/source/style/xmlstyle.cxx
@@ -79,8 +79,8 @@ const SvXMLTokenMapEntry aStyleStylesElemTokenMap[] =
XML_TOKEN_MAP_END
};
-const OUStringLiteral gsParaStyleServiceName( "com.sun.star.style.ParagraphStyle" );
-const OUStringLiteral gsTextStyleServiceName( "com.sun.star.style.CharacterStyle" );
+const OUStringLiteral gsParaStyleServiceName( u"com.sun.star.style.ParagraphStyle" );
+const OUStringLiteral gsTextStyleServiceName( u"com.sun.star.style.CharacterStyle" );
const SvXMLTokenMap& SvXMLStylesContext::GetStyleStylesElemTokenMap()
{
@@ -698,7 +698,7 @@ Reference < XAutoStyleFamily > SvXMLStylesContext::GetAutoStyles( XmlStyleFamily
xAutoStyles = mxParaAutoStyles;
else
{
- sName = bPara ? OUStringLiteral( "ParagraphStyles" ): OUStringLiteral( "CharacterStyles" );
+ sName = bPara ? OUStringLiteral( u"ParagraphStyles" ): OUStringLiteral( u"CharacterStyles" );
Reference< XAutoStylesSupplier > xAutoStylesSupp( GetImport().GetModel(), UNO_QUERY );
Reference< XAutoStyles > xAutoStyleFamilies = xAutoStylesSupp->getAutoStyles();
if (xAutoStyleFamilies->hasByName(sName))