summaryrefslogtreecommitdiff
path: root/reportdesign
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 /reportdesign
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 'reportdesign')
-rw-r--r--reportdesign/source/core/api/ReportDefinition.cxx38
-rw-r--r--reportdesign/source/core/misc/reportformula.cxx2
-rw-r--r--reportdesign/source/filter/xml/xmlCell.cxx2
-rw-r--r--reportdesign/source/filter/xml/xmlFixedContent.cxx2
-rw-r--r--reportdesign/source/filter/xml/xmlStyleImport.cxx8
-rw-r--r--reportdesign/source/ui/dlg/Navigator.cxx2
-rw-r--r--reportdesign/source/ui/inspection/DataProviderHandler.cxx12
-rw-r--r--reportdesign/source/ui/inspection/GeometryHandler.cxx4
-rw-r--r--reportdesign/source/ui/inspection/metadata.cxx108
-rw-r--r--reportdesign/source/ui/misc/RptUndo.cxx4
-rw-r--r--reportdesign/source/ui/report/ReportController.cxx16
11 files changed, 99 insertions, 99 deletions
diff --git a/reportdesign/source/core/api/ReportDefinition.cxx b/reportdesign/source/core/api/ReportDefinition.cxx
index 609e67a4d27c..a8156e356fee 100644
--- a/reportdesign/source/core/api/ReportDefinition.cxx
+++ b/reportdesign/source/core/api/ReportDefinition.cxx
@@ -2111,25 +2111,25 @@ uno::Sequence< OUString > SAL_CALL OReportDefinition::getAvailableServiceNames()
{
static const OUStringLiteral aSvxComponentServiceNameList[] =
{
- "com.sun.star.form.component.FixedText",
- "com.sun.star.form.component.DatabaseImageControl",
- "com.sun.star.style.PageStyle",
- "com.sun.star.style.GraphicStyle",
- "com.sun.star.style.FrameStyle",
- "com.sun.star.drawing.Defaults",
- "com.sun.star.document.ImportEmbeddedObjectResolver",
- "com.sun.star.document.ExportEmbeddedObjectResolver",
- "com.sun.star.document.ImportGraphicStorageHandler",
- "com.sun.star.document.ExportGraphicStorageHandler",
- "com.sun.star.chart2.data.DataProvider",
- "com.sun.star.xml.NamespaceMap",
- "com.sun.star.document.Settings",
- "com.sun.star.drawing.GradientTable",
- "com.sun.star.drawing.HatchTable",
- "com.sun.star.drawing.BitmapTable",
- "com.sun.star.drawing.TransparencyGradientTable",
- "com.sun.star.drawing.DashTable",
- "com.sun.star.drawing.MarkerTable"
+ u"com.sun.star.form.component.FixedText",
+ u"com.sun.star.form.component.DatabaseImageControl",
+ u"com.sun.star.style.PageStyle",
+ u"com.sun.star.style.GraphicStyle",
+ u"com.sun.star.style.FrameStyle",
+ u"com.sun.star.drawing.Defaults",
+ u"com.sun.star.document.ImportEmbeddedObjectResolver",
+ u"com.sun.star.document.ExportEmbeddedObjectResolver",
+ u"com.sun.star.document.ImportGraphicStorageHandler",
+ u"com.sun.star.document.ExportGraphicStorageHandler",
+ u"com.sun.star.chart2.data.DataProvider",
+ u"com.sun.star.xml.NamespaceMap",
+ u"com.sun.star.document.Settings",
+ u"com.sun.star.drawing.GradientTable",
+ u"com.sun.star.drawing.HatchTable",
+ u"com.sun.star.drawing.BitmapTable",
+ u"com.sun.star.drawing.TransparencyGradientTable",
+ u"com.sun.star.drawing.DashTable",
+ u"com.sun.star.drawing.MarkerTable"
};
static const sal_uInt16 nSvxComponentServiceNameListCount = SAL_N_ELEMENTS(aSvxComponentServiceNameList);
diff --git a/reportdesign/source/core/misc/reportformula.cxx b/reportdesign/source/core/misc/reportformula.cxx
index 5cd19dc4d55c..c23120898fc5 100644
--- a/reportdesign/source/core/misc/reportformula.cxx
+++ b/reportdesign/source/core/misc/reportformula.cxx
@@ -82,7 +82,7 @@ namespace rptui
case Field:
{
- m_sCompleteFormula = sFieldPrefix + OUStringLiteral("[") + _rFieldOrExpression + "]";
+ m_sCompleteFormula = sFieldPrefix + OUStringLiteral(u"[") + _rFieldOrExpression + "]";
}
break;
default:
diff --git a/reportdesign/source/filter/xml/xmlCell.cxx b/reportdesign/source/filter/xml/xmlCell.cxx
index f94f53a2e54a..68375e9ad455 100644
--- a/reportdesign/source/filter/xml/xmlCell.cxx
+++ b/reportdesign/source/filter/xml/xmlCell.cxx
@@ -118,7 +118,7 @@ css::uno::Reference< css::xml::sax::XFastContextHandler > OXMLCell::createFastCh
css::uno::Reference< css::xml::sax::XFastContextHandler > xContext;
ORptFilter& rImport = GetOwnImport();
Reference<XMultiServiceFactory> xFactor(rImport.GetModel(),uno::UNO_QUERY);
- static const char s_sStringConcat[] = " & ";
+ static const char16_t s_sStringConcat[] = u" & ";
switch( nElement )
{
diff --git a/reportdesign/source/filter/xml/xmlFixedContent.cxx b/reportdesign/source/filter/xml/xmlFixedContent.cxx
index fde22affc0f1..81448e89861c 100644
--- a/reportdesign/source/filter/xml/xmlFixedContent.cxx
+++ b/reportdesign/source/filter/xml/xmlFixedContent.cxx
@@ -127,7 +127,7 @@ css::uno::Reference< css::xml::sax::XFastContextHandler > OXMLFixedContent::crea
if (xContext)
return xContext;
- static const char s_sStringConcat[] = " & ";
+ static const char16_t s_sStringConcat[] = u" & ";
m_rImport.GetProgressBarHelper()->Increment( PROGRESS_BAR_STEP );
switch( nElement )
diff --git a/reportdesign/source/filter/xml/xmlStyleImport.cxx b/reportdesign/source/filter/xml/xmlStyleImport.cxx
index 6242d6ea9489..2a3e457c49a6 100644
--- a/reportdesign/source/filter/xml/xmlStyleImport.cxx
+++ b/reportdesign/source/filter/xml/xmlStyleImport.cxx
@@ -143,10 +143,10 @@ void OControlStyleContext::SetAttribute( sal_uInt16 nPrefixKey,
}
-const OUStringLiteral g_sTableStyleFamilyName( XML_STYLE_FAMILY_TABLE_TABLE_STYLES_NAME );
-const OUStringLiteral g_sColumnStyleFamilyName( XML_STYLE_FAMILY_TABLE_COLUMN_STYLES_NAME );
-const OUStringLiteral g_sRowStyleFamilyName( XML_STYLE_FAMILY_TABLE_ROW_STYLES_NAME );
-const OUStringLiteral g_sCellStyleFamilyName( XML_STYLE_FAMILY_TABLE_CELL_STYLES_NAME );
+const OUStringLiteral g_sTableStyleFamilyName( u"" XML_STYLE_FAMILY_TABLE_TABLE_STYLES_NAME );
+const OUStringLiteral g_sColumnStyleFamilyName( u"" XML_STYLE_FAMILY_TABLE_COLUMN_STYLES_NAME );
+const OUStringLiteral g_sRowStyleFamilyName( u"" XML_STYLE_FAMILY_TABLE_ROW_STYLES_NAME );
+const OUStringLiteral g_sCellStyleFamilyName( u"" XML_STYLE_FAMILY_TABLE_CELL_STYLES_NAME );
OReportStylesContext::OReportStylesContext( ORptFilter& rImport,
const bool bTempAutoStyles ) :
diff --git a/reportdesign/source/ui/dlg/Navigator.cxx b/reportdesign/source/ui/dlg/Navigator.cxx
index 8c6a7cf53f0c..6d0e900d13f2 100644
--- a/reportdesign/source/ui/dlg/Navigator.cxx
+++ b/reportdesign/source/ui/dlg/Navigator.cxx
@@ -60,7 +60,7 @@ static OUString lcl_getImageId(const uno::Reference< report::XReportComponent>&
if ( uno::Reference< report::XFixedText>(_xElement,uno::UNO_QUERY).is() )
sId = RID_SVXBMP_FM_FIXEDTEXT;
else if ( xFixedLine.is() )
- sId = xFixedLine->getOrientation() ? OUStringLiteral(RID_SVXBMP_INSERT_VFIXEDLINE) : OUStringLiteral(RID_SVXBMP_INSERT_HFIXEDLINE);
+ sId = xFixedLine->getOrientation() ? OUStringLiteral(u"" RID_SVXBMP_INSERT_VFIXEDLINE) : OUStringLiteral(u"" RID_SVXBMP_INSERT_HFIXEDLINE);
else if ( uno::Reference< report::XFormattedField>(_xElement,uno::UNO_QUERY).is() )
sId = RID_SVXBMP_FM_EDIT;
else if ( uno::Reference< report::XImageControl>(_xElement,uno::UNO_QUERY).is() )
diff --git a/reportdesign/source/ui/inspection/DataProviderHandler.cxx b/reportdesign/source/ui/inspection/DataProviderHandler.cxx
index fabb755a2be0..7e10b362f1ff 100644
--- a/reportdesign/source/ui/inspection/DataProviderHandler.cxx
+++ b/reportdesign/source/ui/inspection/DataProviderHandler.cxx
@@ -257,9 +257,9 @@ inspection::LineDescriptor SAL_CALL DataProviderHandler::describePropertyLine(co
if ( nId != -1 )
{
aOut.Category = (OPropertyInfoService::getPropertyUIFlags(nId ) & PropUIFlags::DataProperty) ?
- OUStringLiteral("Data")
+ OUStringLiteral(u"Data")
:
- OUStringLiteral("General");
+ OUStringLiteral(u"General");
aOut.HelpURL = HelpIdUrl::getHelpURL( OPropertyInfoService::getPropertyHelpId( nId ) );
aOut.DisplayName = OPropertyInfoService::getPropertyTranslation(nId);
}
@@ -344,10 +344,10 @@ uno::Sequence< beans::Property > SAL_CALL DataProviderHandler::getSupportedPrope
beans::Property aValue;
static const OUStringLiteral s_pProperties[] =
{
- PROPERTY_CHARTTYPE
- ,PROPERTY_MASTERFIELDS
- ,PROPERTY_DETAILFIELDS
- ,PROPERTY_PREVIEW_COUNT
+ u"" PROPERTY_CHARTTYPE
+ ,u"" PROPERTY_MASTERFIELDS
+ ,u"" PROPERTY_DETAILFIELDS
+ ,u"" PROPERTY_PREVIEW_COUNT
};
for (const auto & rName : s_pProperties)
diff --git a/reportdesign/source/ui/inspection/GeometryHandler.cxx b/reportdesign/source/ui/inspection/GeometryHandler.cxx
index 4a6de7fda696..1644144ed93a 100644
--- a/reportdesign/source/ui/inspection/GeometryHandler.cxx
+++ b/reportdesign/source/ui/inspection/GeometryHandler.cxx
@@ -806,9 +806,9 @@ inspection::LineDescriptor SAL_CALL GeometryHandler::describePropertyLine(const
if ( nId != -1 )
{
aOut.Category = (OPropertyInfoService::getPropertyUIFlags(nId ) & PropUIFlags::DataProperty) ?
- OUStringLiteral("Data")
+ OUStringLiteral(u"Data")
:
- OUStringLiteral("General");
+ OUStringLiteral(u"General");
aOut.HelpURL = HelpIdUrl::getHelpURL( OPropertyInfoService::getPropertyHelpId( nId ) );
aOut.DisplayName = OPropertyInfoService::getPropertyTranslation(nId);
}
diff --git a/reportdesign/source/ui/inspection/metadata.cxx b/reportdesign/source/ui/inspection/metadata.cxx
index f652fa4a4723..2e8b34c35fe4 100644
--- a/reportdesign/source/ui/inspection/metadata.cxx
+++ b/reportdesign/source/ui/inspection/metadata.cxx
@@ -232,60 +232,60 @@ namespace rptui
const uno::Sequence< beans::Property > aProps = _xFormComponentHandler->getSupportedProperties();
static const OUStringLiteral pExcludeProperties[] =
{
- "Enabled",
- "Printable",
- "WordBreak",
- "MultiLine",
- "Tag",
- "HelpText",
- "HelpURL",
- "MaxTextLen",
- "ReadOnly",
- "Tabstop",
- "TabIndex",
- "ValueMin",
- "ValueMax",
- "Spin",
- "SpinValue",
- "SpinValueMin",
- "SpinValueMax",
- "DefaultSpinValue",
- "SpinIncrement",
- "Repeat",
- "RepeatDelay",
- "ControlLabel", /// TODO: has to be checked
- "LabelControl",
- "Title", // comment this out if you want to have title feature for charts
- PROPERTY_MAXTEXTLEN,
- PROPERTY_EFFECTIVEDEFAULT,
- PROPERTY_EFFECTIVEMAX,
- PROPERTY_EFFECTIVEMIN,
- "HideInactiveSelection",
- "SubmitAction",
- "InputRequired",
- "VerticalAlign",
- PROPERTY_ALIGN,
- PROPERTY_EMPTY_IS_NULL,
- PROPERTY_FILTERPROPOSAL
- ,PROPERTY_POSITIONX
- ,PROPERTY_POSITIONY
- ,PROPERTY_WIDTH
- ,PROPERTY_HEIGHT
- ,PROPERTY_AUTOGROW
- ,PROPERTY_FONT
- ,PROPERTY_LABEL
- ,PROPERTY_LINECOLOR
- ,PROPERTY_BORDER
- ,PROPERTY_BORDERCOLOR
- ,PROPERTY_BACKTRANSPARENT
- ,PROPERTY_CONTROLBACKGROUND
- ,PROPERTY_BACKGROUNDCOLOR
- ,PROPERTY_CONTROLBACKGROUNDTRANSPARENT
- ,PROPERTY_FORMULALIST
- ,PROPERTY_SCOPE
- ,PROPERTY_TYPE
- ,PROPERTY_DATASOURCENAME
- ,PROPERTY_VERTICALALIGN
+ u"Enabled",
+ u"Printable",
+ u"WordBreak",
+ u"MultiLine",
+ u"Tag",
+ u"HelpText",
+ u"HelpURL",
+ u"MaxTextLen",
+ u"ReadOnly",
+ u"Tabstop",
+ u"TabIndex",
+ u"ValueMin",
+ u"ValueMax",
+ u"Spin",
+ u"SpinValue",
+ u"SpinValueMin",
+ u"SpinValueMax",
+ u"DefaultSpinValue",
+ u"SpinIncrement",
+ u"Repeat",
+ u"RepeatDelay",
+ u"ControlLabel", /// TODO: has to be checked
+ u"LabelControl",
+ u"Title", // comment this out if you want to have title feature for charts
+ u"" PROPERTY_MAXTEXTLEN,
+ u"" PROPERTY_EFFECTIVEDEFAULT,
+ u"" PROPERTY_EFFECTIVEMAX,
+ u"" PROPERTY_EFFECTIVEMIN,
+ u"HideInactiveSelection",
+ u"SubmitAction",
+ u"InputRequired",
+ u"VerticalAlign",
+ u"" PROPERTY_ALIGN,
+ u"" PROPERTY_EMPTY_IS_NULL,
+ u"" PROPERTY_FILTERPROPOSAL
+ ,u"" PROPERTY_POSITIONX
+ ,u"" PROPERTY_POSITIONY
+ ,u"" PROPERTY_WIDTH
+ ,u"" PROPERTY_HEIGHT
+ ,u"" PROPERTY_AUTOGROW
+ ,u"" PROPERTY_FONT
+ ,u"" PROPERTY_LABEL
+ ,u"" PROPERTY_LINECOLOR
+ ,u"" PROPERTY_BORDER
+ ,u"" PROPERTY_BORDERCOLOR
+ ,u"" PROPERTY_BACKTRANSPARENT
+ ,u"" PROPERTY_CONTROLBACKGROUND
+ ,u"" PROPERTY_BACKGROUNDCOLOR
+ ,u"" PROPERTY_CONTROLBACKGROUNDTRANSPARENT
+ ,u"" PROPERTY_FORMULALIST
+ ,u"" PROPERTY_SCOPE
+ ,u"" PROPERTY_TYPE
+ ,u"" PROPERTY_DATASOURCENAME
+ ,u"" PROPERTY_VERTICALALIGN
};
for (beans::Property const & prop : aProps)
diff --git a/reportdesign/source/ui/misc/RptUndo.cxx b/reportdesign/source/ui/misc/RptUndo.cxx
index 5ac23ff0c4e2..bb319b668377 100644
--- a/reportdesign/source/ui/misc/RptUndo.cxx
+++ b/reportdesign/source/ui/misc/RptUndo.cxx
@@ -284,7 +284,7 @@ void OGroupSectionUndo::implReInsert( )
{
uno::Sequence< beans::PropertyValue > aArgs(2);
- aArgs[0].Name = SID_GROUPHEADER_WITHOUT_UNDO == m_nSlot? OUStringLiteral(PROPERTY_HEADERON) : OUStringLiteral(PROPERTY_FOOTERON);
+ aArgs[0].Name = SID_GROUPHEADER_WITHOUT_UNDO == m_nSlot? OUStringLiteral(u"" PROPERTY_HEADERON) : OUStringLiteral(u"" PROPERTY_FOOTERON);
aArgs[0].Value <<= true;
aArgs[1].Name = PROPERTY_GROUP;
aArgs[1].Value <<= m_aGroupHelper.getGroup();
@@ -303,7 +303,7 @@ void OGroupSectionUndo::implReRemove( )
uno::Sequence< beans::PropertyValue > aArgs(2);
- aArgs[0].Name = SID_GROUPHEADER_WITHOUT_UNDO == m_nSlot? OUStringLiteral(PROPERTY_HEADERON) : OUStringLiteral(PROPERTY_FOOTERON);
+ aArgs[0].Name = SID_GROUPHEADER_WITHOUT_UNDO == m_nSlot? OUStringLiteral(u"" PROPERTY_HEADERON) : OUStringLiteral(u"" PROPERTY_FOOTERON);
aArgs[0].Value <<= false;
aArgs[1].Name = PROPERTY_GROUP;
aArgs[1].Value <<= m_aGroupHelper.getGroup();
diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx
index a66636c6bf91..c23bac87250a 100644
--- a/reportdesign/source/ui/report/ReportController.cxx
+++ b/reportdesign/source/ui/report/ReportController.cxx
@@ -2040,14 +2040,14 @@ void OReportController::onLoadedMenu(const Reference< frame::XLayoutManager >& _
return;
static const OUStringLiteral s_sMenu[] = {
- "private:resource/statusbar/statusbar"
- ,"private:resource/toolbar/reportcontrols"
- ,"private:resource/toolbar/drawbar"
- ,"private:resource/toolbar/Formatting"
- ,"private:resource/toolbar/alignmentbar"
- ,"private:resource/toolbar/sectionalignmentbar"
- ,"private:resource/toolbar/resizebar"
- ,"private:resource/toolbar/sectionshrinkbar"
+ u"private:resource/statusbar/statusbar"
+ ,u"private:resource/toolbar/reportcontrols"
+ ,u"private:resource/toolbar/drawbar"
+ ,u"private:resource/toolbar/Formatting"
+ ,u"private:resource/toolbar/alignmentbar"
+ ,u"private:resource/toolbar/sectionalignmentbar"
+ ,u"private:resource/toolbar/resizebar"
+ ,u"private:resource/toolbar/sectionshrinkbar"
};
for (const auto & i : s_sMenu)
{