diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-09-20 12:53:27 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-09-22 12:58:14 +0200 |
commit | de74d98c58db604aafc0ee623c252f3aa25ac4b7 (patch) | |
tree | 1ff996e3f5bc27c10c7c64313a357a5a9c2bfa86 /sc/source | |
parent | be8a33c0f03b83357d2ae37dda6bf65313267cea (diff) |
OUStringLiteral/OStringLiteral coverity PARSE_ERROR workaround
do more like
commit 121771e37f7e2de41cd5643475861062bf25627b
Date: Mon Sep 21 09:17:54 2020 +0200
Make some OUStringLiteral vars constexpr
cause coverity can live with that
Change-Id: I9efd7f848289c4865997a44c6780373068422227
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103147
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc/source')
-rw-r--r-- | sc/source/core/tool/compiler.cxx | 6 | ||||
-rw-r--r-- | sc/source/filter/excel/xiescher.cxx | 6 | ||||
-rw-r--r-- | sc/source/filter/oox/defnamesbuffer.cxx | 2 | ||||
-rw-r--r-- | sc/source/filter/oox/pagesettings.cxx | 10 | ||||
-rw-r--r-- | sc/source/filter/oox/worksheethelper.cxx | 2 | ||||
-rw-r--r-- | sc/source/filter/xml/XMLStylesExportHelper.cxx | 20 | ||||
-rw-r--r-- | sc/source/filter/xml/xmlexprt.cxx | 2 | ||||
-rw-r--r-- | sc/source/filter/xml/xmlstyli.cxx | 8 | ||||
-rw-r--r-- | sc/source/ui/StatisticsDialogs/FourierAnalysisDialog.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/dbgui/scuiasciiopt.cxx | 6 | ||||
-rw-r--r-- | sc/source/ui/unoobj/PivotTableDataProvider.cxx | 6 | ||||
-rw-r--r-- | sc/source/ui/vba/vbaaxis.cxx | 8 | ||||
-rw-r--r-- | sc/source/ui/vba/vbachart.cxx | 32 | ||||
-rw-r--r-- | sc/source/ui/vba/vbachartobject.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/formatsh.cxx | 2 |
15 files changed, 57 insertions, 57 deletions
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx index 95909a0fbbbb..423582cea2a0 100644 --- a/sc/source/core/tool/compiler.cxx +++ b/sc/source/core/tool/compiler.cxx @@ -723,7 +723,7 @@ struct Convention_A1 : public ScCompiler::Convention KParseTokens::ASC_UNDERSCORE | KParseTokens::ASC_DOLLAR; constexpr sal_Int32 nContFlags = nStartFlags | KParseTokens::ASC_DOT; // '?' allowed in range names because of Xcl :-/ - static const OUStringLiteral aAddAllowed(u"?#"); + static constexpr OUStringLiteral aAddAllowed(u"?#"); return pCharClass->parseAnyToken( rFormula, nSrcPos, nStartFlags, aAddAllowed, (bGroupSeparator ? nContFlags | KParseTokens::GROUP_SEPARATOR_IN_NUMBER : nContFlags), @@ -1354,7 +1354,7 @@ struct ConventionXL_A1 : public Convention_A1, public ConventionXL KParseTokens::ASC_UNDERSCORE | KParseTokens::ASC_DOLLAR; constexpr sal_Int32 nContFlags = nStartFlags | KParseTokens::ASC_DOT; // '?' allowed in range names - static const OUStringLiteral aAddAllowed(u"?!"); + static constexpr OUStringLiteral aAddAllowed(u"?!"); return pCharClass->parseAnyToken( rFormula, nSrcPos, nStartFlags, aAddAllowed, (bGroupSeparator ? nContFlags | KParseTokens::GROUP_SEPARATOR_IN_NUMBER : nContFlags), @@ -1698,7 +1698,7 @@ struct ConventionXL_R1C1 : public ScCompiler::Convention, public ConventionXL KParseTokens::ASC_UNDERSCORE ; constexpr sal_Int32 nContFlags = nStartFlags | KParseTokens::ASC_DOT; // '?' allowed in range names - static const OUStringLiteral aAddAllowed(u"?-[]!"); + static constexpr OUStringLiteral aAddAllowed(u"?-[]!"); return pCharClass->parseAnyToken( rFormula, nSrcPos, nStartFlags, aAddAllowed, diff --git a/sc/source/filter/excel/xiescher.cxx b/sc/source/filter/excel/xiescher.cxx index 3944e89c03d0..e589b25c33f0 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(u"ControlTypeinMSO"); + static constexpr 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(u"ObjIDinMSO"); + static constexpr OUStringLiteral sObjIdPropertyName(u"ObjIDinMSO"); const XclImpPictureObj* const pObj = dynamic_cast< const XclImpPictureObj* const >(this); if( pObj != nullptr && pObj->IsOcxControl() ) { @@ -3299,7 +3299,7 @@ XclImpDffConverter::XclImpDffConvData::XclImpDffConvData( { } -const OUStringLiteral gaStdFormName( u"Standard" ); /// Standard name of control forms. +constexpr 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/oox/defnamesbuffer.cxx b/sc/source/filter/oox/defnamesbuffer.cxx index aa8a9b30139e..733d4790f8ff 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(u"_xlnm."); +constexpr 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 2d7f49988cc2..b19caea83634 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( 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" ); +constexpr OUStringLiteral gaPageNumberService( u"com.sun.star.text.TextField.PageNumber" ); +constexpr OUStringLiteral gaPageCountService( u"com.sun.star.text.TextField.PageCount" ); +constexpr OUStringLiteral gaSheetNameService( u"com.sun.star.text.TextField.SheetName" ); +constexpr OUStringLiteral gaFileNameService( u"com.sun.star.text.TextField.FileName" ); +constexpr 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 c41e6e7709e8..110ce64ba79c 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( u"com.sun.star.sheet.SheetCellRanges" ); /// Service name for a SheetCellRanges object. +constexpr 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/XMLStylesExportHelper.cxx b/sc/source/filter/xml/XMLStylesExportHelper.cxx index cc9133da19b4..cb00b0074538 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(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); +constexpr OUStringLiteral gsERRALSTY(u"" SC_UNONAME_ERRALSTY); +constexpr OUStringLiteral gsIGNOREBL(u"" SC_UNONAME_IGNOREBL); +constexpr OUStringLiteral gsSHOWLIST(u"" SC_UNONAME_SHOWLIST); +constexpr OUStringLiteral gsTYPE(u"" SC_UNONAME_TYPE); +constexpr OUStringLiteral gsSHOWINP(u"" SC_UNONAME_SHOWINP); +constexpr OUStringLiteral gsSHOWERR(u"" SC_UNONAME_SHOWERR); +constexpr OUStringLiteral gsINPTITLE(u"" SC_UNONAME_INPTITLE); +constexpr OUStringLiteral gsINPMESS(u"" SC_UNONAME_INPMESS); +constexpr OUStringLiteral gsERRTITLE(u"" SC_UNONAME_ERRTITLE); +constexpr 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 ce93ca8ee6fd..aa886af6b412 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( u"" SC_LAYERID ); +constexpr OUStringLiteral gsLayerID( u"" SC_LAYERID ); ScXMLExport::ScXMLExport( 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 bd928fb9a9e8..8712531e526c 100644 --- a/sc/source/filter/xml/xmlstyli.cxx +++ b/sc/source/filter/xml/xmlstyli.cxx @@ -657,10 +657,10 @@ SvXMLStyleContext *XMLTableStylesContext::CreateDefaultStyleStyleChildContext( return pStyle; } -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); +constexpr OUStringLiteral gsCellStyleServiceName(u"com.sun.star.style.CellStyle"); +constexpr OUStringLiteral gsColumnStyleServiceName(u"" XML_STYLE_FAMILY_TABLE_COLUMN_STYLES_NAME); +constexpr OUStringLiteral gsRowStyleServiceName(u"" XML_STYLE_FAMILY_TABLE_ROW_STYLES_NAME); +constexpr OUStringLiteral gsTableStyleServiceName(u"" XML_STYLE_FAMILY_TABLE_TABLE_STYLES_NAME); XMLTableStylesContext::XMLTableStylesContext( SvXMLImport& rImport, const bool bTempAutoStyles ) diff --git a/sc/source/ui/StatisticsDialogs/FourierAnalysisDialog.cxx b/sc/source/ui/StatisticsDialogs/FourierAnalysisDialog.cxx index cfd42a02d28c..77926a28e03d 100644 --- a/sc/source/ui/StatisticsDialogs/FourierAnalysisDialog.cxx +++ b/sc/source/ui/StatisticsDialogs/FourierAnalysisDialog.cxx @@ -219,7 +219,7 @@ void ScFourierAnalysisDialog::getDataLabel(OUString& rLabel) void ScFourierAnalysisDialog::genFormula(OUString& rFormula) { - static const OUStringLiteral aSep(u";"); + static constexpr OUStringLiteral aSep(u";"); if (!mbPolar) { diff --git a/sc/source/ui/dbgui/scuiasciiopt.cxx b/sc/source/ui/dbgui/scuiasciiopt.cxx index 5e5f08bf87a7..bfc154bffc08 100644 --- a/sc/source/ui/dbgui/scuiasciiopt.cxx +++ b/sc/source/ui/dbgui/scuiasciiopt.cxx @@ -80,9 +80,9 @@ const ::std::vector<OUString> CSVImportOptionNames = "Language", "SkipEmptyCells" }; -const OUStringLiteral aSep_Path = u"Office.Calc/Dialogs/CSVImport"; -const OUStringLiteral aSep_Path_Clpbrd = u"Office.Calc/Dialogs/ClipboardTextImport"; -const OUStringLiteral aSep_Path_Text2Col = u"Office.Calc/Dialogs/TextToColumnsImport"; +constexpr OUStringLiteral aSep_Path = u"Office.Calc/Dialogs/CSVImport"; +constexpr OUStringLiteral aSep_Path_Clpbrd = u"Office.Calc/Dialogs/ClipboardTextImport"; +constexpr OUStringLiteral aSep_Path_Text2Col = u"Office.Calc/Dialogs/TextToColumnsImport"; namespace { CSVImportOptionsIndex getSkipEmptyCellsIndex( ScImportAsciiCall eCall ) diff --git a/sc/source/ui/unoobj/PivotTableDataProvider.cxx b/sc/source/ui/unoobj/PivotTableDataProvider.cxx index 4cf99e3d826a..21ecd47686ce 100644 --- a/sc/source/ui/unoobj/PivotTableDataProvider.cxx +++ b/sc/source/ui/unoobj/PivotTableDataProvider.cxx @@ -55,9 +55,9 @@ namespace sc { namespace { -const OUStringLiteral constIdCategories(u"categories"); -const OUStringLiteral constIdLabel(u"label"); -const OUStringLiteral constIdData(u"data"); +constexpr OUStringLiteral constIdCategories(u"categories"); +constexpr OUStringLiteral constIdLabel(u"label"); +constexpr OUStringLiteral constIdData(u"data"); const SfxItemPropertyMapEntry* lcl_GetDataProviderPropertyMap() { diff --git a/sc/source/ui/vba/vbaaxis.cxx b/sc/source/ui/vba/vbaaxis.cxx index 3ab2aafb937f..fa272d291d08 100644 --- a/sc/source/ui/vba/vbaaxis.cxx +++ b/sc/source/ui/vba/vbaaxis.cxx @@ -29,10 +29,10 @@ using namespace ::ooo::vba::excel::XlAxisCrosses; using namespace ::ooo::vba::excel::XlAxisType; using namespace ::ooo::vba::excel::XlScaleType; -const OUStringLiteral ORIGIN(u"Origin"); -const OUStringLiteral AUTOORIGIN(u"AutoOrigin"); -const OUStringLiteral VBA_MIN(u"Max"); -const OUStringLiteral VBA_MAX(u"Min"); +constexpr OUStringLiteral ORIGIN(u"Origin"); +constexpr OUStringLiteral AUTOORIGIN(u"AutoOrigin"); +constexpr OUStringLiteral VBA_MIN(u"Max"); +constexpr OUStringLiteral VBA_MAX(u"Min"); ScVbaChart* ScVbaAxis::getChartPtr() { diff --git a/sc/source/ui/vba/vbachart.cxx b/sc/source/ui/vba/vbachart.cxx index 29aedba2e8fb..dcd73199f2bb 100644 --- a/sc/source/ui/vba/vbachart.cxx +++ b/sc/source/ui/vba/vbachart.cxx @@ -48,23 +48,23 @@ using namespace ::ooo::vba::excel::XlRowCol; using namespace ::ooo::vba::excel::XlAxisType; using namespace ::ooo::vba::excel::XlAxisGroup; -const OUStringLiteral CHART_NAME(u"Name"); +constexpr OUStringLiteral CHART_NAME(u"Name"); // #TODO move this constant to vbaseries.[ch]xx ( when it exists ) -const OUStringLiteral DEFAULTSERIESPREFIX(u"Series"); -const OUStringLiteral DATAROWSOURCE(u"DataRowSource"); -const OUStringLiteral UPDOWN(u"UpDown"); -const OUStringLiteral VOLUME(u"Volume"); -const OUStringLiteral LINES(u"Lines"); -const OUStringLiteral SPLINETYPE(u"SplineType"); -const OUStringLiteral SYMBOLTYPE(u"SymbolType"); -const OUStringLiteral DEEP(u"Deep"); -const OUStringLiteral SOLIDTYPE(u"SolidType"); -const OUStringLiteral VERTICAL(u"Vertical"); -const OUStringLiteral PERCENT(u"Percent"); -const OUStringLiteral STACKED(u"Stacked"); -const OUStringLiteral DIM3D(u"Dim3D"); -const OUStringLiteral HASMAINTITLE(u"HasMainTitle"); -const OUStringLiteral HASLEGEND(u"HasLegend"); +constexpr OUStringLiteral DEFAULTSERIESPREFIX(u"Series"); +constexpr OUStringLiteral DATAROWSOURCE(u"DataRowSource"); +constexpr OUStringLiteral UPDOWN(u"UpDown"); +constexpr OUStringLiteral VOLUME(u"Volume"); +constexpr OUStringLiteral LINES(u"Lines"); +constexpr OUStringLiteral SPLINETYPE(u"SplineType"); +constexpr OUStringLiteral SYMBOLTYPE(u"SymbolType"); +constexpr OUStringLiteral DEEP(u"Deep"); +constexpr OUStringLiteral SOLIDTYPE(u"SolidType"); +constexpr OUStringLiteral VERTICAL(u"Vertical"); +constexpr OUStringLiteral PERCENT(u"Percent"); +constexpr OUStringLiteral STACKED(u"Stacked"); +constexpr OUStringLiteral DIM3D(u"Dim3D"); +constexpr OUStringLiteral HASMAINTITLE(u"HasMainTitle"); +constexpr OUStringLiteral HASLEGEND(u"HasLegend"); ScVbaChart::ScVbaChart( const css::uno::Reference< ov::XHelperInterface >& _xParent, const css::uno::Reference< css::uno::XComponentContext >& _xContext, const css::uno::Reference< css::lang::XComponent >& _xChartComponent, const css::uno::Reference< css::table::XTableChart >& _xTableChart ) : ChartImpl_BASE( _xParent, _xContext ), mxTableChart( _xTableChart ) { diff --git a/sc/source/ui/vba/vbachartobject.cxx b/sc/source/ui/vba/vbachartobject.cxx index d87b4c622121..2afcea0ffe2f 100644 --- a/sc/source/ui/vba/vbachartobject.cxx +++ b/sc/source/ui/vba/vbachartobject.cxx @@ -29,7 +29,7 @@ using namespace ::com::sun::star; using namespace ::ooo::vba; -const OUStringLiteral PERSIST_NAME(u"PersistName"); +constexpr OUStringLiteral PERSIST_NAME(u"PersistName"); ScVbaChartObject::ScVbaChartObject( const css::uno::Reference< ov::XHelperInterface >& _xParent, const css::uno::Reference< css::uno::XComponentContext >& _xContext, const css::uno::Reference< css::table::XTableChart >& _xTableChart, const css::uno::Reference< css::drawing::XDrawPageSupplier >& _xDrawPageSupplier ) : ChartObjectImpl_BASE( _xParent, _xContext ), xTableChart( _xTableChart ), xDrawPageSupplier( _xDrawPageSupplier ) { diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx index e783194e60ca..6567f5f3ab97 100644 --- a/sc/source/ui/view/formatsh.cxx +++ b/sc/source/ui/view/formatsh.cxx @@ -2575,7 +2575,7 @@ void ScFormatShell::GetNumFormatState( SfxItemSet& rSet ) bThousand = nIntegerDigits > 0 && ((nIntegerDigits % 3) == 0); } OUString aFormat; - static const OUStringLiteral sBreak = u","; + static constexpr OUStringLiteral sBreak = u","; const OUString sThousand = OUString::number(static_cast<sal_Int32>(bThousand)); const OUString sNegRed = OUString::number(static_cast<sal_Int32>(bNegRed)); const OUString sPrecision = OUString::number(nPrecision); |