From dfd5385d97d4c359185450f5d0acc5aac4a7527b Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 18 Oct 2018 08:08:12 +0200 Subject: loplugin:staticvar in sc Change-Id: I9f1d66e9af454a27a341e56bbe50a558898b65a1 Reviewed-on: https://gerrit.libreoffice.org/61900 Tested-by: Jenkins Reviewed-by: Noel Grandin --- sc/qa/unit/helper/qahelper.hxx | 8 ++-- sc/qa/unit/helper/shared_test_impl.hxx | 10 ++--- sc/qa/unit/pivottable_filters_test.cxx | 2 +- sc/qa/unit/subsequent_export-test.cxx | 12 +++--- sc/qa/unit/subsequent_filters-test.cxx | 6 +-- sc/qa/unit/ucalc.cxx | 30 ++++++------- sc/qa/unit/ucalc_column.cxx | 4 +- sc/qa/unit/ucalc_condformat.cxx | 18 ++++---- sc/qa/unit/ucalc_formula.cxx | 40 ++++++++--------- sc/qa/unit/ucalc_pivottable.cxx | 50 +++++++++++----------- sc/qa/unit/ucalc_sort.cxx | 14 +++--- sc/source/core/data/funcdesc.cxx | 6 +-- .../StatisticsDialogs/AnalysisOfVarianceDialog.cxx | 2 +- sc/source/ui/unoobj/condformatuno.cxx | 42 +++++++++--------- 14 files changed, 122 insertions(+), 122 deletions(-) diff --git a/sc/qa/unit/helper/qahelper.hxx b/sc/qa/unit/helper/qahelper.hxx index aac73cf8238a..37bbdc35ff50 100644 --- a/sc/qa/unit/helper/qahelper.hxx +++ b/sc/qa/unit/helper/qahelper.hxx @@ -90,10 +90,10 @@ struct TestParam bool const bOptimal; }; const char* sTestDoc; - int const nImportType; - int const nExportType; // -1 for import test, otherwise this is an export test - int const nRowData; - RowData* const pData; + int nImportType; + int nExportType; // -1 for import test, otherwise this is an export test + int nRowData; + RowData const * pData; }; struct FileFormat { diff --git a/sc/qa/unit/helper/shared_test_impl.hxx b/sc/qa/unit/helper/shared_test_impl.hxx index 114f2571f610..88548cca3699 100644 --- a/sc/qa/unit/helper/shared_test_impl.hxx +++ b/sc/qa/unit/helper/shared_test_impl.hxx @@ -43,7 +43,7 @@ struct DataBarData databar::ScAxisPosition eAxisPosition; }; -DataBarData aData[] = { +DataBarData const aData[] = { { ScRange(1,2,0,1,5,0), COLORSCALE_AUTO, COLORSCALE_AUTO, databar::AUTOMATIC }, { ScRange(3,2,0,3,5,0), COLORSCALE_MIN, COLORSCALE_MAX, databar::AUTOMATIC }, { ScRange(5,2,0,5,5,0), COLORSCALE_PERCENTILE, COLORSCALE_PERCENT, databar::AUTOMATIC }, @@ -82,7 +82,7 @@ struct ColorScale2EntryData ScColorScaleEntryType eUpperType; }; -ColorScale2EntryData aData2Entry[] = { +ColorScale2EntryData const aData2Entry[] = { { ScRange(1,2,0,1,5,0), COLORSCALE_MIN, COLORSCALE_MAX }, { ScRange(3,2,0,3,5,0), COLORSCALE_PERCENTILE, COLORSCALE_PERCENT }, { ScRange(5,2,0,5,5,0), COLORSCALE_VALUE, COLORSCALE_FORMULA } @@ -121,7 +121,7 @@ struct ColorScale3EntryData ScColorScaleEntryType eUpperType; }; -ColorScale3EntryData aData3Entry[] = { +ColorScale3EntryData const aData3Entry[] = { { ScRange(1,1,1,1,6,1), COLORSCALE_MIN, COLORSCALE_PERCENTILE, COLORSCALE_MAX }, { ScRange(3,1,1,3,6,1), COLORSCALE_PERCENTILE, COLORSCALE_VALUE, COLORSCALE_PERCENT }, { ScRange(5,1,1,5,6,1), COLORSCALE_VALUE, COLORSCALE_VALUE, COLORSCALE_FORMULA } @@ -159,11 +159,11 @@ void testFunctionsExcel2010_Impl( ScDocument& rDoc ) { // Original test case document is functions-excel-2010.xlsx // Which test rows to evaluate, 1-based as in UI to ease maintenance. - struct + static struct { SCROW nRow; bool bEvaluate; - } aTests[] = { + } const aTests[] = { { 2, false }, // name=[ AGGREGATE ], result=0, expected=1 { 3, true }, { 4, true }, diff --git a/sc/qa/unit/pivottable_filters_test.cxx b/sc/qa/unit/pivottable_filters_test.cxx index 609ee98e0a63..ceb43d6ce664 100644 --- a/sc/qa/unit/pivottable_filters_test.cxx +++ b/sc/qa/unit/pivottable_filters_test.cxx @@ -153,7 +153,7 @@ void ScPivotTableFiltersTest::tearDown() void ScPivotTableFiltersTest::registerNamespaces(xmlXPathContextPtr& pXmlXPathCtx) { - struct + static const struct { xmlChar* pPrefix; xmlChar* pURI; diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx index ef0b5c96eec2..2472b3f9d55f 100644 --- a/sc/qa/unit/subsequent_export-test.cxx +++ b/sc/qa/unit/subsequent_export-test.cxx @@ -341,7 +341,7 @@ private: void ScExportTest::registerNamespaces(xmlXPathContextPtr& pXmlXPathCtx) { - struct { xmlChar* pPrefix; xmlChar* pURI; } aNamespaces[] = + static const struct { xmlChar* pPrefix; xmlChar* pURI; } aNamespaces[] = { { BAD_CAST("w"), BAD_CAST("http://schemas.openxmlformats.org/wordprocessingml/2006/main") }, { BAD_CAST("x"), BAD_CAST("http://schemas.openxmlformats.org/spreadsheetml/2006/main") }, @@ -1192,7 +1192,7 @@ void ScExportTest::testDataBarExportXLSX() void ScExportTest::testMiscRowHeightExport() { - TestParam::RowData DfltRowData[] = + static const TestParam::RowData DfltRowData[] = { { 0, 4, 0, 529, 0, false }, { 5, 10, 0, 1058, 0, false }, @@ -1202,7 +1202,7 @@ void ScExportTest::testMiscRowHeightExport() { 1048573, 1048575, 0, 529, 0, false }, }; - TestParam::RowData EmptyRepeatRowData[] = + static const TestParam::RowData EmptyRepeatRowData[] = { // rows 0-4, 5-10, 17-20 are all set at various // heights, there is no content in the rows, there @@ -2308,7 +2308,7 @@ const char* toBorderName( SvxBorderLineStyle eStyle ) void ScExportTest::testExcelCellBorders( sal_uLong nFormatType ) { - struct + static const struct { SCROW mnRow; SvxBorderLineStyle mnStyle; @@ -2521,7 +2521,7 @@ void ScExportTest::testTrackChangesSimpleXLSX() bool check( const ScDocument& rDoc ) { - CheckItem aChecks[] = + static const CheckItem aChecks[] = { { 1, SC_CAT_CONTENT , 1, 1, 0, 1, 1, 0, false }, { 2, SC_CAT_INSERT_ROWS , 0, 2, 0, 0, 2, 0, true }, @@ -2732,7 +2732,7 @@ void ScExportTest::testSheetTabColorsXLSX() } } - const Color aXclColors[] = + static const Color aXclColors[] = { 0x0000B050, // green 0x00FF0000, // red diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx index d10794a197d7..eca265feeb9d 100644 --- a/sc/qa/unit/subsequent_filters-test.cxx +++ b/sc/qa/unit/subsequent_filters-test.cxx @@ -2763,7 +2763,7 @@ void ScFiltersTest::testFormulaDependency() void ScFiltersTest::testMiscRowHeights() { - TestParam::RowData DfltRowData[] = + static const TestParam::RowData DfltRowData[] = { // check rows at the beginning and end of document // and make sure they are reported as the default row @@ -2772,7 +2772,7 @@ void ScFiltersTest::testMiscRowHeights() { 1048573, 1048575, 0, -1, 0, false }, }; - TestParam::RowData MultiLineOptData[] = + static const TestParam::RowData MultiLineOptData[] = { // Row 0 is 12.63 mm, but optimal flag is set { 0, 0, 0, 1236, CHECK_OPTIMAL, true }, @@ -2908,7 +2908,7 @@ void ScFiltersTest::testOutlineODS() size_t nIndex; }; - OutlineData aRow[] = + static const OutlineData aRow[] = { { 1, 29, false, true, 0, 0 }, { 2, 26, false, true, 1, 0 }, diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index a5af0c3e0db0..5645600c2a45 100644 --- a/sc/qa/unit/ucalc.cxx +++ b/sc/qa/unit/ucalc.cxx @@ -612,7 +612,7 @@ void Test::testSelectionFunction() }; { - Check aChecks[] = + static const Check aChecks[] = { { SUBTOTAL_FUNC_AVE, 3.5 }, { SUBTOTAL_FUNC_CNT2, 12.0 }, @@ -640,7 +640,7 @@ void Test::testSelectionFunction() CPPUNIT_ASSERT_MESSAGE("This row should be hidden.", m_pDoc->RowHidden(5, 0)); { - Check aChecks[] = + static const Check aChecks[] = { { SUBTOTAL_FUNC_AVE, 3.0 }, { SUBTOTAL_FUNC_CNT2, 8.0 }, @@ -667,7 +667,7 @@ void Test::testSelectionFunction() // D3 (numeric cell containing 5.) ScAddress aPos(3, 2, 0); - Check aChecks[] = + static const Check aChecks[] = { { SUBTOTAL_FUNC_AVE, 5.0 }, { SUBTOTAL_FUNC_CNT2, 1.0 }, @@ -691,7 +691,7 @@ void Test::testSelectionFunction() // B7 (string formula cell containing ="C".) ScAddress aPos(1, 6, 0); - Check aChecks[] = + static const Check aChecks[] = { { SUBTOTAL_FUNC_CNT2, 1.0 }, { SUBTOTAL_FUNC_SELECTION_COUNT, 1.0 } @@ -905,7 +905,7 @@ void Test::testHorizontalIterator() { "E", "3" } }; - HoriIterCheck aChecks[] = { + static const HoriIterCheck aChecks[] = { { 0, 0, "A" }, { 1, 0, "B" }, { 0, 1, "C" }, @@ -931,7 +931,7 @@ void Test::testHorizontalIterator() { "D", "E" }, }; - HoriIterCheck aChecks[] = { + static const HoriIterCheck aChecks[] = { { 0, 0, "A" }, { 1, 0, "B" }, { 0, 1, "C" }, @@ -960,7 +960,7 @@ void Test::testHorizontalIterator() { nullptr, nullptr }, }; - HoriIterCheck aChecks[] = { + static const HoriIterCheck aChecks[] = { { 1, 0, "A" }, { 1, 2, "1" }, { 0, 3, "B" }, @@ -1002,7 +1002,7 @@ void Test::testHorizontalIterator() { nullptr, "A" }, }; - HoriIterCheck aChecks[] = { + static const HoriIterCheck aChecks[] = { { 1, 2, "A" }, }; @@ -1023,7 +1023,7 @@ void Test::testHorizontalIterator() { nullptr, nullptr }, }; - HoriIterCheck aChecks[] = { + static const HoriIterCheck aChecks[] = { { 1, 2, "A" }, { 1, 3, "1" }, }; @@ -1518,7 +1518,7 @@ void Test::testFuncParam() void Test::testNamedRange() { - RangeNameDef aNames[] = { + static const RangeNameDef aNames[] = { { "Divisor", "$Sheet1.$A$1:$A$1048576", 1 }, { "MyRange1", "$Sheet1.$A$1:$A$100", 2 }, { "MyRange2", "$Sheet1.$B$1:$B$100", 3 }, @@ -1600,7 +1600,7 @@ void Test::testInsertNameList() { m_pDoc->InsertTab(0, "Test"); - RangeNameDef aNames[] = { + static const RangeNameDef aNames[] = { { "MyRange1", "$Test.$A$1:$A$100", 1 }, { "MyRange2", "$Test.$B$1:$B$100", 2 }, { "MyRange3", "$Test.$C$1:$C$100", 3 } @@ -3722,7 +3722,7 @@ void Test::testCopyPasteSkipEmpty() // Check the initial condition. { - Check aChecks[] = { + static const Check aChecks[] = { { "A", COL_BLUE, true }, { "B", COL_BLUE, true }, { "C", COL_BLUE, true }, @@ -3753,7 +3753,7 @@ void Test::testCopyPasteSkipEmpty() // Check the content after the paste. { - Check aChecks[] = { + static const Check aChecks[] = { { "Clip1", COL_YELLOW, false }, { "B", COL_BLUE, true }, { "Clip2", COL_YELLOW, false }, @@ -3768,7 +3768,7 @@ void Test::testCopyPasteSkipEmpty() // Undo, and check the content. aUndo.Undo(); { - Check aChecks[] = { + static const Check aChecks[] = { { "A", COL_BLUE, true }, { "B", COL_BLUE, true }, { "C", COL_BLUE, true }, @@ -3783,7 +3783,7 @@ void Test::testCopyPasteSkipEmpty() // Redo, and check the content again. aUndo.Redo(); { - Check aChecks[] = { + static const Check aChecks[] = { { "Clip1", COL_YELLOW, false }, { "B", COL_BLUE, true }, { "Clip2", COL_YELLOW, false }, diff --git a/sc/qa/unit/ucalc_column.cxx b/sc/qa/unit/ucalc_column.cxx index a650b628b20f..35ffc0151a77 100644 --- a/sc/qa/unit/ucalc_column.cxx +++ b/sc/qa/unit/ucalc_column.cxx @@ -99,7 +99,7 @@ void Test::testSetFormula() { m_pDoc->InsertTab(0, "Test"); - struct aInputs + static struct aInputs { const char* aName; SCROW const nRow; @@ -108,7 +108,7 @@ void Test::testSetFormula() const char* aFormula2; // Represents the formula that is actually stored in the cell. formula::FormulaGrammar::Grammar const eGram; - } aTest[] = { + } const aTest[] = { { "Rock and Roll" ,5 , 4 , "=SUM($D$2:$F$3)" ,"=SUM($D$2:$F$3)" , formula::FormulaGrammar::Grammar::GRAM_ENGLISH }, { "Blues" ,5 , 5 , "=A1-$C2+B$3-$F$4" ,"=A1-$C2+B$3-$F$4", formula::FormulaGrammar::Grammar::GRAM_NATIVE }, { "Acoustic" ,6 , 6 , "=A1-$C2+B$3-$F$4" ,"=A1-$C2+B$3-$F$4", formula::FormulaGrammar::Grammar::GRAM_NATIVE_XL_A1}, diff --git a/sc/qa/unit/ucalc_condformat.cxx b/sc/qa/unit/ucalc_condformat.cxx index ad64e51e4853..633bfd86fbcc 100644 --- a/sc/qa/unit/ucalc_condformat.cxx +++ b/sc/qa/unit/ucalc_condformat.cxx @@ -562,9 +562,9 @@ void Test::testIconSet() m_pDoc->AddCondFormatData(pFormat->GetRange(), 0, 1); pList->InsertNew(pFormat); - struct { + static struct { double nVal; sal_Int32 nIndex; - } aTests[] = { + } const aTests[] = { { -1.0, 0 }, { 0.0, 0 }, { 1.0, 1 }, @@ -590,7 +590,7 @@ struct ScDataBarLengthData double const nLength; }; -void testDataBarLengthImpl(ScDocument* pDoc, ScDataBarLengthData* pData, const ScRange& rRange, +void testDataBarLengthImpl(ScDocument* pDoc, const ScDataBarLengthData* pData, const ScRange& rRange, double nMinVal, ScColorScaleEntryType eMinType, double nMaxVal, ScColorScaleEntryType eMaxType, double nZeroPos, databar::ScAxisPosition eAxisPos) @@ -635,7 +635,7 @@ void Test::testDataBarLengthAutomaticAxis() { m_pDoc->InsertTab(0, "Test"); - ScDataBarLengthData aValues[] = { + static const ScDataBarLengthData aValues[] = { { 2, 0 }, { 3, 0 }, { 4, 25.0 }, @@ -650,7 +650,7 @@ void Test::testDataBarLengthAutomaticAxis() testDataBarLengthImpl(m_pDoc, aValues, ScRange(0,0,0,0,7,0), 3, COLORSCALE_VALUE, 7, COLORSCALE_VALUE, 0.0, databar::AUTOMATIC); - ScDataBarLengthData aValues2[] = { + static const ScDataBarLengthData aValues2[] = { { -6, -100 }, { -5, -100 }, { -4, -100 }, @@ -672,7 +672,7 @@ void Test::testDataBarLengthAutomaticAxis() testDataBarLengthImpl(m_pDoc, aValues2, ScRange(1,0,0,1,15,0), -4, COLORSCALE_VALUE, 8, COLORSCALE_VALUE, 1.0/3.0 * 100, databar::AUTOMATIC); - ScDataBarLengthData aValues3[] = { + static const ScDataBarLengthData aValues3[] = { { 2, 0.0 }, { 3, 25.0 }, { 4, 50.0 }, @@ -682,7 +682,7 @@ void Test::testDataBarLengthAutomaticAxis() testDataBarLengthImpl(m_pDoc, aValues3, ScRange(2,0,0,2,3,0), 0, COLORSCALE_MIN, 0, COLORSCALE_MAX, 0, databar::AUTOMATIC); - ScDataBarLengthData aValues4[] = { + static const ScDataBarLengthData aValues4[] = { { 2, 40.0 }, { 3, 60.0 }, { 4, 80.0 }, @@ -699,7 +699,7 @@ void Test::testDataBarLengthMiddleAxis() { m_pDoc->InsertTab(0, "Test"); - ScDataBarLengthData aValues[] = { + static const ScDataBarLengthData aValues[] = { { 1, 25.0 }, { 2, 25.0 }, { 3, 37.5 }, @@ -715,7 +715,7 @@ void Test::testDataBarLengthMiddleAxis() testDataBarLengthImpl(m_pDoc, aValues, ScRange(0,0,0,0,8,0), 2, COLORSCALE_VALUE, 8, COLORSCALE_VALUE, 50.0, databar::MIDDLE); - ScDataBarLengthData aValues2[] = { + static const ScDataBarLengthData aValues2[] = { { -6, -50 }, { -5, -50 }, { -4, -50 }, diff --git a/sc/qa/unit/ucalc_formula.cxx b/sc/qa/unit/ucalc_formula.cxx index 6bfccbc97bdc..cc55a350f9db 100644 --- a/sc/qa/unit/ucalc_formula.cxx +++ b/sc/qa/unit/ucalc_formula.cxx @@ -103,8 +103,8 @@ void Test::testFormulaCreateStringFromTokens() m_pDoc->InsertTab(3, aTabName4); // Insert named ranges. - struct { - bool const bGlobal; + static const struct { + bool bGlobal; const char* pName; const char* pExpr; } aNames[] = { @@ -139,7 +139,7 @@ void Test::testFormulaCreateStringFromTokens() } // Insert DB ranges. - struct { + static const struct { const char* pName; SCTAB const nTab; SCCOL const nCol1; @@ -809,7 +809,7 @@ void Test::testFormulaHashAndTag() // Test formula hashing. - struct { + static const struct { const char* pFormula1; const char* pFormula2; bool bEqual; } aHashTests[] = { { "=1", "=2", false }, // different constants @@ -864,7 +864,7 @@ void Test::testFormulaHashAndTag() // Test formula vectorization state. - struct { + static const struct { const char* pFormula; ScFormulaVectorState const eState; } aVectorTests[] = { @@ -903,7 +903,7 @@ void Test::testFormulaTokenEquality() bool const mbEqual; }; - FormulaTokenEqualityTest aTests[] = { + static const FormulaTokenEqualityTest aTests[] = { { "R1C2", "R1C2", true }, { "R1C2", "R1C3", false }, { "R1C2", "R2C2", false }, @@ -990,7 +990,7 @@ void Test::testFormulaRefData() void Test::testFormulaCompiler() { - struct { + static const struct { const char* pInput; FormulaGrammar::Grammar eInputGram; const char* pOutput; FormulaGrammar::Grammar eOutputGram; } aTests[] = { @@ -1040,7 +1040,7 @@ void Test::testFormulaCompilerJumpReordering() aCompRPN.CompileTokenArray(); // RPN tokens should be ordered: B1, ocIf, C1, ocSep, D1, ocClose. - TokenCheck aCheckRPN[] = + static const TokenCheck aCheckRPN[] = { { ocPush, svSingleRef }, { ocIf, svUnknown }, // type is context dependent, don't test it @@ -1068,7 +1068,7 @@ void Test::testFormulaCompilerJumpReordering() aCompRPN2.EnableJumpCommandReorder(false); aCompRPN2.CompileTokenArray(); - TokenCheck aCheckRPN2[] = + static const TokenCheck aCheckRPN2[] = { { ocPush, svSingleRef }, { ocPush, svDouble }, @@ -4646,7 +4646,7 @@ void Test::testFuncCOUNTIF() printRange(m_pDoc, ScRange(0, 0, 0, 0, 8, 0), "data range for COUNTIF"); // formulas and results - struct { + static const struct { const char* pFormula; double fResult; } aChecks[] = { { "=COUNTIF(A1:A12;1999)", 1 }, @@ -4838,7 +4838,7 @@ void Test::testFuncIFERROR() printRange(m_pDoc, ScRange(0, 0, 0, 0, nRows-1, 0), "data range for IFERROR/IFNA"); // formulas and results - struct { + static const struct { const char* pFormula; const char* pResult; } aChecks[] = { { "=IFERROR(A1;9)", "1" }, @@ -5007,7 +5007,7 @@ void Test::testFuncNUMBERVALUE() printRange(m_pDoc, ScRange(0, 0, 0, 0, nRows - 1, 0), "data range for NUMBERVALUE"); // formulas and results - struct { + static const struct { const char* pFormula; const char* pResult; } aChecks[] = { { "=NUMBERVALUE(A1;\"b\";\"ag\")", "199.9" }, @@ -5189,7 +5189,7 @@ void Test::testFuncVLOOKUP() printRange(m_pDoc, ScRange(0, 0, 0, 1, 13, 0), "raw data for VLOOKUP"); // Formula data - struct { + static const struct { const char* pLookup; const char* pFormula; const char* pRes; } aChecks[] = { { "Lookup", "Formula", nullptr }, @@ -5321,7 +5321,7 @@ struct StrStrCheck { }; template -static void runTestMATCH(ScDocument* pDoc, const char* aData[DataSize], StrStrCheck aChecks[FormulaSize]) +static void runTestMATCH(ScDocument* pDoc, const char* aData[DataSize], const StrStrCheck aChecks[FormulaSize]) { size_t nDataSize = DataSize; for (size_t i = 0; i < nDataSize; ++i) @@ -5360,7 +5360,7 @@ static void runTestMATCH(ScDocument* pDoc, const char* aData[DataSize], StrStrCh } template -static void runTestHorizontalMATCH(ScDocument* pDoc, const char* aData[DataSize], StrStrCheck aChecks[FormulaSize]) +static void runTestHorizontalMATCH(ScDocument* pDoc, const char* aData[DataSize], const StrStrCheck aChecks[FormulaSize]) { size_t nDataSize = DataSize; for (size_t i = 0; i < nDataSize; ++i) @@ -5425,7 +5425,7 @@ void Test::testFuncMATCH() }; // formula (B1:C12) - StrStrCheck aChecks[] = { + static const StrStrCheck aChecks[] = { { "0.8", "#N/A" }, { "1.2", "1" }, { "2.3", "2" }, @@ -5469,7 +5469,7 @@ void Test::testFuncMATCH() }; // formula (B1:C12) - StrStrCheck aChecks[] = { + static const StrStrCheck aChecks[] = { { "10", "#N/A" }, { "8.9", "4" }, { "7.8", "5" }, @@ -6481,7 +6481,7 @@ void Test::testExternalRefFunctions() m_pDoc->InsertTab(0, "Test"); - struct { + static const struct { const char* pFormula; double fResult; } aChecks[] = { { "=SUM('file:///extdata.fake'#Data.A1:A4)", 10 }, @@ -6816,7 +6816,7 @@ void Test::testFuncTableRef() /* TODO: should the item/header separator really be equal to the parameter * separator, thus be locale dependent and ';' semicolon here, or should it * be a fixed ',' comma instead? */ - struct { + static const struct { const char* pName; const char* pExpr; const char* pCounta; // expected result when used in row 2 (first data row) as argument to COUNTA() @@ -6990,7 +6990,7 @@ void Test::testFuncTableRef() } // Named expressions that use header-less Table structured references. - struct { + static const struct { const char* pName; const char* pExpr; const char* pCounta; // expected result when used in row 10 (first data row) as argument to COUNTA() diff --git a/sc/qa/unit/ucalc_pivottable.cxx b/sc/qa/unit/ucalc_pivottable.cxx index f8a1da6235ef..d62a6cb3b9d0 100644 --- a/sc/qa/unit/ucalc_pivottable.cxx +++ b/sc/qa/unit/ucalc_pivottable.cxx @@ -46,7 +46,7 @@ struct DPFieldDef }; template -ScRange insertDPSourceData(ScDocument* pDoc, DPFieldDef aFields[], size_t nFieldCount, const char* aData[][Size], size_t nDataCount) +ScRange insertDPSourceData(ScDocument* pDoc, DPFieldDef const aFields[], size_t nFieldCount, const char* aData[][Size], size_t nDataCount) { // Insert field names in row 0. for (size_t i = 0; i < nFieldCount; ++i) @@ -84,7 +84,7 @@ bool checkDPTableOutput( } ScDPObject* createDPFromSourceDesc( - ScDocument* pDoc, const ScSheetSourceDesc& rDesc, DPFieldDef aFields[], size_t nFieldCount, + ScDocument* pDoc, const ScSheetSourceDesc& rDesc, const DPFieldDef aFields[], size_t nFieldCount, bool bFilterButton) { ScDPObject* pDPObj = new ScDPObject(pDoc); @@ -155,7 +155,7 @@ ScDPObject* createDPFromSourceDesc( } ScDPObject* createDPFromRange( - ScDocument* pDoc, const ScRange& rRange, DPFieldDef aFields[], size_t nFieldCount, + ScDocument* pDoc, const ScRange& rRange, const DPFieldDef aFields[], size_t nFieldCount, bool bFilterButton) { ScSheetSourceDesc aSheetDesc(pDoc); @@ -195,7 +195,7 @@ void Test::testPivotTable() m_pDoc->InsertTab(1, "Table"); // Dimension definition - DPFieldDef aFields[] = { + static const DPFieldDef aFields[] = { { "Name", sheet::DataPilotFieldOrientation_ROW, ScGeneralFunction::NONE, false }, { "Group", sheet::DataPilotFieldOrientation_COLUMN, ScGeneralFunction::NONE, false }, { "Score", sheet::DataPilotFieldOrientation_DATA, ScGeneralFunction::NONE, false } @@ -377,7 +377,7 @@ void Test::testPivotTableLabels() m_pDoc->InsertTab(1, "Table"); // Dimension definition - DPFieldDef aFields[] = { + static const DPFieldDef aFields[] = { { "Software", sheet::DataPilotFieldOrientation_ROW, ScGeneralFunction::NONE, false }, { "Version", sheet::DataPilotFieldOrientation_COLUMN, ScGeneralFunction::NONE, false }, { "1.2.3", sheet::DataPilotFieldOrientation_DATA, ScGeneralFunction::NONE, false } @@ -432,7 +432,7 @@ void Test::testPivotTableDateLabels() m_pDoc->InsertTab(1, "Table"); // Dimension definition - DPFieldDef aFields[] = { + static const DPFieldDef aFields[] = { { "Name", sheet::DataPilotFieldOrientation_ROW, ScGeneralFunction::NONE, false }, { "Date", sheet::DataPilotFieldOrientation_COLUMN, ScGeneralFunction::NONE, false }, { "Value", sheet::DataPilotFieldOrientation_DATA, ScGeneralFunction::NONE, false } @@ -507,7 +507,7 @@ void Test::testPivotTableFilters() m_pDoc->InsertTab(1, "Table"); // Dimension definition - DPFieldDef aFields[] = { + static const DPFieldDef aFields[] = { { "Name", sheet::DataPilotFieldOrientation_HIDDEN, ScGeneralFunction::NONE, false }, { "Group1", sheet::DataPilotFieldOrientation_HIDDEN, ScGeneralFunction::NONE, false }, { "Group2", sheet::DataPilotFieldOrientation_PAGE, ScGeneralFunction::NONE, false }, @@ -659,7 +659,7 @@ void Test::testPivotTableNamedSource() m_pDoc->InsertTab(1, "Table"); // Dimension definition - DPFieldDef aFields[] = { + static const DPFieldDef aFields[] = { { "Name", sheet::DataPilotFieldOrientation_ROW, ScGeneralFunction::NONE, false }, { "Group", sheet::DataPilotFieldOrientation_COLUMN, ScGeneralFunction::NONE, false }, { "Score", sheet::DataPilotFieldOrientation_DATA, ScGeneralFunction::NONE, false } @@ -958,7 +958,7 @@ void Test::testPivotTableDuplicateDataFields() }; // Dimension definition - DPFieldDef aFields[] = { + static const DPFieldDef aFields[] = { { "Name", sheet::DataPilotFieldOrientation_ROW, ScGeneralFunction::NONE, false }, { "Value", sheet::DataPilotFieldOrientation_DATA, ScGeneralFunction::SUM, false }, { "Value", sheet::DataPilotFieldOrientation_DATA, ScGeneralFunction::COUNT, false } @@ -1050,7 +1050,7 @@ void Test::testPivotTableNormalGrouping() }; // Dimension definition - DPFieldDef aFields[] = { + static const DPFieldDef aFields[] = { { "Name", sheet::DataPilotFieldOrientation_ROW, ScGeneralFunction::NONE, false }, { "Value", sheet::DataPilotFieldOrientation_DATA, ScGeneralFunction::SUM, false }, }; @@ -1210,7 +1210,7 @@ void Test::testPivotTableNumberGrouping() }; // Dimension definition - DPFieldDef aFields[] = { + static const DPFieldDef aFields[] = { { "Order", sheet::DataPilotFieldOrientation_ROW, ScGeneralFunction::NONE, false }, { "Score", sheet::DataPilotFieldOrientation_DATA, ScGeneralFunction::SUM, false }, }; @@ -1293,7 +1293,7 @@ void Test::testPivotTableDateGrouping() }; // Dimension definition - DPFieldDef aFields[] = { + static const DPFieldDef aFields[] = { { "Date", sheet::DataPilotFieldOrientation_ROW, ScGeneralFunction::NONE, false }, { "Value", sheet::DataPilotFieldOrientation_DATA, ScGeneralFunction::SUM, false }, }; @@ -1461,7 +1461,7 @@ void Test::testPivotTableEmptyRows() }; // Dimension definition - DPFieldDef aFields[] = { + static const DPFieldDef aFields[] = { { "Name", sheet::DataPilotFieldOrientation_ROW, ScGeneralFunction::NONE, false }, { "Value", sheet::DataPilotFieldOrientation_DATA, ScGeneralFunction::SUM, false }, }; @@ -1572,7 +1572,7 @@ void Test::testPivotTableTextNumber() }; // Dimension definition - DPFieldDef aFields[] = { + static const DPFieldDef aFields[] = { { "Name", sheet::DataPilotFieldOrientation_ROW, ScGeneralFunction::NONE, false }, { "Value", sheet::DataPilotFieldOrientation_DATA, ScGeneralFunction::SUM, false }, }; @@ -1671,7 +1671,7 @@ void Test::testPivotTableCaseInsensitiveStrings() }; // Dimension definition - DPFieldDef aFields[] = { + static const DPFieldDef aFields[] = { { "Name", sheet::DataPilotFieldOrientation_ROW, ScGeneralFunction::NONE, false }, { "Value", sheet::DataPilotFieldOrientation_DATA, ScGeneralFunction::SUM, false }, }; @@ -1745,7 +1745,7 @@ void Test::testPivotTableNumStability() }; // Dimension definition - DPFieldDef aFields[] = { + static const DPFieldDef aFields[] = { { "Name", sheet::DataPilotFieldOrientation_ROW, ScGeneralFunction::NONE, false }, { "Total", sheet::DataPilotFieldOrientation_DATA, ScGeneralFunction::SUM, false }, }; @@ -1830,7 +1830,7 @@ void Test::testPivotTableFieldReference() }; // Dimension definition - DPFieldDef aFields[] = { + static const DPFieldDef aFields[] = { { "Name", sheet::DataPilotFieldOrientation_ROW, ScGeneralFunction::NONE, false }, { "Value", sheet::DataPilotFieldOrientation_DATA, ScGeneralFunction::SUM, false }, }; @@ -1998,7 +1998,7 @@ void Test::testPivotTableDocFunc() }; // Dimension definition - DPFieldDef aFields[] = { + static const DPFieldDef aFields[] = { { "Name", sheet::DataPilotFieldOrientation_ROW, ScGeneralFunction::NONE, false }, { "Value", sheet::DataPilotFieldOrientation_DATA, ScGeneralFunction::SUM, false }, }; @@ -2073,7 +2073,7 @@ void Test::testFuncGETPIVOTDATA() { // Dimension definition - DPFieldDef aFields[] = { + static const DPFieldDef aFields[] = { { "Name", sheet::DataPilotFieldOrientation_ROW, ScGeneralFunction::NONE, false }, { "Value", sheet::DataPilotFieldOrientation_DATA, ScGeneralFunction::SUM, false }, }; @@ -2134,7 +2134,7 @@ void Test::testFuncGETPIVOTDATA() { // Dimension definition - DPFieldDef aFields[] = { + static const DPFieldDef aFields[] = { { "Name", sheet::DataPilotFieldOrientation_ROW, ScGeneralFunction::NONE, false }, { "Value", sheet::DataPilotFieldOrientation_DATA, ScGeneralFunction::SUM, false }, { "Value", sheet::DataPilotFieldOrientation_DATA, ScGeneralFunction::COUNT, false }, @@ -2228,7 +2228,7 @@ void Test::testFuncGETPIVOTDATALeafAccess() ScDPObject* pDPObj = nullptr; // Dimension definition - DPFieldDef aFields[] = { + static const DPFieldDef aFields[] = { { "Type", sheet::DataPilotFieldOrientation_ROW, ScGeneralFunction::NONE, false }, { "Member", sheet::DataPilotFieldOrientation_ROW, ScGeneralFunction::NONE, false }, { "Value", sheet::DataPilotFieldOrientation_DATA, ScGeneralFunction::SUM, false }, @@ -2267,7 +2267,7 @@ void Test::testFuncGETPIVOTDATALeafAccess() double const mfResult; }; - Check aChecks[] = { + static const Check aChecks[] = { { "=GETPIVOTDATA($A$1;\"Member[Anna]\")", 1.0 }, { "=GETPIVOTDATA($A$1;\"Member[Brittany]\")", 2.0 }, { "=GETPIVOTDATA($A$1;\"Member[Cecilia]\")", 3.0 }, @@ -2303,7 +2303,7 @@ void Test::testPivotTableRepeatItemLabels() m_pDoc->InsertTab(1, "Table"); // Dimension definition - DPFieldDef aFields[] = { + static const DPFieldDef aFields[] = { { "Name", sheet::DataPilotFieldOrientation_ROW, ScGeneralFunction::NONE, true }, { "Country", sheet::DataPilotFieldOrientation_ROW, ScGeneralFunction::NONE, false }, { "Year", sheet::DataPilotFieldOrientation_ROW, ScGeneralFunction::NONE, false }, @@ -2380,7 +2380,7 @@ void Test::testPivotTableDPCollection() m_pDoc->InsertTab(1, "Table"); // Dimension definition - DPFieldDef aFields[] = { + static const DPFieldDef aFields[] = { { "Software", sheet::DataPilotFieldOrientation_ROW, ScGeneralFunction::NONE, false }, { "Version", sheet::DataPilotFieldOrientation_COLUMN, ScGeneralFunction::NONE, false }, { "1.2.3", sheet::DataPilotFieldOrientation_DATA, ScGeneralFunction::NONE, false } @@ -2489,7 +2489,7 @@ void Test::testPivotTableMedianFunc() }; // Dimension definition - DPFieldDef aFields[] = { + static const DPFieldDef aFields[] = { { "Condition", sheet::DataPilotFieldOrientation_ROW, ScGeneralFunction::NONE, false }, { "Day1Hit", sheet::DataPilotFieldOrientation_DATA, ScGeneralFunction::MEDIAN, false }, { "Day1Miss", sheet::DataPilotFieldOrientation_DATA, ScGeneralFunction::MEDIAN, false }, diff --git a/sc/qa/unit/ucalc_sort.cxx b/sc/qa/unit/ucalc_sort.cxx index 9a2c759b0aab..bf817873a341 100644 --- a/sc/qa/unit/ucalc_sort.cxx +++ b/sc/qa/unit/ucalc_sort.cxx @@ -472,9 +472,9 @@ void Test::testSortInFormulaGroup() { SortRefUpdateSetter aUpdateSet; - static struct { - SCCOL const nCol; - SCROW const nRow; + static const struct { + SCCOL nCol; + SCROW nRow; const char *pData; } aEntries[] = { { 0, 0, "3" }, { 1, 0, "=A1" }, @@ -506,10 +506,10 @@ void Test::testSortInFormulaGroup() m_pDoc->Sort(0, aSortData, false, true, nullptr, nullptr); - static struct { - SCCOL const nCol; - SCROW const nRow; - double const fValue; + static const struct { + SCCOL nCol; + SCROW nRow; + double fValue; } aResults[] = { { 0, 0, 1.0 }, { 1, 0, 1.0 }, { 0, 1, 2.0 }, { 1, 1, 3.0 }, diff --git a/sc/source/core/data/funcdesc.cxx b/sc/source/core/data/funcdesc.cxx index afbcd765f01d..6f31ab7cf234 100644 --- a/sc/source/core/data/funcdesc.cxx +++ b/sc/source/core/data/funcdesc.cxx @@ -415,7 +415,7 @@ ScFunctionList::ScFunctionList() // See ScFuncDescCore definition for format details. // This list must be sorted in order of the opcode, dbgutil builds enable _GLIBCXX_DEBUG // which will concept check that the list is sorted on first use to ensure this holds - ScFuncDescCore aDescs[] = + static const ScFuncDescCore aDescs[] = { { SC_OPCODE_IF, ENTRY(SC_OPCODE_IF_ARY), 0, ID_FUNCTION_GRP_LOGIC, HID_FUNC_WENN, 3, { 0, 1, 1 } }, { SC_OPCODE_IF_ERROR, ENTRY(SC_OPCODE_IF_ERROR_ARY), 0, ID_FUNCTION_GRP_LOGIC, HID_FUNC_IFERROR, 2, { 0, 0 } }, @@ -818,10 +818,10 @@ ScFunctionList::ScFunctionList() // otherwise the sub resources within the resource blocks and the // resource blocks themselves would had to be ordered according to // OpCodes, which is utopian... - ScFuncDescCore* pDescsEnd = aDescs + SAL_N_ELEMENTS(aDescs); + ScFuncDescCore const * pDescsEnd = aDescs + SAL_N_ELEMENTS(aDescs); for (sal_uInt16 i = 0; i <= SC_OPCODE_LAST_OPCODE_ID; ++i) { - ScFuncDescCore *pEntry = std::lower_bound(aDescs, pDescsEnd, i, + const ScFuncDescCore *pEntry = std::lower_bound(aDescs, pDescsEnd, i, [](const ScFuncDescCore &rItem, sal_uInt16 key) { return rItem.nOpCode < key; diff --git a/sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx b/sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx index cbed718e5f98..154bd2f73c34 100644 --- a/sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx +++ b/sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx @@ -35,7 +35,7 @@ struct StatisticCalculation { const char* aResultRangeName; }; -static StatisticCalculation lclBasicStatistics[] = +static StatisticCalculation const lclBasicStatistics[] = { { STR_ANOVA_LABEL_GROUPS, nullptr, nullptr }, { STRID_CALC_COUNT, "=COUNT(%RANGE%)", "COUNT_RANGE" }, diff --git a/sc/source/ui/unoobj/condformatuno.cxx b/sc/source/ui/unoobj/condformatuno.cxx index c0126179be85..9dd0cd45a6d9 100644 --- a/sc/source/ui/unoobj/condformatuno.cxx +++ b/sc/source/ui/unoobj/condformatuno.cxx @@ -80,7 +80,7 @@ struct ConditionEntryApiMap sal_Int32 const nApiMode; }; -ConditionEntryApiMap aConditionEntryMap[] = +static ConditionEntryApiMap const aConditionEntryMap[] = { {ScConditionMode::Equal, sheet::ConditionFormatOperator::EQUAL}, {ScConditionMode::Less, sheet::ConditionFormatOperator::LESS}, @@ -131,7 +131,7 @@ struct ColorScaleEntryTypeApiMap sal_Int32 const nApiType; }; -ColorScaleEntryTypeApiMap aColorScaleEntryTypeMap[] = +static ColorScaleEntryTypeApiMap const aColorScaleEntryTypeMap[] = { { COLORSCALE_MIN, sheet::ColorScaleEntryType::COLORSCALE_MIN }, { COLORSCALE_MAX, sheet::ColorScaleEntryType::COLORSCALE_MAX }, @@ -180,7 +180,7 @@ struct DataBarAxisApiMap sal_Int32 const nApiPos; }; -DataBarAxisApiMap aDataBarAxisMap[] = +static DataBarAxisApiMap const aDataBarAxisMap[] = { { databar::NONE, sheet::DataBarAxis::AXIS_NONE }, { databar::AUTOMATIC, sheet::DataBarAxis::AXIS_AUTOMATIC }, @@ -193,7 +193,7 @@ struct DataBarEntryTypeApiMap sal_Int32 const nApiType; }; -DataBarEntryTypeApiMap aDataBarEntryTypeMap[] = +static DataBarEntryTypeApiMap const aDataBarEntryTypeMap[] = { { COLORSCALE_AUTO, sheet::DataBarEntryType::DATABAR_AUTO }, { COLORSCALE_MIN, sheet::DataBarEntryType::DATABAR_MIN }, @@ -260,7 +260,7 @@ struct IconSetEntryTypeApiMap sal_Int32 const nApiType; }; -IconSetEntryTypeApiMap aIconSetEntryTypeMap[] = +static IconSetEntryTypeApiMap const aIconSetEntryTypeMap[] = { { COLORSCALE_MIN, sheet::IconSetFormatEntry::ICONSET_MIN }, { COLORSCALE_VALUE, sheet::IconSetFormatEntry::ICONSET_VALUE }, @@ -292,7 +292,7 @@ struct DateTypeApiMap sal_Int32 const nApiType; }; -DateTypeApiMap aDateTypeApiMap[] = +static DateTypeApiMap const aDateTypeApiMap[] = { { condformat::TODAY, sheet::DateType::TODAY }, { condformat::YESTERDAY, sheet::DateType::YESTERDAY }, @@ -741,7 +741,7 @@ void SAL_CALL ScConditionEntryObj::setPropertyValue( sal_Int32 nVal; if (aValue >>= nVal) { - for (ConditionEntryApiMap & rEntry : aConditionEntryMap) + for (ConditionEntryApiMap const & rEntry : aConditionEntryMap) { if (rEntry.nApiMode == nVal) { @@ -789,7 +789,7 @@ uno::Any SAL_CALL ScConditionEntryObj::getPropertyValue( const OUString& aProper case Operator: { ScConditionMode eMode = getCoreObject()->GetOperation(); - for (ConditionEntryApiMap & rEntry : aConditionEntryMap) + for (ConditionEntryApiMap const & rEntry : aConditionEntryMap) { if (rEntry.eMode == eMode) { @@ -869,7 +869,7 @@ void setColorScaleEntry(ScColorScaleEntry* pEntry, uno::ReferencegetType(); bool bFound = false; - for (ColorScaleEntryTypeApiMap & rEntry : aColorScaleEntryTypeMap) + for (ColorScaleEntryTypeApiMap const & rEntry : aColorScaleEntryTypeMap) { if (rEntry.nApiType == nApiType) { @@ -1023,7 +1023,7 @@ void ScColorScaleEntryObj::setColor(util::Color aColor) sal_Int32 ScColorScaleEntryObj::getType() { ScColorScaleEntry* pEntry = getCoreObject(); - for (ColorScaleEntryTypeApiMap & rEntry : aColorScaleEntryTypeMap) + for (ColorScaleEntryTypeApiMap const & rEntry : aColorScaleEntryTypeMap) { if (rEntry.eType == pEntry->GetType()) { @@ -1037,7 +1037,7 @@ sal_Int32 ScColorScaleEntryObj::getType() void ScColorScaleEntryObj::setType(sal_Int32 nType) { ScColorScaleEntry* pEntry = getCoreObject(); - for (ColorScaleEntryTypeApiMap & rEntry : aColorScaleEntryTypeMap) + for (ColorScaleEntryTypeApiMap const & rEntry : aColorScaleEntryTypeMap) { if (rEntry.nApiType == nType) { @@ -1120,7 +1120,7 @@ void setDataBarEntry(ScColorScaleEntry* pEntry, uno::ReferencegetType(); bool bFound = false; - for (DataBarEntryTypeApiMap & rEntry : aDataBarEntryTypeMap) + for (DataBarEntryTypeApiMap const & rEntry : aDataBarEntryTypeMap) { if (rEntry.nApiType == nApiType) { @@ -1167,7 +1167,7 @@ void SAL_CALL ScDataBarFormatObj::setPropertyValue( sal_Int32 nVal; if (aValue >>= nVal) { - for (DataBarAxisApiMap & rEntry : aDataBarAxisMap) + for (DataBarAxisApiMap const & rEntry : aDataBarAxisMap) { if (rEntry.nApiPos == nVal) { @@ -1291,7 +1291,7 @@ uno::Any SAL_CALL ScDataBarFormatObj::getPropertyValue( const OUString& aPropert { databar::ScAxisPosition ePos = getCoreObject()->GetDataBarData()->meAxisPosition; sal_Int32 nApiPos = sheet::DataBarAxis::AXIS_NONE; - for (DataBarAxisApiMap & rEntry : aDataBarAxisMap) + for (DataBarAxisApiMap const & rEntry : aDataBarAxisMap) { if (rEntry.ePos == ePos) { @@ -1397,7 +1397,7 @@ ScColorScaleEntry* ScDataBarEntryObj::getCoreObject() sal_Int32 ScDataBarEntryObj::getType() { ScColorScaleEntry* pEntry = getCoreObject(); - for (DataBarEntryTypeApiMap & rEntry : aDataBarEntryTypeMap) + for (DataBarEntryTypeApiMap const & rEntry : aDataBarEntryTypeMap) { if (rEntry.eType == pEntry->GetType()) { @@ -1411,7 +1411,7 @@ sal_Int32 ScDataBarEntryObj::getType() void ScDataBarEntryObj::setType(sal_Int32 nType) { ScColorScaleEntry* pEntry = getCoreObject(); - for (DataBarEntryTypeApiMap & rEntry : aDataBarEntryTypeMap) + for (DataBarEntryTypeApiMap const & rEntry : aDataBarEntryTypeMap) { if (rEntry.nApiType == nType) { @@ -1495,7 +1495,7 @@ void setIconSetEntry(ScIconSetFormat* pFormat, uno::ReferencegetType(); bool bFound = false; - for (IconSetEntryTypeApiMap & rEntry : aIconSetEntryTypeMap) + for (IconSetEntryTypeApiMap const & rEntry : aIconSetEntryTypeMap) { if (rEntry.nApiType == nApiType) { @@ -1697,7 +1697,7 @@ sal_Int32 ScIconSetEntryObj::getType() if (mnPos == 0) return sheet::IconSetFormatEntry::ICONSET_MIN; - for (IconSetEntryTypeApiMap & rEntry : aIconSetEntryTypeMap) + for (IconSetEntryTypeApiMap const & rEntry : aIconSetEntryTypeMap) { if (rEntry.eType == pEntry->GetType()) { @@ -1715,7 +1715,7 @@ void ScIconSetEntryObj::setType(sal_Int32 nType) return; ScColorScaleEntry* pEntry = getCoreObject(); - for (IconSetEntryTypeApiMap & rEntry : aIconSetEntryTypeMap) + for (IconSetEntryTypeApiMap const & rEntry : aIconSetEntryTypeMap) { if (rEntry.nApiType == nType) { @@ -1818,7 +1818,7 @@ void SAL_CALL ScCondDateFormatObj::setPropertyValue( if (!(aValue >>= nApiType)) throw lang::IllegalArgumentException(); - for (DateTypeApiMap & rEntry : aDateTypeApiMap) + for (DateTypeApiMap const & rEntry : aDateTypeApiMap) { if (rEntry.nApiType == nApiType) { @@ -1855,7 +1855,7 @@ uno::Any SAL_CALL ScCondDateFormatObj::getPropertyValue( const OUString& aProper case DateType: { condformat::ScCondFormatDateType eType = getCoreObject()->GetDateType(); - for (DateTypeApiMap & rEntry : aDateTypeApiMap) + for (DateTypeApiMap const & rEntry : aDateTypeApiMap) { if (rEntry.eType == eType) { -- cgit