summaryrefslogtreecommitdiff
path: root/sc/source/filter
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 /sc/source/filter
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 'sc/source/filter')
-rw-r--r--sc/source/filter/excel/xiescher.cxx8
-rw-r--r--sc/source/filter/excel/xlroot.cxx2
-rw-r--r--sc/source/filter/oox/defnamesbuffer.cxx2
-rw-r--r--sc/source/filter/oox/pagesettings.cxx10
-rw-r--r--sc/source/filter/oox/worksheethelper.cxx2
-rw-r--r--sc/source/filter/xml/XMLCodeNameProvider.cxx4
-rw-r--r--sc/source/filter/xml/XMLStylesExportHelper.cxx20
-rw-r--r--sc/source/filter/xml/xmlexprt.cxx2
-rw-r--r--sc/source/filter/xml/xmlimprt.cxx6
-rw-r--r--sc/source/filter/xml/xmlstyli.cxx8
10 files changed, 32 insertions, 32 deletions
diff --git a/sc/source/filter/excel/xiescher.cxx b/sc/source/filter/excel/xiescher.cxx
index 70252f6e6699..3944e89c03d0 100644
--- a/sc/source/filter/excel/xiescher.cxx
+++ b/sc/source/filter/excel/xiescher.cxx
@@ -468,7 +468,7 @@ SdrObjectUniquePtr XclImpDrawObjBase::CreateSdrObject( XclImpDffConverter& rDffC
{
const Reference< XControlModel >& xCtrlModel = pSdrUnoObj->GetUnoControlModel();
Reference< XPropertySet > xPropSet(xCtrlModel,UNO_QUERY);
- const static OUStringLiteral sPropertyName("ControlTypeinMSO");
+ const static OUStringLiteral sPropertyName(u"ControlTypeinMSO");
enum { eCreateFromOffice = 0, eCreateFromMSTBXControl, eCreateFromMSOCXControl };
@@ -488,7 +488,7 @@ SdrObjectUniquePtr XclImpDrawObjBase::CreateSdrObject( XclImpDffConverter& rDffC
if( mnObjType == 8 )//OCX
{
//Need summary type for export
- const static OUStringLiteral sObjIdPropertyName("ObjIDinMSO");
+ const static OUStringLiteral sObjIdPropertyName(u"ObjIDinMSO");
const XclImpPictureObj* const pObj = dynamic_cast< const XclImpPictureObj* const >(this);
if( pObj != nullptr && pObj->IsOcxControl() )
{
@@ -2918,7 +2918,7 @@ OUString XclImpPictureObj::GetOleStorageName() const
OUStringBuffer aStrgName;
if( (mbEmbedded || mbLinked) && !mbControl && (mnStorageId > 0) )
{
- aStrgName = mbEmbedded ? OUStringLiteral(EXC_STORAGE_OLE_EMBEDDED) : OUStringLiteral(EXC_STORAGE_OLE_LINKED);
+ aStrgName = mbEmbedded ? OUStringLiteral(u"" EXC_STORAGE_OLE_EMBEDDED) : OUStringLiteral(u"" EXC_STORAGE_OLE_LINKED);
static const char spcHexChars[] = "0123456789ABCDEF";
for( sal_uInt8 nIndex = 32; nIndex > 0; nIndex -= 4 )
aStrgName.append(OUStringChar( spcHexChars[ ::extract_value< sal_uInt8 >( mnStorageId, nIndex - 4, 4 ) ] ));
@@ -3299,7 +3299,7 @@ XclImpDffConverter::XclImpDffConvData::XclImpDffConvData(
{
}
-const OUStringLiteral gaStdFormName( "Standard" ); /// Standard name of control forms.
+const OUStringLiteral gaStdFormName( u"Standard" ); /// Standard name of control forms.
XclImpDffConverter::XclImpDffConverter( const XclImpRoot& rRoot, SvStream& rDffStrm ) :
XclImpSimpleDffConverter( rRoot, rDffStrm ),
diff --git a/sc/source/filter/excel/xlroot.cxx b/sc/source/filter/excel/xlroot.cxx
index d780b1c18723..32f04f61ed40 100644
--- a/sc/source/filter/excel/xlroot.cxx
+++ b/sc/source/filter/excel/xlroot.cxx
@@ -79,7 +79,7 @@ XclDebugObjCounter::~XclDebugObjCounter()
}
#endif
-const OUStringLiteral XclRootData::gaDefPassword( "VelvetSweatshop" );
+const OUStringLiteral XclRootData::gaDefPassword( u"VelvetSweatshop" );
XclRootData::XclRootData( XclBiff eBiff, SfxMedium& rMedium,
tools::SvRef<SotStorage> const & xRootStrg, ScDocument& rDoc, rtl_TextEncoding eTextEnc, bool bExport ) :
diff --git a/sc/source/filter/oox/defnamesbuffer.cxx b/sc/source/filter/oox/defnamesbuffer.cxx
index ed2b041dcd0f..6106a413aa57 100644
--- a/sc/source/filter/oox/defnamesbuffer.cxx
+++ b/sc/source/filter/oox/defnamesbuffer.cxx
@@ -53,7 +53,7 @@ const sal_uInt32 BIFF12_DEFNAME_VBNAME = 0x00000004;
const sal_uInt32 BIFF12_DEFNAME_MACRO = 0x00000008;
const sal_uInt32 BIFF12_DEFNAME_BUILTIN = 0x00000020;
-const OUStringLiteral spcOoxPrefix("_xlnm.");
+const OUStringLiteral spcOoxPrefix(u"_xlnm.");
const char* const sppcBaseNames[] =
{
diff --git a/sc/source/filter/oox/pagesettings.cxx b/sc/source/filter/oox/pagesettings.cxx
index e47fee274329..2d7f49988cc2 100644
--- a/sc/source/filter/oox/pagesettings.cxx
+++ b/sc/source/filter/oox/pagesettings.cxx
@@ -470,11 +470,11 @@ const char* const sppcItalicNames[] =
} // namespace
-const OUStringLiteral gaPageNumberService( "com.sun.star.text.TextField.PageNumber" );
-const OUStringLiteral gaPageCountService( "com.sun.star.text.TextField.PageCount" );
-const OUStringLiteral gaSheetNameService( "com.sun.star.text.TextField.SheetName" );
-const OUStringLiteral gaFileNameService( "com.sun.star.text.TextField.FileName" );
-const OUStringLiteral gaDateTimeService( "com.sun.star.text.TextField.DateTime" );
+const OUStringLiteral gaPageNumberService( u"com.sun.star.text.TextField.PageNumber" );
+const OUStringLiteral gaPageCountService( u"com.sun.star.text.TextField.PageCount" );
+const OUStringLiteral gaSheetNameService( u"com.sun.star.text.TextField.SheetName" );
+const OUStringLiteral gaFileNameService( u"com.sun.star.text.TextField.FileName" );
+const OUStringLiteral gaDateTimeService( u"com.sun.star.text.TextField.DateTime" );
HeaderFooterParser::HeaderFooterParser( const WorkbookHelper& rHelper ) :
WorkbookHelper( rHelper ),
diff --git a/sc/source/filter/oox/worksheethelper.cxx b/sc/source/filter/oox/worksheethelper.cxx
index e7889b5e0d37..2616ca4ef973 100644
--- a/sc/source/filter/oox/worksheethelper.cxx
+++ b/sc/source/filter/oox/worksheethelper.cxx
@@ -389,7 +389,7 @@ private:
bool mbHasDefWidth; /// True = default column width is set from defaultColWidth attribute.
};
-const OUStringLiteral gaSheetCellRanges( "com.sun.star.sheet.SheetCellRanges" ); /// Service name for a SheetCellRanges object.
+const OUStringLiteral gaSheetCellRanges( u"com.sun.star.sheet.SheetCellRanges" ); /// Service name for a SheetCellRanges object.
WorksheetGlobals::WorksheetGlobals( const WorkbookHelper& rHelper, const ISegmentProgressBarRef& rxProgressBar, WorksheetType eSheetType, SCTAB nSheet ) :
WorkbookHelper( rHelper ),
diff --git a/sc/source/filter/xml/XMLCodeNameProvider.cxx b/sc/source/filter/xml/XMLCodeNameProvider.cxx
index d7ed3fde5425..103a157e447a 100644
--- a/sc/source/filter/xml/XMLCodeNameProvider.cxx
+++ b/sc/source/filter/xml/XMLCodeNameProvider.cxx
@@ -46,8 +46,8 @@ bool XMLCodeNameProvider::_getCodeName( const uno::Any& aAny, OUString& rCodeNam
return false;
}
-constexpr OUStringLiteral gsDocName( "*doc*" );
-constexpr OUStringLiteral gsCodeNameProp( "CodeName" );
+constexpr OUStringLiteral gsDocName( u"*doc*" );
+constexpr OUStringLiteral gsCodeNameProp( u"CodeName" );
XMLCodeNameProvider::XMLCodeNameProvider( ScDocument* pDoc ) :
mpDoc( pDoc )
diff --git a/sc/source/filter/xml/XMLStylesExportHelper.cxx b/sc/source/filter/xml/XMLStylesExportHelper.cxx
index bdf2e4cf7972..cc9133da19b4 100644
--- a/sc/source/filter/xml/XMLStylesExportHelper.cxx
+++ b/sc/source/filter/xml/XMLStylesExportHelper.cxx
@@ -75,16 +75,16 @@ bool ScMyValidation::IsEqual(const ScMyValidation& aVal) const
aVal.sFormula2 == sFormula2;
}
-const OUStringLiteral gsERRALSTY(SC_UNONAME_ERRALSTY);
-const OUStringLiteral gsIGNOREBL(SC_UNONAME_IGNOREBL);
-const OUStringLiteral gsSHOWLIST(SC_UNONAME_SHOWLIST);
-const OUStringLiteral gsTYPE(SC_UNONAME_TYPE);
-const OUStringLiteral gsSHOWINP(SC_UNONAME_SHOWINP);
-const OUStringLiteral gsSHOWERR(SC_UNONAME_SHOWERR);
-const OUStringLiteral gsINPTITLE(SC_UNONAME_INPTITLE);
-const OUStringLiteral gsINPMESS(SC_UNONAME_INPMESS);
-const OUStringLiteral gsERRTITLE(SC_UNONAME_ERRTITLE);
-const OUStringLiteral gsERRMESS(SC_UNONAME_ERRMESS);
+const OUStringLiteral gsERRALSTY(u"" SC_UNONAME_ERRALSTY);
+const OUStringLiteral gsIGNOREBL(u"" SC_UNONAME_IGNOREBL);
+const OUStringLiteral gsSHOWLIST(u"" SC_UNONAME_SHOWLIST);
+const OUStringLiteral gsTYPE(u"" SC_UNONAME_TYPE);
+const OUStringLiteral gsSHOWINP(u"" SC_UNONAME_SHOWINP);
+const OUStringLiteral gsSHOWERR(u"" SC_UNONAME_SHOWERR);
+const OUStringLiteral gsINPTITLE(u"" SC_UNONAME_INPTITLE);
+const OUStringLiteral gsINPMESS(u"" SC_UNONAME_INPMESS);
+const OUStringLiteral gsERRTITLE(u"" SC_UNONAME_ERRTITLE);
+const OUStringLiteral gsERRMESS(u"" SC_UNONAME_ERRMESS);
ScMyValidationsContainer::ScMyValidationsContainer()
: aValidationVec()
diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx
index d2f7250f8a95..c3f617acb96e 100644
--- a/sc/source/filter/xml/xmlexprt.cxx
+++ b/sc/source/filter/xml/xmlexprt.cxx
@@ -336,7 +336,7 @@ sal_Int16 ScXMLExport::GetMeasureUnit()
return SvXMLUnitConverter::GetMeasureUnit(eFieldUnit);
}
-const OUStringLiteral gsLayerID( SC_LAYERID );
+const OUStringLiteral gsLayerID( u"" SC_LAYERID );
ScXMLExport::ScXMLExport(
const css::uno::Reference< css::uno::XComponentContext >& rContext,
diff --git a/sc/source/filter/xml/xmlimprt.cxx b/sc/source/filter/xml/xmlimprt.cxx
index d110030aca6b..6cc383d23bd7 100644
--- a/sc/source/filter/xml/xmlimprt.cxx
+++ b/sc/source/filter/xml/xmlimprt.cxx
@@ -550,9 +550,9 @@ SvXMLImportContext *ScXMLImport::CreateFastContext( sal_Int32 nElement,
return pContext;
}
-constexpr OUStringLiteral gsNumberFormat(SC_UNONAME_NUMFMT);
-constexpr OUStringLiteral gsLocale(SC_LOCALE);
-constexpr OUStringLiteral gsCellStyle(SC_UNONAME_CELLSTYL);
+constexpr OUStringLiteral gsNumberFormat(u"" SC_UNONAME_NUMFMT);
+constexpr OUStringLiteral gsLocale(u"" SC_LOCALE);
+constexpr OUStringLiteral gsCellStyle(u"" SC_UNONAME_CELLSTYL);
ScXMLImport::ScXMLImport(
const css::uno::Reference< css::uno::XComponentContext >& rContext,
diff --git a/sc/source/filter/xml/xmlstyli.cxx b/sc/source/filter/xml/xmlstyli.cxx
index 9569fa52e417..364b212cd393 100644
--- a/sc/source/filter/xml/xmlstyli.cxx
+++ b/sc/source/filter/xml/xmlstyli.cxx
@@ -670,10 +670,10 @@ SvXMLStyleContext *XMLTableStylesContext::CreateDefaultStyleStyleChildContext(
return pStyle;
}
-const OUStringLiteral gsCellStyleServiceName("com.sun.star.style.CellStyle");
-const OUStringLiteral gsColumnStyleServiceName(XML_STYLE_FAMILY_TABLE_COLUMN_STYLES_NAME);
-const OUStringLiteral gsRowStyleServiceName(XML_STYLE_FAMILY_TABLE_ROW_STYLES_NAME);
-const OUStringLiteral gsTableStyleServiceName(XML_STYLE_FAMILY_TABLE_TABLE_STYLES_NAME);
+const OUStringLiteral gsCellStyleServiceName(u"com.sun.star.style.CellStyle");
+const OUStringLiteral gsColumnStyleServiceName(u"" XML_STYLE_FAMILY_TABLE_COLUMN_STYLES_NAME);
+const OUStringLiteral gsRowStyleServiceName(u"" XML_STYLE_FAMILY_TABLE_ROW_STYLES_NAME);
+const OUStringLiteral gsTableStyleServiceName(u"" XML_STYLE_FAMILY_TABLE_TABLE_STYLES_NAME);
XMLTableStylesContext::XMLTableStylesContext( SvXMLImport& rImport,
const bool bTempAutoStyles )