sc/source/core/data/dpobject.cxx | 10 ++--- sc/source/core/data/tabprotection.cxx | 8 ++-- sc/source/core/tool/addincfg.cxx | 2 - sc/source/core/tool/addincol.cxx | 14 +++---- sc/source/core/tool/appoptio.cxx | 14 +++---- sc/source/core/tool/callform.cxx | 14 +++---- sc/source/core/tool/defaultsoptions.cxx | 2 - sc/source/core/tool/docoptio.cxx | 4 +- sc/source/core/tool/filtopt.cxx | 2 - sc/source/core/tool/formulaopt.cxx | 2 - sc/source/core/tool/inputopt.cxx | 2 - sc/source/core/tool/printopt.cxx | 2 - sc/source/core/tool/stylehelper.cxx | 31 ++++++++--------- sc/source/core/tool/unitconv.cxx | 8 ++-- sc/source/core/tool/viewopti.cxx | 6 +-- sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx | 6 +-- sc/source/filter/xml/XMLExportDatabaseRanges.cxx | 2 - sc/source/filter/xml/XMLTableShapeImportHelper.cxx | 2 - sc/source/filter/xml/xmlexprt.cxx | 6 +-- sc/source/filter/xml/xmlimprt.cxx | 28 ++++++--------- sc/source/filter/xml/xmlrowi.cxx | 2 - sc/source/ui/app/scmod.cxx | 2 - sc/source/ui/dbgui/csvruler.cxx | 4 +- sc/source/ui/docshell/dbdocimp.cxx | 8 ++-- sc/source/ui/docshell/docsh8.cxx | 26 +++++++------- sc/source/ui/miscdlgs/linkarea.cxx | 4 +- sc/source/ui/miscdlgs/solverutil.cxx | 2 - sc/source/ui/unoobj/afmtuno.cxx | 2 - sc/source/ui/unoobj/appluno.cxx | 6 +-- sc/source/ui/unoobj/cellsuno.cxx | 18 ++++----- sc/source/ui/unoobj/confuno.cxx | 4 +- sc/source/ui/unoobj/cursuno.cxx | 4 +- sc/source/ui/unoobj/dapiuno.cxx | 2 - sc/source/ui/unoobj/docuno.cxx | 10 ++--- sc/source/ui/unoobj/filtuno.cxx | 24 ++++++------- sc/source/ui/unoobj/funcuno.cxx | 4 +- sc/source/ui/unoobj/nameuno.cxx | 2 - sc/source/ui/unoobj/shapeuno.cxx | 6 +-- sc/source/ui/unoobj/srchuno.cxx | 4 +- sc/source/ui/unoobj/styleuno.cxx | 12 +++--- sc/source/ui/unoobj/viewuno.cxx | 4 +- sc/source/ui/vba/vbaformat.cxx | 4 +- sc/source/ui/view/viewdata.cxx | 4 +- 43 files changed, 157 insertions(+), 166 deletions(-)
New commits: commit 9c5744adbd97821b5574d55266f8a4e60fd925da Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Mon Aug 2 08:45:04 2021 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Mon Aug 2 09:49:56 2021 +0200 convert #defines to OUStringLiteral mostly by doing $ git grep -l '#define.*\"' -- *.cxx | xargs perl -pi -e 's/^#define\s+(\w+)\s+(\".*\")/constexpr OUStringLiteral \1 = u\2;/g' Change-Id: I7467f9067085ac89b98a0398811396c448339b4a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119840 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx index f3a494694003..287ccbcd36f3 100644 --- a/sc/source/core/data/dpobject.cxx +++ b/sc/source/core/data/dpobject.cxx @@ -94,13 +94,13 @@ using ::com::sun::star::sheet::DataPilotTablePositionData; using ::com::sun::star::sheet::XDimensionsSupplier; using ::com::sun::star::beans::XPropertySet; -#define SC_SERVICE_ROWSET "com.sun.star.sdb.RowSet" +constexpr OUStringLiteral SC_SERVICE_ROWSET = u"com.sun.star.sdb.RowSet"; -#define SC_DBPROP_DATASOURCENAME "DataSourceName" -#define SC_DBPROP_COMMAND "Command" -#define SC_DBPROP_COMMANDTYPE "CommandType" +constexpr OUStringLiteral SC_DBPROP_DATASOURCENAME = u"DataSourceName"; +constexpr OUStringLiteral SC_DBPROP_COMMAND = u"Command"; +constexpr OUStringLiteral SC_DBPROP_COMMANDTYPE = u"CommandType"; -#define SCDPSOURCE_SERVICE "com.sun.star.sheet.DataPilotSource" +constexpr OUStringLiteral SCDPSOURCE_SERVICE = u"com.sun.star.sheet.DataPilotSource"; namespace { diff --git a/sc/source/core/data/tabprotection.cxx b/sc/source/core/data/tabprotection.cxx index c0cc81852190..4abfeb432902 100644 --- a/sc/source/core/data/tabprotection.cxx +++ b/sc/source/core/data/tabprotection.cxx @@ -29,10 +29,10 @@ #define DEBUG_TAB_PROTECTION 0 -#define URI_SHA1 u"http://www.w3.org/2000/09/xmldsig#sha1" -#define URI_SHA256_ODF12 u"http://www.w3.org/2000/09/xmldsig#sha256" -#define URI_SHA256_W3C u"http://www.w3.org/2001/04/xmlenc#sha256" -#define URI_XLS_LEGACY u"http://docs.oasis-open.org/office/ns/table/legacy-hash-excel" +constexpr OUStringLiteral URI_SHA1 = u"http://www.w3.org/2000/09/xmldsig#sha1"; +constexpr OUStringLiteral URI_SHA256_ODF12 = u"http://www.w3.org/2000/09/xmldsig#sha256"; +constexpr OUStringLiteral URI_SHA256_W3C = u"http://www.w3.org/2001/04/xmlenc#sha256"; +constexpr OUStringLiteral URI_XLS_LEGACY = u"http://docs.oasis-open.org/office/ns/table/legacy-hash-excel"; using namespace ::com::sun::star; using ::com::sun::star::uno::Sequence; diff --git a/sc/source/core/tool/addincfg.cxx b/sc/source/core/tool/addincfg.cxx index 292e822a57e7..7fc58e3b9dd8 100644 --- a/sc/source/core/tool/addincfg.cxx +++ b/sc/source/core/tool/addincfg.cxx @@ -29,7 +29,7 @@ using namespace com::sun::star; -#define CFGPATH_ADDINS "Office.CalcAddIns/AddInInfo" +constexpr OUStringLiteral CFGPATH_ADDINS = u"Office.CalcAddIns/AddInInfo"; ScAddInCfg::ScAddInCfg() : ConfigItem(CFGPATH_ADDINS) diff --git a/sc/source/core/tool/addincol.cxx b/sc/source/core/tool/addincol.cxx index 210e2674e9ec..986acb4aeb92 100644 --- a/sc/source/core/tool/addincol.cxx +++ b/sc/source/core/tool/addincol.cxx @@ -319,20 +319,20 @@ static sal_uInt16 lcl_GetCategory( const OUString& rName ) return ID_FUNCTION_GRP_ADDINS; // if not found, use Add-In group } -#define CFGPATH_ADDINS "Office.CalcAddIns/AddInInfo" -#define CFGSTR_ADDINFUNCTIONS "AddInFunctions" +constexpr OUStringLiteral CFGPATH_ADDINS = u"Office.CalcAddIns/AddInInfo"; +constexpr OUStringLiteral CFGSTR_ADDINFUNCTIONS = u"AddInFunctions"; #define CFG_FUNCPROP_DISPLAYNAME 0 #define CFG_FUNCPROP_DESCRIPTION 1 #define CFG_FUNCPROP_CATEGORY 2 #define CFG_FUNCPROP_COUNT 3 -#define CFGSTR_DISPLAYNAME "DisplayName" -#define CFGSTR_DESCRIPTION "Description" -#define CFGSTR_CATEGORY "Category" +constexpr OUStringLiteral CFGSTR_DISPLAYNAME = u"DisplayName"; +constexpr OUStringLiteral CFGSTR_DESCRIPTION = u"Description"; +constexpr OUStringLiteral CFGSTR_CATEGORY = u"Category"; // CategoryDisplayName is ignored for now -#define CFGSTR_COMPATIBILITYNAME "CompatibilityName" -#define CFGSTR_PARAMETERS "Parameters" +constexpr OUStringLiteral CFGSTR_COMPATIBILITYNAME = u"CompatibilityName"; +constexpr OUStringLiteral CFGSTR_PARAMETERS = u"Parameters"; void ScUnoAddInCollection::ReadConfiguration() { diff --git a/sc/source/core/tool/appoptio.cxx b/sc/source/core/tool/appoptio.cxx index 1bc0b2540e6b..df16580e2e2b 100644 --- a/sc/source/core/tool/appoptio.cxx +++ b/sc/source/core/tool/appoptio.cxx @@ -199,7 +199,7 @@ static void lcl_GetSortList( Any& rDest ) rDest <<= Sequence<OUString>(0); // empty } -#define CFGPATH_LAYOUT "Office.Calc/Layout" +constexpr OUStringLiteral CFGPATH_LAYOUT = u"Office.Calc/Layout"; #define SCLAYOUTOPT_MEASURE 0 #define SCLAYOUTOPT_STATUSBAR 1 @@ -208,34 +208,34 @@ static void lcl_GetSortList( Any& rDest ) #define SCLAYOUTOPT_SYNCZOOM 4 #define SCLAYOUTOPT_STATUSBARMULTI 5 -#define CFGPATH_INPUT "Office.Calc/Input" +constexpr OUStringLiteral CFGPATH_INPUT = u"Office.Calc/Input"; #define SCINPUTOPT_LASTFUNCS 0 #define SCINPUTOPT_AUTOINPUT 1 #define SCINPUTOPT_DET_AUTO 2 -#define CFGPATH_REVISION "Office.Calc/Revision/Color" +constexpr OUStringLiteral CFGPATH_REVISION = u"Office.Calc/Revision/Color"; #define SCREVISOPT_CHANGE 0 #define SCREVISOPT_INSERTION 1 #define SCREVISOPT_DELETION 2 #define SCREVISOPT_MOVEDENTRY 3 -#define CFGPATH_CONTENT "Office.Calc/Content/Update" +constexpr OUStringLiteral CFGPATH_CONTENT = u"Office.Calc/Content/Update"; #define SCCONTENTOPT_LINK 0 -#define CFGPATH_SORTLIST "Office.Calc/SortList" +constexpr OUStringLiteral CFGPATH_SORTLIST = u"Office.Calc/SortList"; #define SCSORTLISTOPT_LIST 0 -#define CFGPATH_MISC "Office.Calc/Misc" +constexpr OUStringLiteral CFGPATH_MISC = u"Office.Calc/Misc"; #define SCMISCOPT_DEFOBJWIDTH 0 #define SCMISCOPT_DEFOBJHEIGHT 1 #define SCMISCOPT_SHOWSHAREDDOCWARN 2 -#define CFGPATH_COMPAT "Office.Calc/Compatibility" +constexpr OUStringLiteral CFGPATH_COMPAT = u"Office.Calc/Compatibility"; #define SCCOMPATOPT_KEY_BINDING 0 diff --git a/sc/source/core/tool/callform.cxx b/sc/source/core/tool/callform.cxx index 07b07a46e005..5a7fce85254e 100644 --- a/sc/source/core/tool/callform.cxx +++ b/sc/source/core/tool/callform.cxx @@ -65,13 +65,13 @@ typedef void (CALLTYPE* Unadvice)( double& nHandle ); } #ifndef DISABLE_DYNLOADING -#define GETFUNCTIONCOUNT "GetFunctionCount" -#define GETFUNCTIONDATA "GetFunctionData" -#define SETLANGUAGE "SetLanguage" -#define GETPARAMDESC "GetParameterDescription" -#define ISASYNC "IsAsync" -#define ADVICE "Advice" -#define UNADVICE "Unadvice" +constexpr OUStringLiteral GETFUNCTIONCOUNT = u"GetFunctionCount"; +constexpr OUStringLiteral GETFUNCTIONDATA = u"GetFunctionData"; +constexpr OUStringLiteral SETLANGUAGE = u"SetLanguage"; +constexpr OUStringLiteral GETPARAMDESC = u"GetParameterDescription"; +constexpr OUStringLiteral ISASYNC = u"IsAsync"; +constexpr OUStringLiteral ADVICE = u"Advice"; +constexpr OUStringLiteral UNADVICE = u"Unadvice"; #endif class ModuleData diff --git a/sc/source/core/tool/defaultsoptions.cxx b/sc/source/core/tool/defaultsoptions.cxx index 75636dc36408..df75dcb2dab4 100644 --- a/sc/source/core/tool/defaultsoptions.cxx +++ b/sc/source/core/tool/defaultsoptions.cxx @@ -61,7 +61,7 @@ ScTpDefaultsItem* ScTpDefaultsItem::Clone( SfxItemPool * ) const return new ScTpDefaultsItem( *this ); } -#define CFGPATH_FORMULA "Office.Calc/Defaults" +constexpr OUStringLiteral CFGPATH_FORMULA = u"Office.Calc/Defaults"; #define SCDEFAULTSOPT_TAB_COUNT 0 #define SCDEFAULTSOPT_TAB_PREFIX 1 diff --git a/sc/source/core/tool/docoptio.cxx b/sc/source/core/tool/docoptio.cxx index 631581375bce..5810bff6e8ea 100644 --- a/sc/source/core/tool/docoptio.cxx +++ b/sc/source/core/tool/docoptio.cxx @@ -133,7 +133,7 @@ ScTpCalcItem* ScTpCalcItem::Clone( SfxItemPool * ) const // Config Item containing document options -#define CFGPATH_CALC "Office.Calc/Calculate" +constexpr OUStringLiteral CFGPATH_CALC = u"Office.Calc/Calculate"; #define SCCALCOPT_ITER_ITER 0 #define SCCALCOPT_ITER_STEPS 1 @@ -149,7 +149,7 @@ ScTpCalcItem* ScTpCalcItem::Clone( SfxItemPool * ) const #define SCCALCOPT_REGEX 11 #define SCCALCOPT_WILDCARDS 12 -#define CFGPATH_DOCLAYOUT "Office.Calc/Layout/Other" +constexpr OUStringLiteral CFGPATH_DOCLAYOUT = u"Office.Calc/Layout/Other"; #define SCDOCLAYOUTOPT_TABSTOP 0 diff --git a/sc/source/core/tool/filtopt.cxx b/sc/source/core/tool/filtopt.cxx index 93ab7bac3302..13c856150dcd 100644 --- a/sc/source/core/tool/filtopt.cxx +++ b/sc/source/core/tool/filtopt.cxx @@ -27,7 +27,7 @@ using namespace utl; using namespace css::uno; -#define CFGPATH_FILTER "Office.Calc/Filter/Import" +constexpr OUStringLiteral CFGPATH_FILTER = u"Office.Calc/Filter/Import"; #define SCFILTOPT_WK3 2 diff --git a/sc/source/core/tool/formulaopt.cxx b/sc/source/core/tool/formulaopt.cxx index 7305c3d550e6..d72e8e7db906 100644 --- a/sc/source/core/tool/formulaopt.cxx +++ b/sc/source/core/tool/formulaopt.cxx @@ -146,7 +146,7 @@ ScTpFormulaItem* ScTpFormulaItem::Clone( SfxItemPool * ) const return new ScTpFormulaItem( *this ); } -#define CFGPATH_FORMULA "Office.Calc/Formula" +constexpr OUStringLiteral CFGPATH_FORMULA = u"Office.Calc/Formula"; #define SCFORMULAOPT_GRAMMAR 0 #define SCFORMULAOPT_ENGLISH_FUNCNAME 1 diff --git a/sc/source/core/tool/inputopt.cxx b/sc/source/core/tool/inputopt.cxx index 119c7a74c738..5152a01beac3 100644 --- a/sc/source/core/tool/inputopt.cxx +++ b/sc/source/core/tool/inputopt.cxx @@ -54,7 +54,7 @@ void ScInputOptions::SetDefaults() // Config Item containing input options -#define CFGPATH_INPUT "Office.Calc/Input" +constexpr OUStringLiteral CFGPATH_INPUT = u"Office.Calc/Input"; #define SCINPUTOPT_MOVEDIR 0 #define SCINPUTOPT_MOVESEL 1 diff --git a/sc/source/core/tool/printopt.cxx b/sc/source/core/tool/printopt.cxx index dfbe413c0458..b598672b2442 100644 --- a/sc/source/core/tool/printopt.cxx +++ b/sc/source/core/tool/printopt.cxx @@ -71,7 +71,7 @@ ScTpPrintItem* ScTpPrintItem::Clone( SfxItemPool * ) const return new ScTpPrintItem( *this ); } -#define CFGPATH_PRINT "Office.Calc/Print" +constexpr OUStringLiteral CFGPATH_PRINT = u"Office.Calc/Print"; #define SCPRINTOPT_EMPTYPAGES 0 #define SCPRINTOPT_ALLSHEETS 1 diff --git a/sc/source/core/tool/stylehelper.cxx b/sc/source/core/tool/stylehelper.cxx index 88a7c77f7f5c..076e968265ff 100644 --- a/sc/source/core/tool/stylehelper.cxx +++ b/sc/source/core/tool/stylehelper.cxx @@ -29,19 +29,19 @@ // the api is required to use programmatic names for default styles // these programmatic names must never change! -#define SC_STYLE_PROG_STANDARD "Default" -#define SC_STYLE_PROG_RESULT "Result" -#define SC_STYLE_PROG_RESULT1 "Result2" -#define SC_STYLE_PROG_HEADING "Heading" -#define SC_STYLE_PROG_HEADING1 "Heading1" -#define SC_STYLE_PROG_REPORT "Report" - -#define SC_PIVOT_STYLE_PROG_INNER "Pivot Table Value" -#define SC_PIVOT_STYLE_PROG_RESULT "Pivot Table Result" -#define SC_PIVOT_STYLE_PROG_CATEGORY "Pivot Table Category" -#define SC_PIVOT_STYLE_PROG_TITLE "Pivot Table Title" -#define SC_PIVOT_STYLE_PROG_FIELDNAME "Pivot Table Field" -#define SC_PIVOT_STYLE_PROG_TOP "Pivot Table Corner" +constexpr OUStringLiteral SC_STYLE_PROG_STANDARD = u"Default"; +constexpr OUStringLiteral SC_STYLE_PROG_RESULT = u"Result"; +constexpr OUStringLiteral SC_STYLE_PROG_RESULT1 = u"Result2"; +constexpr OUStringLiteral SC_STYLE_PROG_HEADING = u"Heading"; +constexpr OUStringLiteral SC_STYLE_PROG_HEADING1 = u"Heading1"; +constexpr OUStringLiteral SC_STYLE_PROG_REPORT = u"Report"; + +constexpr OUStringLiteral SC_PIVOT_STYLE_PROG_INNER = u"Pivot Table Value"; +constexpr OUStringLiteral SC_PIVOT_STYLE_PROG_RESULT = u"Pivot Table Result"; +constexpr OUStringLiteral SC_PIVOT_STYLE_PROG_CATEGORY = u"Pivot Table Category"; +constexpr OUStringLiteral SC_PIVOT_STYLE_PROG_TITLE = u"Pivot Table Title"; +constexpr OUStringLiteral SC_PIVOT_STYLE_PROG_FIELDNAME = u"Pivot Table Field"; +constexpr OUStringLiteral SC_PIVOT_STYLE_PROG_TOP = u"Pivot Table Corner"; namespace { @@ -118,8 +118,7 @@ static const ScDisplayNameMap* lcl_GetStyleNameMap( SfxStyleFamily nType ) // programmatic name suffix for display names that match other programmatic names // is " (user)" including a space -#define SC_SUFFIX_USER " (user)" -#define SC_SUFFIX_USER_LEN 7 +constexpr OUStringLiteral SC_SUFFIX_USER = u" (user)"; static bool lcl_EndsWithUser( const OUString& rString ) { @@ -158,7 +157,7 @@ OUString ScStyleNameConversion::ProgrammaticToDisplayName( const OUString& rProg if ( lcl_EndsWithUser( rProgName ) ) { // remove the (user) suffix, don't compare to map entries - return rProgName.copy( 0, rProgName.getLength() - SC_SUFFIX_USER_LEN ); + return rProgName.copy( 0, rProgName.getLength() - SC_SUFFIX_USER.getLength() ); } const ScDisplayNameMap* pNames = lcl_GetStyleNameMap( nType ); diff --git a/sc/source/core/tool/unitconv.cxx b/sc/source/core/tool/unitconv.cxx index 4a8bc7839be9..1f5337cd8196 100644 --- a/sc/source/core/tool/unitconv.cxx +++ b/sc/source/core/tool/unitconv.cxx @@ -41,10 +41,10 @@ OUString ScUnitConverterData::BuildIndexString( } // ScUnitConverter -#define CFGPATH_UNIT "Office.Calc/UnitConversion" -#define CFGSTR_UNIT_FROM "FromUnit" -#define CFGSTR_UNIT_TO "ToUnit" -#define CFGSTR_UNIT_FACTOR "Factor" +constexpr OUStringLiteral CFGPATH_UNIT = u"Office.Calc/UnitConversion"; +constexpr OUStringLiteral CFGSTR_UNIT_FROM = u"FromUnit"; +constexpr OUStringLiteral CFGSTR_UNIT_TO = u"ToUnit"; +constexpr OUStringLiteral CFGSTR_UNIT_FACTOR = u"Factor"; ScUnitConverter::ScUnitConverter() { diff --git a/sc/source/core/tool/viewopti.cxx b/sc/source/core/tool/viewopti.cxx index 1658cfc65ef7..186db99d8ce8 100644 --- a/sc/source/core/tool/viewopti.cxx +++ b/sc/source/core/tool/viewopti.cxx @@ -186,7 +186,7 @@ ScTpViewItem* ScTpViewItem::Clone( SfxItemPool * ) const // Config Item containing view options -#define CFGPATH_LAYOUT "Office.Calc/Layout" +constexpr OUStringLiteral CFGPATH_LAYOUT = u"Office.Calc/Layout"; #define SCLAYOUTOPT_GRIDLINES 0 #define SCLAYOUTOPT_GRIDCOLOR 1 @@ -201,7 +201,7 @@ ScTpViewItem* ScTpViewItem::Clone( SfxItemPool * ) const #define SCLAYOUTOPT_SUMMARY 10 #define SCLAYOUTOPT_THEMEDCURSOR 11 -#define CFGPATH_DISPLAY "Office.Calc/Content/Display" +constexpr OUStringLiteral CFGPATH_DISPLAY = u"Office.Calc/Content/Display"; #define SCDISPLAYOPT_FORMULA 0 #define SCDISPLAYOPT_ZEROVALUE 1 @@ -213,7 +213,7 @@ ScTpViewItem* ScTpViewItem::Clone( SfxItemPool * ) const #define SCDISPLAYOPT_CHART 7 #define SCDISPLAYOPT_DRAWING 8 -#define CFGPATH_GRID "Office.Calc/Grid" +constexpr OUStringLiteral CFGPATH_GRID = u"Office.Calc/Grid"; #define SCGRIDOPT_RESOLU_X 0 #define SCGRIDOPT_RESOLU_Y 1 diff --git a/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx b/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx index 80bf77187c0a..aabe42f6d4ce 100644 --- a/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx +++ b/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx @@ -26,7 +26,7 @@ #include <svl/zforlist.hxx> #include <sax/tools/converter.hxx> -#define SC_CHANGE_ID_PREFIX "ct" +constexpr OStringLiteral SC_CHANGE_ID_PREFIX = "ct"; ScMyCellInfo::ScMyCellInfo( const ScCellValue& rCell, const OUString& rFormulaAddress, const OUString& rFormula, @@ -198,10 +198,10 @@ sal_uInt32 ScXMLChangeTrackingImportHelper::GetIDFromString(std::string_view sID sal_uInt32 nResult(0); if (!sID.empty()) { - if (sID.substr(0, strlen(SC_CHANGE_ID_PREFIX)) == SC_CHANGE_ID_PREFIX) + if (sID.substr(0, SC_CHANGE_ID_PREFIX.getLength()) == SC_CHANGE_ID_PREFIX) { sal_Int32 nValue; - ::sax::Converter::convertNumber(nValue, sID.substr(strlen(SC_CHANGE_ID_PREFIX))); + ::sax::Converter::convertNumber(nValue, sID.substr(SC_CHANGE_ID_PREFIX.getLength())); OSL_ENSURE(nValue > 0, "wrong change action ID"); nResult = nValue; } diff --git a/sc/source/filter/xml/XMLExportDatabaseRanges.cxx b/sc/source/filter/xml/XMLExportDatabaseRanges.cxx index db50c1ecd703..437b2704f5a9 100644 --- a/sc/source/filter/xml/XMLExportDatabaseRanges.cxx +++ b/sc/source/filter/xml/XMLExportDatabaseRanges.cxx @@ -50,7 +50,7 @@ #include <map> //! not found in unonames.hxx -#define SC_USERLIST "UserList" +constexpr OUStringLiteral SC_USERLIST = u"UserList"; using namespace com::sun::star; using namespace xmloff::token; diff --git a/sc/source/filter/xml/XMLTableShapeImportHelper.cxx b/sc/source/filter/xml/XMLTableShapeImportHelper.cxx index 1bfcd6064c00..e6066acebc85 100644 --- a/sc/source/filter/xml/XMLTableShapeImportHelper.cxx +++ b/sc/source/filter/xml/XMLTableShapeImportHelper.cxx @@ -33,7 +33,7 @@ #include <com/sun/star/drawing/XShape.hpp> #include <com/sun/star/drawing/XShapes.hpp> -#define SC_LAYERID "LayerID" +constexpr OUStringLiteral SC_LAYERID = u"LayerID"; using namespace ::com::sun::star; using namespace xmloff::token; diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx index 085d54dd1f07..4b3f155aec27 100644 --- a/sc/source/filter/xml/xmlexprt.cxx +++ b/sc/source/filter/xml/xmlexprt.cxx @@ -164,7 +164,7 @@ namespace com::sun::star::uno { class XComponentContext; } //! not found in unonames.hxx -#define SC_LAYERID "LayerID" +constexpr OUStringLiteral SC_LAYERID = u"LayerID"; #define SC_VIEWCHANGES_COUNT 13 #define SC_SHOW_CHANGES 0 @@ -339,8 +339,6 @@ sal_Int16 ScXMLExport::GetMeasureUnit() return SvXMLUnitConverter::GetMeasureUnit(eFieldUnit); } -constexpr OUStringLiteral gsLayerID( u"" SC_LAYERID ); - ScXMLExport::ScXMLExport( const css::uno::Reference< css::uno::XComponentContext >& rContext, OUString const & implementationName, SvXMLExportFlags nExportFlag) @@ -524,7 +522,7 @@ void ScXMLExport::CollectSharedData(SCTAB& nTableCount, sal_Int32& nShapesCount) continue; sal_Int16 nLayerID = 0; - bool bExtracted = xShapeProp->getPropertyValue(gsLayerID) >>= nLayerID; + bool bExtracted = xShapeProp->getPropertyValue(SC_LAYERID) >>= nLayerID; if (!bExtracted) continue; diff --git a/sc/source/filter/xml/xmlimprt.cxx b/sc/source/filter/xml/xmlimprt.cxx index 99d33d2416db..75ba5e24dcd7 100644 --- a/sc/source/filter/xml/xmlimprt.cxx +++ b/sc/source/filter/xml/xmlimprt.cxx @@ -102,11 +102,11 @@ #include <memory> #include <utility> -#define SC_LOCALE "Locale" -#define SC_CURRENCYSYMBOL "CurrencySymbol" -#define SC_REPEAT_ROW "repeat-row" -#define SC_FILTER "filter" -#define SC_PRINT_RANGE "print-range" +constexpr OUStringLiteral SC_LOCALE = u"Locale"; +constexpr OUStringLiteral SC_CURRENCYSYMBOL = u"CurrencySymbol"; +constexpr OUStringLiteral SC_REPEAT_ROW = u"repeat-row"; +constexpr OUStringLiteral SC_FILTER = u"filter"; +constexpr OUStringLiteral SC_PRINT_RANGE = u"print-range"; using namespace com::sun::star; using namespace ::xmloff::token; @@ -350,10 +350,6 @@ SvXMLImportContext *ScXMLImport::CreateFastContext( sal_Int32 nElement, return pContext; } -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, OUString const & implementationName, SvXMLImportFlags nImportFlag, @@ -822,7 +818,7 @@ sal_Int32 ScXMLImport::SetCurrencySymbol(const sal_Int32 nKey, std::u16string_vi if (xProperties.is()) { lang::Locale aLocale; - if (GetDocument() && (xProperties->getPropertyValue(gsLocale) >>= aLocale)) + if (GetDocument() && (xProperties->getPropertyValue(SC_LOCALE) >>= aLocale)) { { ScXMLImport::MutexGuard aGuard(*this); @@ -920,7 +916,7 @@ void ScXMLImport::SetType(const uno::Reference <beans::XPropertySet>& rPropertie return; if (rNumberFormat == -1) - rProperties->getPropertyValue( gsNumberFormat ) >>= rNumberFormat; + rProperties->getPropertyValue( SC_UNONAME_NUMFMT ) >>= rNumberFormat; OSL_ENSURE(rNumberFormat != -1, "no NumberFormat"); bool bIsStandard; // sCurrentCurrency may be the ISO code abbreviation if the currency @@ -957,18 +953,18 @@ void ScXMLImport::SetType(const uno::Reference <beans::XPropertySet>& rPropertie if (nCellType != util::NumberFormat::CURRENCY) { lang::Locale aLocale; - if ( xNumberFormatProperties->getPropertyValue(gsLocale) >>= aLocale ) + if ( xNumberFormatProperties->getPropertyValue(SC_LOCALE) >>= aLocale ) { if (!xNumberFormatTypes.is()) xNumberFormatTypes.set(uno::Reference <util::XNumberFormatTypes>(xNumberFormats, uno::UNO_QUERY)); - rProperties->setPropertyValue( gsNumberFormat, uno::makeAny(xNumberFormatTypes->getStandardFormat(nCellType, aLocale)) ); + rProperties->setPropertyValue( SC_UNONAME_NUMFMT, uno::makeAny(xNumberFormatTypes->getStandardFormat(nCellType, aLocale)) ); } } else if (!rCurrency.empty() && !sCurrentCurrency.isEmpty()) { if (sCurrentCurrency != rCurrency) if (!IsCurrencySymbol(rNumberFormat, sCurrentCurrency, rCurrency)) - rProperties->setPropertyValue( gsNumberFormat, uno::makeAny(SetCurrencySymbol(rNumberFormat, rCurrency))); + rProperties->setPropertyValue( SC_UNONAME_NUMFMT, uno::makeAny(SetCurrencySymbol(rNumberFormat, rCurrency))); } } } @@ -982,7 +978,7 @@ void ScXMLImport::SetType(const uno::Reference <beans::XPropertySet>& rPropertie { if ((nCellType == util::NumberFormat::CURRENCY) && !rCurrency.empty() && !sCurrentCurrency.isEmpty() && sCurrentCurrency != rCurrency && !IsCurrencySymbol(rNumberFormat, sCurrentCurrency, rCurrency)) - rProperties->setPropertyValue( gsNumberFormat, uno::makeAny(SetCurrencySymbol(rNumberFormat, rCurrency))); + rProperties->setPropertyValue( SC_UNONAME_NUMFMT, uno::makeAny(SetCurrencySymbol(rNumberFormat, rCurrency))); } } @@ -1033,7 +1029,7 @@ void ScXMLImport::SetStyleToRanges() } else { - xProperties->setPropertyValue(gsCellStyle, uno::makeAny(GetStyleDisplayName( XmlStyleFamily::TABLE_CELL, sPrevStyleName ))); + xProperties->setPropertyValue(SC_UNONAME_CELLSTYL, uno::makeAny(GetStyleDisplayName( XmlStyleFamily::TABLE_CELL, sPrevStyleName ))); sal_Int32 nNumberFormat(GetStyleNumberFormats()->GetStyleNumberFormat(sPrevStyleName)); bool bInsert(nNumberFormat == -1); SetType(xProperties, nNumberFormat, nPrevCellType, sPrevCurrency); diff --git a/sc/source/filter/xml/xmlrowi.cxx b/sc/source/filter/xml/xmlrowi.cxx index ed1719039e95..585eaa4cfe9f 100644 --- a/sc/source/filter/xml/xmlrowi.cxx +++ b/sc/source/filter/xml/xmlrowi.cxx @@ -39,7 +39,7 @@ #include <comphelper/servicehelper.hxx> #include <osl/diagnose.h> -#define SC_ISFILTERED "IsFiltered" +constexpr OUStringLiteral SC_ISFILTERED = u"IsFiltered"; using namespace com::sun::star; using namespace xmloff::token; diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx index b37fe3ad3b4b..fe7bf3b2bce9 100644 --- a/sc/source/ui/app/scmod.cxx +++ b/sc/source/ui/app/scmod.cxx @@ -2170,7 +2170,7 @@ std::shared_ptr<SfxDialogController> ScModule::Find1RefWindow(sal_uInt16 nSlotId using namespace com::sun::star; -#define LINGUPROP_AUTOSPELL "IsSpellAuto" +constexpr OUStringLiteral LINGUPROP_AUTOSPELL = u"IsSpellAuto"; void ScModule::GetSpellSettings( LanguageType& rDefLang, LanguageType& rCjkLang, LanguageType& rCtlLang, bool& rAutoSpell ) diff --git a/sc/source/ui/dbgui/csvruler.cxx b/sc/source/ui/dbgui/csvruler.cxx index 7259b9e44add..7d18bfb31d5e 100644 --- a/sc/source/ui/dbgui/csvruler.cxx +++ b/sc/source/ui/dbgui/csvruler.cxx @@ -31,8 +31,8 @@ using namespace com::sun::star::uno; -#define SEP_PATH "Office.Calc/Dialogs/CSVImport" -#define FIXED_WIDTH_LIST "FixedWidthList" +constexpr OUStringLiteral SEP_PATH = u"Office.Calc/Dialogs/CSVImport"; +constexpr OUStringLiteral FIXED_WIDTH_LIST = u"FixedWidthList"; static void load_FixedWidthList(ScCsvSplits &rSplits) { diff --git a/sc/source/ui/docshell/dbdocimp.cxx b/sc/source/ui/docshell/dbdocimp.cxx index 2baf0d901ee3..2d8f7dce8ddb 100644 --- a/sc/source/ui/docshell/dbdocimp.cxx +++ b/sc/source/ui/docshell/dbdocimp.cxx @@ -62,12 +62,12 @@ using namespace com::sun::star; -#define SC_SERVICE_ROWSET "com.sun.star.sdb.RowSet" +constexpr OUStringLiteral SC_SERVICE_ROWSET = u"com.sun.star.sdb.RowSet"; //! move to a header file? -#define SC_DBPROP_DATASOURCENAME "DataSourceName" -#define SC_DBPROP_COMMAND "Command" -#define SC_DBPROP_COMMANDTYPE "CommandType" +constexpr OUStringLiteral SC_DBPROP_DATASOURCENAME = u"DataSourceName"; +constexpr OUStringLiteral SC_DBPROP_COMMAND = u"Command"; +constexpr OUStringLiteral SC_DBPROP_COMMANDTYPE = u"CommandType"; void ScDBDocFunc::ShowInBeamer( const ScImportParam& rParam, const SfxViewFrame* pFrame ) { diff --git a/sc/source/ui/docshell/docsh8.cxx b/sc/source/ui/docshell/docsh8.cxx index 09dd62e67045..bbb66c2b9ce5 100644 --- a/sc/source/ui/docshell/docsh8.cxx +++ b/sc/source/ui/docshell/docsh8.cxx @@ -82,21 +82,21 @@ using ::std::vector; #if HAVE_FEATURE_DBCONNECTIVITY -#define SC_SERVICE_ROWSET "com.sun.star.sdb.RowSet" +constexpr OUStringLiteral SC_SERVICE_ROWSET = u"com.sun.star.sdb.RowSet"; //! move to a header file? -#define SC_DBPROP_ACTIVECONNECTION "ActiveConnection" -#define SC_DBPROP_COMMAND "Command" -#define SC_DBPROP_COMMANDTYPE "CommandType" -#define SC_DBPROP_PROPCHANGE_NOTIFY "PropertyChangeNotificationEnabled" - -#define SC_DBPROP_NAME "Name" -#define SC_DBPROP_TYPE "Type" -#define SC_DBPROP_PRECISION "Precision" -#define SC_DBPROP_SCALE "Scale" - -#define SC_DBPROP_EXTENSION "Extension" -#define SC_DBPROP_CHARSET "CharSet" +constexpr OUStringLiteral SC_DBPROP_ACTIVECONNECTION = u"ActiveConnection"; +constexpr OUStringLiteral SC_DBPROP_COMMAND = u"Command"; +constexpr OUStringLiteral SC_DBPROP_COMMANDTYPE = u"CommandType"; +constexpr OUStringLiteral SC_DBPROP_PROPCHANGE_NOTIFY = u"PropertyChangeNotificationEnabled"; + +constexpr OUStringLiteral SC_DBPROP_NAME = u"Name"; +constexpr OUStringLiteral SC_DBPROP_TYPE = u"Type"; +constexpr OUStringLiteral SC_DBPROP_PRECISION = u"Precision"; +constexpr OUStringLiteral SC_DBPROP_SCALE = u"Scale"; + +constexpr OUStringLiteral SC_DBPROP_EXTENSION = u"Extension"; +constexpr OUStringLiteral SC_DBPROP_CHARSET = u"CharSet"; namespace { diff --git a/sc/source/ui/miscdlgs/linkarea.cxx b/sc/source/ui/miscdlgs/linkarea.cxx index 1deb97767b8c..603f4d24b078 100644 --- a/sc/source/ui/miscdlgs/linkarea.cxx +++ b/sc/source/ui/miscdlgs/linkarea.cxx @@ -61,8 +61,8 @@ ScLinkedAreaDlg::~ScLinkedAreaDlg() { } -#define FILTERNAME_HTML "HTML (StarCalc)" -#define FILTERNAME_QUERY "calc_HTML_WebQuery" +constexpr OUStringLiteral FILTERNAME_HTML = u"HTML (StarCalc)"; +constexpr OUStringLiteral FILTERNAME_QUERY = u"calc_HTML_WebQuery"; IMPL_LINK_NOARG(ScLinkedAreaDlg, BrowseHdl, weld::Button&, void) { diff --git a/sc/source/ui/miscdlgs/solverutil.cxx b/sc/source/ui/miscdlgs/solverutil.cxx index 09c7aff18baa..df9fa8ae9883 100644 --- a/sc/source/ui/miscdlgs/solverutil.cxx +++ b/sc/source/ui/miscdlgs/solverutil.cxx @@ -34,7 +34,7 @@ using namespace com::sun::star; -#define SCSOLVER_SERVICE "com.sun.star.sheet.Solver" +constexpr OUStringLiteral SCSOLVER_SERVICE = u"com.sun.star.sheet.Solver"; void ScSolverUtil::GetImplementations( uno::Sequence<OUString>& rImplNames, uno::Sequence<OUString>& rDescriptions ) diff --git a/sc/source/ui/unoobj/afmtuno.cxx b/sc/source/ui/unoobj/afmtuno.cxx index b67d9a6edd15..5880cfe875e8 100644 --- a/sc/source/ui/unoobj/afmtuno.cxx +++ b/sc/source/ui/unoobj/afmtuno.cxx @@ -122,7 +122,7 @@ static const SfxItemPropertyMapEntry* lcl_GetAutoFieldMap() return aAutoFieldMap_Impl; } -#define SCAUTOFORMATSOBJ_SERVICE "com.sun.star.sheet.TableAutoFormats" +constexpr OUStringLiteral SCAUTOFORMATSOBJ_SERVICE = u"com.sun.star.sheet.TableAutoFormats"; SC_SIMPLE_SERVICE_INFO( ScAutoFormatFieldObj, "ScAutoFormatFieldObj", "com.sun.star.sheet.TableAutoFormatField" ) SC_SIMPLE_SERVICE_INFO( ScAutoFormatObj, "ScAutoFormatObj", "com.sun.star.sheet.TableAutoFormat" ) diff --git a/sc/source/ui/unoobj/appluno.cxx b/sc/source/ui/unoobj/appluno.cxx index 60adeffe2722..9c551ac8f0b4 100644 --- a/sc/source/ui/unoobj/appluno.cxx +++ b/sc/source/ui/unoobj/appluno.cxx @@ -78,9 +78,9 @@ static const SfxItemPropertyMapEntry* lcl_GetSettingsPropertyMap() return aSettingsPropertyMap_Impl; } -#define SCFUNCTIONLISTOBJ_SERVICE "com.sun.star.sheet.FunctionDescriptions" -#define SCRECENTFUNCTIONSOBJ_SERVICE "com.sun.star.sheet.RecentFunctions" -#define SCSPREADSHEETSETTINGS_SERVICE "com.sun.star.sheet.GlobalSheetSettings" +constexpr OUStringLiteral SCFUNCTIONLISTOBJ_SERVICE = u"com.sun.star.sheet.FunctionDescriptions"; +constexpr OUStringLiteral SCRECENTFUNCTIONSOBJ_SERVICE = u"com.sun.star.sheet.RecentFunctions"; +constexpr OUStringLiteral SCSPREADSHEETSETTINGS_SERVICE = u"com.sun.star.sheet.GlobalSheetSettings"; SC_SIMPLE_SERVICE_INFO( ScFunctionListObj, "stardiv.StarCalc.ScFunctionListObj", SCFUNCTIONLISTOBJ_SERVICE ) SC_SIMPLE_SERVICE_INFO( ScRecentFunctionsObj, "stardiv.StarCalc.ScRecentFunctionsObj", SCRECENTFUNCTIONSOBJ_SERVICE ) diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx index 7fe5df9e98f7..21be10d87a39 100644 --- a/sc/source/ui/unoobj/cellsuno.cxx +++ b/sc/source/ui/unoobj/cellsuno.cxx @@ -853,15 +853,15 @@ static const SvxItemPropertySet* lcl_GetEditPropertySet() return &aEditPropertySet; } -#define SCCHARPROPERTIES_SERVICE "com.sun.star.style.CharacterProperties" -#define SCPARAPROPERTIES_SERVICE "com.sun.star.style.ParagraphProperties" -#define SCCELLPROPERTIES_SERVICE "com.sun.star.table.CellProperties" -#define SCCELLRANGE_SERVICE "com.sun.star.table.CellRange" -#define SCCELL_SERVICE "com.sun.star.table.Cell" -#define SCSHEETCELLRANGES_SERVICE "com.sun.star.sheet.SheetCellRanges" -#define SCSHEETCELLRANGE_SERVICE "com.sun.star.sheet.SheetCellRange" -#define SCSPREADSHEET_SERVICE "com.sun.star.sheet.Spreadsheet" -#define SCSHEETCELL_SERVICE "com.sun.star.sheet.SheetCell" +constexpr OUStringLiteral SCCHARPROPERTIES_SERVICE = u"com.sun.star.style.CharacterProperties"; +constexpr OUStringLiteral SCPARAPROPERTIES_SERVICE = u"com.sun.star.style.ParagraphProperties"; +constexpr OUStringLiteral SCCELLPROPERTIES_SERVICE = u"com.sun.star.table.CellProperties"; +constexpr OUStringLiteral SCCELLRANGE_SERVICE = u"com.sun.star.table.CellRange"; +constexpr OUStringLiteral SCCELL_SERVICE = u"com.sun.star.table.Cell"; +constexpr OUStringLiteral SCSHEETCELLRANGES_SERVICE = u"com.sun.star.sheet.SheetCellRanges"; +constexpr OUStringLiteral SCSHEETCELLRANGE_SERVICE = u"com.sun.star.sheet.SheetCellRange"; +constexpr OUStringLiteral SCSPREADSHEET_SERVICE = u"com.sun.star.sheet.Spreadsheet"; +constexpr OUStringLiteral SCSHEETCELL_SERVICE = u"com.sun.star.sheet.SheetCell"; SC_SIMPLE_SERVICE_INFO( ScCellFormatsEnumeration, "ScCellFormatsEnumeration", "com.sun.star.sheet.CellFormatRangesEnumeration" ) SC_SIMPLE_SERVICE_INFO( ScCellFormatsObj, "ScCellFormatsObj", "com.sun.star.sheet.CellFormatRanges" ) diff --git a/sc/source/ui/unoobj/confuno.cxx b/sc/source/ui/unoobj/confuno.cxx index 6c52c2c3ddf7..d7ead11acdd4 100644 --- a/sc/source/ui/unoobj/confuno.cxx +++ b/sc/source/ui/unoobj/confuno.cxx @@ -45,7 +45,7 @@ using namespace com::sun::star; -#define SCSAVEVERSION "SaveVersionOnClose" +constexpr OUStringLiteral SCSAVEVERSION = u"SaveVersionOnClose"; static const SfxItemPropertyMapEntry* lcl_GetConfigPropertyMap() { @@ -76,7 +76,7 @@ static const SfxItemPropertyMapEntry* lcl_GetConfigPropertyMap() {u"" SC_UNO_FORBIDDEN, 0, cppu::UnoType<i18n::XForbiddenCharacters>::get(), beans::PropertyAttribute::READONLY, 0}, {u"" SC_UNO_CHARCOMP, 0, cppu::UnoType<sal_Int16>::get(), 0, 0}, {u"" SC_UNO_ASIANKERN, 0, cppu::UnoType<bool>::get(), 0, 0}, - {u"" SCSAVEVERSION, 0, cppu::UnoType<bool>::get(), 0, 0}, + { SCSAVEVERSION, 0, cppu::UnoType<bool>::get(), 0, 0}, {u"" SC_UNO_UPDTEMPL, 0, cppu::UnoType<bool>::get(), 0, 0}, /*Stampit enable/disable print cancel */ {u"" SC_UNO_ALLOWPRINTJOBCANCEL, 0, cppu::UnoType<bool>::get(), 0, 0}, diff --git a/sc/source/ui/unoobj/cursuno.cxx b/sc/source/ui/unoobj/cursuno.cxx index ea726a2baed0..800b4be824ac 100644 --- a/sc/source/ui/unoobj/cursuno.cxx +++ b/sc/source/ui/unoobj/cursuno.cxx @@ -29,8 +29,8 @@ using namespace com::sun::star; -#define SCSHEETCELLCURSOR_SERVICE "com.sun.star.sheet.SheetCellCursor" -#define SCCELLCURSOR_SERVICE "com.sun.star.table.CellCursor" +constexpr OUStringLiteral SCSHEETCELLCURSOR_SERVICE = u"com.sun.star.sheet.SheetCellCursor"; +constexpr OUStringLiteral SCCELLCURSOR_SERVICE = u"com.sun.star.table.CellCursor"; ScCellCursorObj::ScCellCursorObj(ScDocShell* pDocSh, const ScRange& rR) : ScCellRangeObj( pDocSh, rR ) diff --git a/sc/source/ui/unoobj/dapiuno.cxx b/sc/source/ui/unoobj/dapiuno.cxx index 9a85aae7cb8d..ff370151ff3c 100644 --- a/sc/source/ui/unoobj/dapiuno.cxx +++ b/sc/source/ui/unoobj/dapiuno.cxx @@ -189,7 +189,7 @@ SC_SIMPLE_SERVICE_INFO( ScDataPilotFieldGroupObj, "ScDataPilotFieldGroupObj", "c SC_SIMPLE_SERVICE_INFO( ScDataPilotFieldGroupItemObj, "ScDataPilotFieldGroupItemObj", "com.sun.star.sheet.DataPilotFieldGroupItem" ) // name that is used in the API for the data layout field -#define SC_DATALAYOUT_NAME "Data" +constexpr OUStringLiteral SC_DATALAYOUT_NAME = u"Data"; ScGeneralFunction ScDataPilotConversion::FirstFunc( PivotFunc nBits ) { diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx index b98ef8df38c5..5cb03d5aa39b 100644 --- a/sc/source/ui/unoobj/docuno.cxx +++ b/sc/source/ui/unoobj/docuno.cxx @@ -131,7 +131,7 @@ using namespace com::sun::star; // #i111553# provides the name of the VBA constant for this document type (e.g. 'ThisExcelDoc' for Calc) -#define SC_UNO_VBAGLOBNAME "VBAGlobalConstantName" +constexpr OUStringLiteral SC_UNO_VBAGLOBNAME = u"VBAGlobalConstantName"; // no Which-ID here, map only for PropertySetInfo @@ -145,7 +145,7 @@ static const SfxItemPropertyMapEntry* lcl_GetDocOptPropertyMap() {u"" SC_UNO_AUTOCONTFOC, 0, cppu::UnoType<bool>::get(), 0, 0}, {u"" SC_UNO_BASICLIBRARIES, 0, cppu::UnoType<script::XLibraryContainer>::get(), beans::PropertyAttribute::READONLY, 0}, {u"" SC_UNO_DIALOGLIBRARIES, 0, cppu::UnoType<script::XLibraryContainer>::get(), beans::PropertyAttribute::READONLY, 0}, - {u"" SC_UNO_VBAGLOBNAME, 0, cppu::UnoType<OUString>::get(), beans::PropertyAttribute::READONLY, 0}, + { SC_UNO_VBAGLOBNAME, 0, cppu::UnoType<OUString>::get(), beans::PropertyAttribute::READONLY, 0}, {u"" SC_UNO_CALCASSHOWN, PROP_UNO_CALCASSHOWN, cppu::UnoType<bool>::get(), 0, 0}, {u"" SC_UNONAME_CLOCAL, 0, cppu::UnoType<lang::Locale>::get(), 0, 0}, {u"" SC_UNO_CJK_CLOCAL, 0, cppu::UnoType<lang::Locale>::get(), 0, 0}, @@ -223,9 +223,9 @@ static const SfxItemPropertyMapEntry* lcl_GetRowsPropertyMap() return aRowsPropertyMap_Impl; } -#define SCMODELOBJ_SERVICE "com.sun.star.sheet.SpreadsheetDocument" -#define SCDOCSETTINGS_SERVICE "com.sun.star.sheet.SpreadsheetDocumentSettings" -#define SCDOC_SERVICE "com.sun.star.document.OfficeDocument" +constexpr OUStringLiteral SCMODELOBJ_SERVICE = u"com.sun.star.sheet.SpreadsheetDocument"; +constexpr OUStringLiteral SCDOCSETTINGS_SERVICE = u"com.sun.star.sheet.SpreadsheetDocumentSettings"; +constexpr OUStringLiteral SCDOC_SERVICE = u"com.sun.star.document.OfficeDocument"; SC_SIMPLE_SERVICE_INFO( ScAnnotationsObj, "ScAnnotationsObj", "com.sun.star.sheet.CellAnnotations" ) SC_SIMPLE_SERVICE_INFO( ScDrawPagesObj, "ScDrawPagesObj", "com.sun.star.drawing.DrawPages" ) diff --git a/sc/source/ui/unoobj/filtuno.cxx b/sc/source/ui/unoobj/filtuno.cxx index fbea6e78aa19..a2b4d0f7e1c3 100644 --- a/sc/source/ui/unoobj/filtuno.cxx +++ b/sc/source/ui/unoobj/filtuno.cxx @@ -47,19 +47,19 @@ using namespace com::sun::star; using namespace com::sun::star::uno; using namespace connectivity::dbase; -#define SCFILTEROPTIONSOBJ_SERVICE "com.sun.star.ui.dialogs.FilterOptionsDialog" -#define SCFILTEROPTIONSOBJ_IMPLNAME "com.sun.star.comp.Calc.FilterOptionsDialog" +constexpr OUStringLiteral SCFILTEROPTIONSOBJ_SERVICE = u"com.sun.star.ui.dialogs.FilterOptionsDialog"; +constexpr OUStringLiteral SCFILTEROPTIONSOBJ_IMPLNAME = u"com.sun.star.comp.Calc.FilterOptionsDialog"; SC_SIMPLE_SERVICE_INFO( ScFilterOptionsObj, SCFILTEROPTIONSOBJ_IMPLNAME, SCFILTEROPTIONSOBJ_SERVICE ) -#define SC_UNONAME_FILENAME "URL" -#define SC_UNONAME_FILTERNAME "FilterName" -#define SC_UNONAME_FILTEROPTIONS "FilterOptions" -#define SC_UNONAME_INPUTSTREAM "InputStream" +constexpr OUStringLiteral SC_UNONAME_FILENAME = u"URL"; +constexpr OUStringLiteral SC_UNONAME_FILTERNAME = u"FilterName"; +constexpr OUStringLiteral SC_UNONAME_FILTEROPTIONS = u"FilterOptions"; +constexpr OUStringLiteral SC_UNONAME_INPUTSTREAM = u"InputStream"; -#define DBF_CHAR_SET "CharSet" -#define DBF_SEP_PATH_IMPORT "Office.Calc/Dialogs/DBFImport" -#define DBF_SEP_PATH_EXPORT "Office.Calc/Dialogs/DBFExport" +constexpr OUStringLiteral DBF_CHAR_SET = u"CharSet"; +constexpr OUStringLiteral DBF_SEP_PATH_IMPORT = u"Office.Calc/Dialogs/DBFImport"; +constexpr OUStringLiteral DBF_SEP_PATH_EXPORT = u"Office.Calc/Dialogs/DBFExport"; namespace { @@ -81,8 +81,7 @@ namespace Sequence<Any> aValues; const Any *pProperties; Sequence<OUString> aNames { DBF_CHAR_SET }; - ScLinkConfigItem aItem( OUString::createFromAscii( - bExport?DBF_SEP_PATH_EXPORT:DBF_SEP_PATH_IMPORT ) ); + ScLinkConfigItem aItem( bExport ? DBF_SEP_PATH_EXPORT : DBF_SEP_PATH_IMPORT ); aValues = aItem.GetProperties( aNames ); pProperties = aValues.getConstArray(); @@ -108,8 +107,7 @@ namespace Sequence<Any> aValues; Any *pProperties; Sequence<OUString> aNames { DBF_CHAR_SET }; - ScLinkConfigItem aItem( OUString::createFromAscii( - bExport?DBF_SEP_PATH_EXPORT:DBF_SEP_PATH_IMPORT ) ); + ScLinkConfigItem aItem( bExport ? DBF_SEP_PATH_EXPORT : DBF_SEP_PATH_IMPORT ); aValues = aItem.GetProperties( aNames ); pProperties = aValues.getArray(); diff --git a/sc/source/ui/unoobj/funcuno.cxx b/sc/source/ui/unoobj/funcuno.cxx index 87cc9279ca00..bdd4752d4cd6 100644 --- a/sc/source/ui/unoobj/funcuno.cxx +++ b/sc/source/ui/unoobj/funcuno.cxx @@ -52,8 +52,8 @@ using namespace com::sun::star; // registered as implementation for service FunctionAccess, // also supports service SpreadsheetDocumentSettings (to set null date etc.) -#define SCFUNCTIONACCESS_SERVICE "com.sun.star.sheet.FunctionAccess" -#define SCDOCSETTINGS_SERVICE "com.sun.star.sheet.SpreadsheetDocumentSettings" +constexpr OUStringLiteral SCFUNCTIONACCESS_SERVICE = u"com.sun.star.sheet.FunctionAccess"; +constexpr OUStringLiteral SCDOCSETTINGS_SERVICE = u"com.sun.star.sheet.SpreadsheetDocumentSettings"; // helper to use cached document if not in use, temporary document otherwise diff --git a/sc/source/ui/unoobj/nameuno.cxx b/sc/source/ui/unoobj/nameuno.cxx index 939cea49323d..c09361754372 100644 --- a/sc/source/ui/unoobj/nameuno.cxx +++ b/sc/source/ui/unoobj/nameuno.cxx @@ -69,7 +69,7 @@ static const SfxItemPropertyMapEntry* lcl_GetNamedRangesMap() return aNamedRangesMap_Impl; } -#define SCNAMEDRANGEOBJ_SERVICE "com.sun.star.sheet.NamedRange" +constexpr OUStringLiteral SCNAMEDRANGEOBJ_SERVICE = u"com.sun.star.sheet.NamedRange"; SC_SIMPLE_SERVICE_INFO( ScLabelRangeObj, "ScLabelRangeObj", "com.sun.star.sheet.LabelRange" ) SC_SIMPLE_SERVICE_INFO( ScLabelRangesObj, "ScLabelRangesObj", "com.sun.star.sheet.LabelRanges" ) diff --git a/sc/source/ui/unoobj/shapeuno.cxx b/sc/source/ui/unoobj/shapeuno.cxx index bce996f1ed59..590f8acb28d6 100644 --- a/sc/source/ui/unoobj/shapeuno.cxx +++ b/sc/source/ui/unoobj/shapeuno.cxx @@ -1311,9 +1311,9 @@ SdrObject* ScShapeObj::GetSdrObject() const noexcept return nullptr; } -#define SC_EVENTACC_ONCLICK "OnClick" -#define SC_EVENTACC_SCRIPT "Script" -#define SC_EVENTACC_EVENTTYPE "EventType" +constexpr OUStringLiteral SC_EVENTACC_ONCLICK = u"OnClick"; +constexpr OUStringLiteral SC_EVENTACC_SCRIPT = u"Script"; +constexpr OUStringLiteral SC_EVENTACC_EVENTTYPE = u"EventType"; class ShapeUnoEventAccessImpl : public ::cppu::WeakImplHelper< container::XNameReplace > { diff --git a/sc/source/ui/unoobj/srchuno.cxx b/sc/source/ui/unoobj/srchuno.cxx index 14b19452ad30..347ec93d07d7 100644 --- a/sc/source/ui/unoobj/srchuno.cxx +++ b/sc/source/ui/unoobj/srchuno.cxx @@ -54,8 +54,8 @@ static const SfxItemPropertyMapEntry* lcl_GetSearchPropertyMap() return aSearchPropertyMap_Impl; } -#define SCSEARCHDESCRIPTOR_SERVICE "com.sun.star.util.SearchDescriptor" -#define SCREPLACEDESCRIPTOR_SERVICE "com.sun.star.util.ReplaceDescriptor" +constexpr OUStringLiteral SCSEARCHDESCRIPTOR_SERVICE = u"com.sun.star.util.SearchDescriptor"; +constexpr OUStringLiteral SCREPLACEDESCRIPTOR_SERVICE = u"com.sun.star.util.ReplaceDescriptor"; ScCellSearchObj::ScCellSearchObj() : aPropSet(lcl_GetSearchPropertyMap()), diff --git a/sc/source/ui/unoobj/styleuno.cxx b/sc/source/ui/unoobj/styleuno.cxx index 3d63b60513b1..dfbee4752ae7 100644 --- a/sc/source/ui/unoobj/styleuno.cxx +++ b/sc/source/ui/unoobj/styleuno.cxx @@ -387,19 +387,19 @@ static const SfxItemPropertyMap* lcl_GetFooterStyleMap() #define SC_STYLE_FAMILY_COUNT 2 -#define SC_FAMILYNAME_CELL u"CellStyles" -#define SC_FAMILYNAME_PAGE u"PageStyles" +constexpr OUStringLiteral SC_FAMILYNAME_CELL = u"CellStyles"; +constexpr OUStringLiteral SC_FAMILYNAME_PAGE = u"PageStyles"; const SfxStyleFamily aStyleFamilyTypes[SC_STYLE_FAMILY_COUNT] = { SfxStyleFamily::Para, SfxStyleFamily::Page }; -#define SCSTYLE_SERVICE "com.sun.star.style.Style" -#define SCCELLSTYLE_SERVICE "com.sun.star.style.CellStyle" -#define SCPAGESTYLE_SERVICE "com.sun.star.style.PageStyle" +constexpr OUStringLiteral SCSTYLE_SERVICE = u"com.sun.star.style.Style"; +constexpr OUStringLiteral SCCELLSTYLE_SERVICE = u"com.sun.star.style.CellStyle"; +constexpr OUStringLiteral SCPAGESTYLE_SERVICE = u"com.sun.star.style.PageStyle"; SC_SIMPLE_SERVICE_INFO( ScStyleFamiliesObj, "ScStyleFamiliesObj", "com.sun.star.style.StyleFamilies" ) SC_SIMPLE_SERVICE_INFO( ScStyleFamilyObj, "ScStyleFamilyObj", "com.sun.star.style.StyleFamily" ) -#define SC_PAPERBIN_DEFAULTNAME "[From printer settings]" +constexpr OUStringLiteral SC_PAPERBIN_DEFAULTNAME = u"[From printer settings]"; static bool lcl_AnyTabProtected( const ScDocument& rDoc ) { diff --git a/sc/source/ui/unoobj/viewuno.cxx b/sc/source/ui/unoobj/viewuno.cxx index a758a9054600..e75e522af786 100644 --- a/sc/source/ui/unoobj/viewuno.cxx +++ b/sc/source/ui/unoobj/viewuno.cxx @@ -112,8 +112,8 @@ static const SfxItemPropertyMapEntry* lcl_GetViewOptPropertyMap() return aViewOptPropertyMap_Impl; } -#define SCTABVIEWOBJ_SERVICE "com.sun.star.sheet.SpreadsheetView" -#define SCVIEWSETTINGS_SERVICE "com.sun.star.sheet.SpreadsheetViewSettings" +constexpr OUStringLiteral SCTABVIEWOBJ_SERVICE = u"com.sun.star.sheet.SpreadsheetView"; +constexpr OUStringLiteral SCVIEWSETTINGS_SERVICE = u"com.sun.star.sheet.SpreadsheetViewSettings"; SC_SIMPLE_SERVICE_INFO( ScViewPaneBase, "ScViewPaneObj", "com.sun.star.sheet.SpreadsheetViewPane" ) diff --git a/sc/source/ui/vba/vbaformat.cxx b/sc/source/ui/vba/vbaformat.cxx index 94048fd73f31..8db4a9b1c4ff 100644 --- a/sc/source/ui/vba/vbaformat.cxx +++ b/sc/source/ui/vba/vbaformat.cxx @@ -53,8 +53,8 @@ using namespace ::ooo::vba; using namespace ::com::sun::star; -#define FORMATSTRING "FormatString" -#define LOCALE "Locale" +constexpr OUStringLiteral FORMATSTRING = u"FormatString"; +constexpr OUStringLiteral LOCALE = u"Locale"; template< typename... Ifc > ScVbaFormat< Ifc... >::ScVbaFormat( const uno::Reference< XHelperInterface >& xParent, diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx index a0a296c73e03..e284f2cce724 100644 --- a/sc/source/ui/view/viewdata.cxx +++ b/sc/source/ui/view/viewdata.cxx @@ -74,7 +74,7 @@ using namespace com::sun::star; #define SC_GROWY_SMALL_EXTRA 100 #define SC_GROWY_BIG_EXTRA 200 -#define TAG_TABBARWIDTH "tw:" +constexpr OUStringLiteral TAG_TABBARWIDTH = u"tw:"; namespace { @@ -3241,7 +3241,7 @@ void ScViewData::WriteUserData(OUString& rData) else rData += "0"; - rData += ";" + OUString::number( nTabNo ) + ";" TAG_TABBARWIDTH + + rData += ";" + OUString::number( nTabNo ) + ";" + TAG_TABBARWIDTH + OUString::number( pView->GetTabBarWidth() ); SCTAB nTabCount = mrDoc.GetTableCount();