sc/inc/calcmacros.hxx | 3 sc/qa/unit/helper/qahelper.cxx | 39 ++-- sc/qa/unit/pivottable_filters_test.cxx | 69 +++---- sc/qa/unit/subsequent_export_test3.cxx | 96 +++++----- sc/qa/unit/ucalc.cxx | 32 +-- sc/qa/unit/ucalc_copypaste.cxx | 31 +-- sc/qa/unit/ucalc_formula.cxx | 24 +- sc/qa/unit/ucalc_formula2.cxx | 33 +-- sc/qa/unit/ucalc_sharedformula.cxx | 11 - sc/qa/unit/ucalc_sort.cxx | 21 +- sc/source/core/data/column2.cxx | 42 ++-- sc/source/core/data/dociter.cxx | 12 - sc/source/core/data/document.cxx | 7 sc/source/core/data/dpcache.cxx | 32 +-- sc/source/core/data/dpfilteredcache.cxx | 37 ++-- sc/source/core/data/dpgroup.cxx | 17 - sc/source/core/data/dpnumgroupinfo.cxx | 16 - sc/source/core/data/dpobject.cxx | 18 -- sc/source/core/data/dpoutput.cxx | 13 - sc/source/core/data/dpoutputgeometry.cxx | 14 - sc/source/core/data/dpsave.cxx | 53 ++--- sc/source/core/data/dpsdbtab.cxx | 1 sc/source/core/data/dpshttab.cxx | 1 sc/source/core/data/dptabdat.cxx | 7 sc/source/core/data/dptabres.cxx | 48 ++--- sc/source/core/data/dptabsrc.cxx | 15 - sc/source/core/data/formulacell.cxx | 30 +-- sc/source/core/data/pivot2.cxx | 11 - sc/source/core/data/segmenttree.cxx | 4 sc/source/core/data/table5.cxx | 21 +- sc/source/core/data/tabprotection.cxx | 17 - sc/source/core/tool/chartarr.cxx | 6 sc/source/core/tool/chartlis.cxx | 10 - sc/source/core/tool/compiler.cxx | 13 - sc/source/core/tool/detfunc.cxx | 7 sc/source/core/tool/doubleref.cxx | 9 - sc/source/core/tool/interpr1.cxx | 13 - sc/source/core/tool/interpr2.cxx | 11 - sc/source/core/tool/interpr3.cxx | 71 +++---- sc/source/core/tool/interpr4.cxx | 3 sc/source/core/tool/interpr5.cxx | 41 ++-- sc/source/core/tool/rangelst.cxx | 5 sc/source/core/tool/rangenam.cxx | 3 sc/source/core/tool/reftokenhelper.cxx | 18 -- sc/source/core/tool/scmatrix.cxx | 19 -- sc/source/core/tool/token.cxx | 1 sc/source/filter/excel/excform.cxx | 4 sc/source/filter/excel/excform8.cxx | 4 sc/source/filter/excel/xelink.cxx | 6 sc/source/filter/excel/xepage.cxx | 9 - sc/source/filter/excel/xestream.cxx | 15 - sc/source/filter/excel/xichart.cxx | 11 - sc/source/filter/excel/xicontent.cxx | 19 +- sc/source/filter/excel/xipivot.cxx | 9 - sc/source/filter/excel/xistyle.cxx | 1 sc/source/filter/xml/XMLTableShapeResizer.cxx | 3 sc/source/filter/xml/xmlexprt.cxx | 13 - sc/source/ui/dbgui/pvfundlg.cxx | 9 - sc/source/ui/docshell/docfunc.cxx | 17 - sc/source/ui/docshell/docsh.cxx | 8 sc/source/ui/docshell/docsh5.cxx | 11 - sc/source/ui/docshell/docsh8.cxx | 5 sc/source/ui/docshell/externalrefmgr.cxx | 133 ++++++-------- sc/source/ui/docshell/macromgr.cxx | 16 - sc/source/ui/undo/undoblk.cxx | 4 sc/source/ui/undo/undoblk3.cxx | 2 sc/source/ui/undo/undotab.cxx | 22 +- sc/source/ui/unoobj/chart2uno.cxx | 234 ++++++++++++-------------- sc/source/ui/unoobj/linkuno.cxx | 9 - sc/source/ui/vba/vbarange.cxx | 5 sc/source/ui/view/dbfunc3.cxx | 5 sc/source/ui/view/gridwin2.cxx | 16 - sc/source/ui/view/tabvwshf.cxx | 1 sc/source/ui/view/viewfun2.cxx | 17 - sc/source/ui/view/viewfun6.cxx | 6 75 files changed, 734 insertions(+), 885 deletions(-)
New commits: commit 6376fe01859a14a22b2601ff04691ceb894c33d4 Author: Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk> AuthorDate: Wed Aug 20 12:54:03 2025 +0200 Commit: Tomaž Vajngerl <qui...@gmail.com> CommitDate: Wed Aug 20 18:52:24 2025 +0200 sc: always write "std::" for common types (unique_ptr, vector) No need for "using ::std::unique_ptr" and similar.... Also change some css types. Change-Id: Ie9ad52a8b4e3714c4a5a926014c2c0f166cc6585 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189967 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <qui...@gmail.com> diff --git a/sc/inc/calcmacros.hxx b/sc/inc/calcmacros.hxx index ebe96654804a..47ac2a97de1f 100644 --- a/sc/inc/calcmacros.hxx +++ b/sc/inc/calcmacros.hxx @@ -27,9 +27,6 @@ DUMP_COLUMN_STORAGE || DEBUG_COLUMN_STORAGE || \ DEBUG_FORMULA_COMPILER #include <iostream> -using std::cout; -using std::cerr; -using std::endl; #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/qa/unit/helper/qahelper.cxx b/sc/qa/unit/helper/qahelper.cxx index 384b91cbf777..21fa1a74a098 100644 --- a/sc/qa/unit/helper/qahelper.cxx +++ b/sc/qa/unit/helper/qahelper.cxx @@ -51,9 +51,6 @@ using namespace com::sun::star; using namespace ::com::sun::star::uno; -using ::std::cout; -using ::std::cerr; -using ::std::endl; FormulaGrammarSwitch::FormulaGrammarSwitch(ScDocument* pDoc, formula::FormulaGrammar::Grammar eGrammar) : mpDoc(pDoc), meOldGrammar(pDoc->GetGrammar()) @@ -363,33 +360,33 @@ const SdrOle2Obj* ScModelTestBase::getSingleOleObject(ScDocument& rDoc, sal_uInt ScDrawLayer* pDrawLayer = rDoc.GetDrawLayer(); if (!pDrawLayer) { - cout << "Failed to retrieve the drawing layer object." << endl; + std::cout << "Failed to retrieve the drawing layer object." << std::endl; return nullptr; } const SdrPage* pPage = pDrawLayer->GetPage(nPage); if (!pPage) { - cout << "Failed to retrieve the page object." << endl; + std::cout << "Failed to retrieve the page object." << std::endl; return nullptr; } if (pPage->GetObjCount() != 1) { - cout << "This page should contain one drawing object." << endl; + std::cout << "This page should contain one drawing object." << std::endl; return nullptr; } const SdrObject* pObj = pPage->GetObj(0); if (!pObj) { - cout << "Failed to retrieve the drawing object." << endl; + std::cout << "Failed to retrieve the drawing object." << std::endl; return nullptr; } if (pObj->GetObjIdentifier() != SdrObjKind::OLE2) { - cout << "This is not an OLE2 object." << endl; + std::cout << "This is not an OLE2 object." << std::endl; return nullptr; } @@ -405,7 +402,7 @@ const SdrOle2Obj* ScModelTestBase::getSingleChartObject(ScDocument& rDoc, sal_uI if (!pObj->IsChart()) { - cout << "This should be a chart object." << endl; + std::cout << "This should be a chart object." << std::endl; return nullptr; } @@ -420,35 +417,35 @@ static std::vector<OUString> getChartRangeRepresentations(const SdrOle2Obj& rCha Reference<frame::XModel> xModel = rChartObj.getXModel(); if (!xModel.is()) { - cout << "Failed to get the embedded object interface." << endl; + std::cout << "Failed to get the embedded object interface." << std::endl; return aRangeReps; } Reference<chart2::XChartDocument> xChartDoc(xModel, UNO_QUERY); if (!xChartDoc.is()) { - cout << "Failed to get the chart document interface." << endl; + std::cout << "Failed to get the chart document interface." << std::endl; return aRangeReps; } Reference<chart2::data::XDataSource> xDataSource(xChartDoc, UNO_QUERY); if (!xDataSource.is()) { - cout << "Failed to get the data source interface." << endl; + std::cout << "Failed to get the data source interface." << std::endl; return aRangeReps; } Sequence<Reference<chart2::data::XLabeledDataSequence> > xDataSeqs = xDataSource->getDataSequences(); if (!xDataSeqs.hasElements()) { - cout << "There should be at least one data sequences." << endl; + std::cout << "There should be at least one data sequences." << std::endl; return aRangeReps; } Reference<chart2::data::XDataReceiver> xDataRec(xChartDoc, UNO_QUERY); if (!xDataRec.is()) { - cout << "Failed to get the data receiver interface." << endl; + std::cout << "Failed to get the data receiver interface." << std::endl; return aRangeReps; } @@ -869,7 +866,7 @@ bool ScUcalcTestBase::insertRangeNames( bool bSuccess = pNames->insert(pNew); if (!bSuccess) { - cerr << "Insertion failed." << endl; + std::cerr << "Insertion failed." << std::endl; return false; } } @@ -888,9 +885,9 @@ OUString ScUcalcTestBase::getRangeByName(ScDocument* pDoc, const OUString& aRang void ScUcalcTestBase::printFormula(ScDocument* pDoc, SCCOL nCol, SCROW nRow, SCTAB nTab, const char* pCaption) { if (pCaption != nullptr) - cout << pCaption << ", "; - cout << nCol << "/" << nRow << ": " << pDoc->GetFormula(nCol, nRow, nTab); - cout << endl; + std::cout << pCaption << ", "; + std::cout << nCol << "/" << nRow << ": " << pDoc->GetFormula(nCol, nRow, nTab); + std::cout << std::endl; } #else // Avoid unused parameter warning @@ -944,14 +941,14 @@ bool ScUcalcTestBase::checkFormulaPosition(ScDocument& rDoc, const ScAddress& rP const ScFormulaCell* pFC = rDoc.GetFormulaCell(rPos); if (!pFC) { - cerr << "Formula cell expected at " << aStr << " but not found." << endl; + std::cerr << "Formula cell expected at " << aStr << " but not found." << std::endl; return false; } if (pFC->aPos != rPos) { OUString aStr2(pFC->aPos.Format(ScRefFlags::VALID)); - cerr << "Formula cell at " << aStr << " has incorrect position of " << aStr2 << endl; + std::cerr << "Formula cell at " << aStr << " has incorrect position of " << aStr2 << std::endl; return false; } @@ -970,7 +967,7 @@ bool ScUcalcTestBase::checkFormulaPositions( if (!checkFormulaPosition(rDoc, aPos)) { OUString aStr(aPos.Format(ScRefFlags::VALID)); - cerr << "Formula cell position failed at " << aStr << "." << endl; + std::cerr << "Formula cell position failed at " << aStr << "." << std::endl; return false; } } diff --git a/sc/qa/unit/pivottable_filters_test.cxx b/sc/qa/unit/pivottable_filters_test.cxx index 1c17f569deec..f3b0222c0572 100644 --- a/sc/qa/unit/pivottable_filters_test.cxx +++ b/sc/qa/unit/pivottable_filters_test.cxx @@ -31,9 +31,6 @@ #include <com/sun/star/sheet/DataPilotFieldGroupBy.hpp> using namespace ::com::sun::star; -using ::std::cerr; -using ::std::cout; -using ::std::endl; class ScPivotTableFiltersTest : public ScModelTestBase { @@ -1012,14 +1009,14 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableXLSX) { if (!rDoc.HasPivotTable()) { - cerr << "The document should have pivot table." << endl; + std::cerr << "The document should have pivot table." << std::endl; return false; } const ScDPCollection* pDPs = rDoc.GetDPCollection(); if (!pDPs) { - cerr << "Pivot table container should exist." << endl; + std::cerr << "Pivot table container should exist." << std::endl; return false; } @@ -1027,7 +1024,8 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableXLSX) const ScDPCache* pCache = pDPs->GetSheetCaches().getExistingCache(aSrcRange); if (!pCache) { - cerr << "The document should have a pivot cache for A1:J3 on Sheet1." << endl; + std::cerr << "The document should have a pivot cache for A1:J3 on Sheet1." + << std::endl; return false; } @@ -1038,7 +1036,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableXLSX) size_t nCount = pCache->GetFieldCount(); if (nCount != SAL_N_ELEMENTS(pNames)) { - cout << "Incorrect number of fields in pivot cache." << endl; + std::cout << "Incorrect number of fields in pivot cache." << std::endl; return false; } @@ -1047,8 +1045,8 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableXLSX) OUString aCacheName = pCache->GetDimensionName(i); if (aCacheName != OUString::createFromAscii(pNames[i])) { - cerr << "Field " << i << " has label '" << aCacheName << "' but expected '" - << pNames[i] << "'" << endl; + std::cerr << "Field " << i << " has label '" << aCacheName << "' but expected '" + << pNames[i] << "'" << std::endl; return false; } } @@ -1056,7 +1054,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableXLSX) const ScDPObject* pDPObj = rDoc.GetDPAtCursor(0, 10, 0); // A11 if (!pDPObj) { - cerr << "A pivot table should exist over A11." << endl; + std::cerr << "A pivot table should exist over A11." << std::endl; return false; } @@ -1064,7 +1062,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableXLSX) ScRange aOutRange = pDPObj->GetOutRange(); if (ScRange(0, 7, 0, 3, 14, 0) != aOutRange) { - cerr << "Incorrect output range." << endl; + std::cerr << "Incorrect output range." << std::endl; return false; } @@ -1076,7 +1074,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableXLSX) const ScDPSaveData* pSaveData = pDPObj->GetSaveData(); if (!pSaveData) { - cerr << "Save data should exist in each pivot table object." << endl; + std::cerr << "Save data should exist in each pivot table object." << std::endl; return false; } @@ -1084,7 +1082,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableXLSX) pSaveData->GetAllDimensionsByOrientation(sheet::DataPilotFieldOrientation_ROW, aDims); if (aDims.size() != 1 || aDims[0]->GetName() != "F1") { - cerr << "Pivot table should have one row field labelled 'F1'" << endl; + std::cerr << "Pivot table should have one row field labelled 'F1'" << std::endl; return false; } @@ -1092,30 +1090,31 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableXLSX) aDims); if (aDims.size() != 1 || aDims[0]->GetName() != "F4") { - cerr << "Pivot table should have one column field labelled 'F4'" << endl; + std::cerr << "Pivot table should have one column field labelled 'F4'" << std::endl; return false; } pSaveData->GetAllDimensionsByOrientation(sheet::DataPilotFieldOrientation_PAGE, aDims); if (aDims.size() != 2 || aDims[0]->GetName() != "F7" || aDims[1]->GetName() != "F6") { - cerr << "Pivot table should have two page fields labelled 'F7' and 'F6' in this " - "order." - << endl; + std::cerr + << "Pivot table should have two page fields labelled 'F7' and 'F6' in this " + "order." + << std::endl; return false; } pSaveData->GetAllDimensionsByOrientation(sheet::DataPilotFieldOrientation_DATA, aDims); if (aDims.size() != 1 || aDims[0]->GetName() != "F10") { - cerr << "Pivot table should have one data field labelled 'F10'" << endl; + std::cerr << "Pivot table should have one data field labelled 'F10'" << std::endl; return false; } const ScDPSaveDimension* pDim = aDims[0]; if (pDim->GetFunction() != ScGeneralFunction::SUM) { - cerr << "Data field should have SUM function." << endl; + std::cerr << "Data field should have SUM function." << std::endl; return false; } @@ -1147,14 +1146,14 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableTwoDataFieldsXLSX) { if (!rDoc.HasPivotTable()) { - cerr << "The document should have pivot table." << endl; + std::cerr << "The document should have pivot table." << std::endl; return false; } const ScDPCollection* pDPs = rDoc.GetDPCollection(); if (!pDPs) { - cerr << "Pivot table container should exist." << endl; + std::cerr << "Pivot table container should exist." << std::endl; return false; } @@ -1162,7 +1161,8 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableTwoDataFieldsXLSX) const ScDPCache* pCache = pDPs->GetSheetCaches().getExistingCache(aSrcRange); if (!pCache) { - cerr << "The document should have a pivot cache for B2:C9 on 'Src'." << endl; + std::cerr << "The document should have a pivot cache for B2:C9 on 'Src'." + << std::endl; return false; } @@ -1172,14 +1172,14 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableTwoDataFieldsXLSX) size_t nCount = pCache->GetFieldCount(); if (nCount != SAL_N_ELEMENTS(pNames)) { - cout << "Incorrect number of fields in pivot cache." << endl; + std::cout << "Incorrect number of fields in pivot cache." << std::endl; return false; } const ScDPObject* pDPObj = rDoc.GetDPAtCursor(0, 2, 0); // A3 if (!pDPObj) { - cerr << "A pivot table should exist over A3." << endl; + std::cerr << "A pivot table should exist over A3." << std::endl; return false; } @@ -1187,14 +1187,14 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableTwoDataFieldsXLSX) ScRange aOutRange = pDPObj->GetOutRange(); if (ScRange(0, 2, 0, 2, 11, 0) != aOutRange) { - cerr << "Incorrect output range." << endl; + std::cerr << "Incorrect output range." << std::endl; return false; } const ScDPSaveData* pSaveData = pDPObj->GetSaveData(); if (!pSaveData) { - cerr << "Save data should exist in each pivot table object." << endl; + std::cerr << "Save data should exist in each pivot table object." << std::endl; return false; } @@ -1202,7 +1202,7 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableTwoDataFieldsXLSX) pSaveData->GetAllDimensionsByOrientation(sheet::DataPilotFieldOrientation_ROW, aDims); if (aDims.size() != 1 || aDims[0]->GetName() != "Name") { - cerr << "Pivot table should have one row field labelled 'Name'" << endl; + std::cerr << "Pivot table should have one row field labelled 'Name'" << std::endl; return false; } @@ -1211,21 +1211,21 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableTwoDataFieldsXLSX) || ScDPUtil::getSourceDimensionName(aDims[0]->GetName()) != "Value" || ScDPUtil::getSourceDimensionName(aDims[1]->GetName()) != "Value") { - cerr << "Pivot table should have two duplicated data fields both of which are " - "named 'Value'." - << endl; + std::cerr << "Pivot table should have two duplicated data fields both of which are " + "named 'Value'." + << std::endl; return false; } if (aDims[0]->GetFunction() != ScGeneralFunction::SUM) { - cerr << "First data field should be SUM." << endl; + std::cerr << "First data field should be SUM." << std::endl; return false; } if (aDims[1]->GetFunction() != ScGeneralFunction::COUNT) { - cerr << "First data field should be COUNT." << endl; + std::cerr << "First data field should be COUNT." << std::endl; return false; } @@ -1233,8 +1233,9 @@ CPPUNIT_TEST_FIXTURE(ScPivotTableFiltersTest, testPivotTableTwoDataFieldsXLSX) aDims); if (aDims.size() != 1 || !aDims[0]->IsDataLayout()) { - cerr << "Pivot table should have one column field which is a data layout field." - << endl; + std::cerr + << "Pivot table should have one column field which is a data layout field." + << std::endl; return false; } diff --git a/sc/qa/unit/subsequent_export_test3.cxx b/sc/qa/unit/subsequent_export_test3.cxx index efc5cd7ea231..a4bcb98758ff 100644 --- a/sc/qa/unit/subsequent_export_test3.cxx +++ b/sc/qa/unit/subsequent_export_test3.cxx @@ -35,8 +35,6 @@ using namespace ::com::sun::star; using namespace ::com::sun::star::uno; -using ::std::cerr; -using ::std::endl; class ScExportTest3 : public ScModelTestBase { @@ -333,14 +331,14 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testTrackChangesSimpleXLSX) ScChangeTrack* pCT = rDoc.GetChangeTrack(); if (!pCT) { - cerr << "Change track instance doesn't exist." << endl; + std::cerr << "Change track instance doesn't exist." << std::endl; return false; } sal_uLong nActionMax = pCT->GetActionMax(); if (nActionMax != 13) { - cerr << "Unexpected highest action ID value." << endl; + std::cerr << "Unexpected highest action ID value." << std::endl; return false; } @@ -350,13 +348,14 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testTrackChangesSimpleXLSX) const ScChangeAction* pAction = pCT->GetAction(nActId); if (!pAction) { - cerr << "No action for action number " << nActId << " found." << endl; + std::cerr << "No action for action number " << nActId << " found." << std::endl; return false; } if (pAction->GetType() != aChecks[i].meType) { - cerr << "Unexpected action type for action number " << nActId << "." << endl; + std::cerr << "Unexpected action type for action number " << nActId << "." + << std::endl; return false; } @@ -367,9 +366,9 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testTrackChangesSimpleXLSX) if (!checkRange(pAction->GetType(), aCheck, rRange)) { - cerr << "Unexpected range for action number " << nActId - << ": expected=" << toString(aCheck) << " actual=" << toString(rRange) - << endl; + std::cerr << "Unexpected range for action number " << nActId + << ": expected=" << toString(aCheck) << " actual=" << toString(rRange) + << std::endl; return false; } @@ -380,8 +379,8 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testTrackChangesSimpleXLSX) const ScChangeActionIns* p = static_cast<const ScChangeActionIns*>(pAction); if (p->IsEndOfList() != aChecks[i].mbRowInsertedAtBottom) { - cerr << "Unexpected end-of-list flag for action number " << nActId - << "." << endl; + std::cerr << "Unexpected end-of-list flag for action number " << nActId + << "." << std::endl; return false; } } @@ -398,21 +397,21 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testTrackChangesSimpleXLSX) ScChangeTrack* pCT = rDoc.GetChangeTrack(); if (!pCT) { - cerr << "Change track instance doesn't exist." << endl; + std::cerr << "Change track instance doesn't exist." << std::endl; return false; } ScChangeAction* pAction = pCT->GetLast(); if (pAction->GetUser() != "Kohei Yoshida") { - cerr << "Wrong user name." << endl; + std::cerr << "Wrong user name." << std::endl; return false; } DateTime aDT = pAction->GetDateTime(); if (aDT.GetYear() != 2014 || aDT.GetMonth() != 7 || aDT.GetDay() != 11) { - cerr << "Wrong time stamp." << endl; + std::cerr << "Wrong time stamp." << std::endl; return false; } @@ -423,22 +422,23 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testTrackChangesSimpleXLSX) pAction = pCT->GetLast(); if (!pAction) { - cerr << "Failed to retrieve last revision." << endl; + std::cerr << "Failed to retrieve last revision." << std::endl; return false; } if (rOwnerName != pAction->GetUser()) { - cerr << "Wrong user name." << endl; + std::cerr << "Wrong user name." << std::endl; return false; } DateTime aDTNew = pAction->GetDateTime(); if (aDTNew <= aDT) { - cerr << "Time stamp of the new revision should be more recent than that of the " - "last revision." - << endl; + std::cerr + << "Time stamp of the new revision should be more recent than that of the " + "last revision." + << std::endl; return false; } @@ -504,7 +504,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testSheetTabColorsXLSX) // green, red, blue, yellow (from left to right). if (aTabNames.size() != 4) { - cerr << "There should be exactly 4 sheets." << endl; + std::cerr << "There should be exactly 4 sheets." << std::endl; return false; } @@ -514,8 +514,8 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testSheetTabColorsXLSX) OUString aExpected = OUString::createFromAscii(pNames[i]); if (aExpected != aTabNames[i]) { - cerr << "incorrect sheet name: expected='" << aExpected << "', actual='" - << aTabNames[i] << "'" << endl; + std::cerr << "incorrect sheet name: expected='" << aExpected << "', actual='" + << aTabNames[i] << "'" << std::endl; return false; } } @@ -531,7 +531,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testSheetTabColorsXLSX) { if (aXclColors[i] != rDoc.GetTabBgColor(i)) { - cerr << "wrong sheet color for sheet " << i << endl; + std::cerr << "wrong sheet color for sheet " << i << std::endl; return false; } } @@ -638,8 +638,8 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testSharedFormulaExportXLS) OUString aExpected = u"Response"_ustr; if (aActual != aExpected) { - cerr << "Wrong content in A2: expected='" << aExpected << "', actual='" << aActual - << "'" << endl; + std::cerr << "Wrong content in A2: expected='" << aExpected << "', actual='" + << aActual << "'" << std::endl; return false; } @@ -647,8 +647,8 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testSharedFormulaExportXLS) aExpected = "Response"; if (aActual != aExpected) { - cerr << "Wrong content in B2: expected='" << aExpected << "', actual='" << aActual - << "'" << endl; + std::cerr << "Wrong content in B2: expected='" << aExpected << "', actual='" + << aActual << "'" << std::endl; return false; } @@ -660,8 +660,8 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testSharedFormulaExportXLS) double fActual = rDoc.GetValue(aPos); if (fExpected != fActual) { - cerr << "Wrong value in A" << (i + 2) << ": expected=" << fExpected - << ", actual=" << fActual << endl; + std::cerr << "Wrong value in A" << (i + 2) << ": expected=" << fExpected + << ", actual=" << fActual << std::endl; return false; } @@ -669,7 +669,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testSharedFormulaExportXLS) ScFormulaCell* pFC = rDoc.GetFormulaCell(aPos); if (!pFC) { - cerr << "B" << (i + 2) << " should be a formula cell." << endl; + std::cerr << "B" << (i + 2) << " should be a formula cell." << std::endl; return false; } @@ -677,16 +677,16 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testSharedFormulaExportXLS) aExpected = "Coefficients!RC[-1]"; if (aFormula != aExpected) { - cerr << "Wrong formula in B" << (i + 2) << ": expected='" << aExpected - << "', actual='" << aFormula << "'" << endl; + std::cerr << "Wrong formula in B" << (i + 2) << ": expected='" << aExpected + << "', actual='" << aFormula << "'" << std::endl; return false; } fActual = rDoc.GetValue(aPos); if (fExpected != fActual) { - cerr << "Wrong value in B" << (i + 2) << ": expected=" << fExpected - << ", actual=" << fActual << endl; + std::cerr << "Wrong value in B" << (i + 2) << ": expected=" << fExpected + << ", actual=" << fActual << std::endl; return false; } } @@ -721,8 +721,8 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testSharedFormulaExportXLSX) SCTAB nTabCount = rDoc.GetTableCount(); if (nTabCount != 2) { - cerr << "Document should have exactly 2 sheets. " << nTabCount << " found." - << endl; + std::cerr << "Document should have exactly 2 sheets. " << nTabCount << " found." + << std::endl; return false; } @@ -732,8 +732,8 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testSharedFormulaExportXLSX) Color aTabBgColor = rDoc.GetTabBgColor(i); if (aTabBgColor != COL_AUTO) { - cerr << "The tab color of Sheet " << (i + 1) << " should not be explicitly set." - << endl; + std::cerr << "The tab color of Sheet " << (i + 1) + << " should not be explicitly set." << std::endl; return false; } } @@ -746,8 +746,8 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testSharedFormulaExportXLSX) double fVal = rDoc.GetValue(aPos); if (fVal != fExpected) { - cerr << "Wrong value in B" << (i + 1) << ": expected=" << fExpected - << ", actual=" << fVal << endl; + std::cerr << "Wrong value in B" << (i + 1) << ": expected=" << fExpected + << ", actual=" << fVal << std::endl; return false; } } @@ -760,8 +760,8 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testSharedFormulaExportXLSX) double fVal = rDoc.GetValue(aPos); if (fVal != fExpected) { - cerr << "Wrong value in C" << (i + 1) << ": expected=" << fExpected - << ", actual=" << fVal << endl; + std::cerr << "Wrong value in C" << (i + 1) << ": expected=" << fExpected + << ", actual=" << fVal << std::endl; return false; } } @@ -774,8 +774,8 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testSharedFormulaExportXLSX) double fVal = rDoc.GetValue(aPos); if (fVal != fExpected) { - cerr << "Wrong value in D" << (i + 1) << ": expected=" << fExpected - << ", actual=" << fVal << endl; + std::cerr << "Wrong value in D" << (i + 1) << ": expected=" << fExpected + << ", actual=" << fVal << std::endl; return false; } } @@ -822,8 +822,8 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testSharedFormulaStringResultExportXLSX) OUString aExpected = OUString::createFromAscii(expected[i]); if (aStr != aExpected) { - cerr << "Wrong value in B" << (i + 2) << ": expected='" << aExpected - << "', actual='" << aStr << "'" << endl; + std::cerr << "Wrong value in B" << (i + 2) << ": expected='" << aExpected + << "', actual='" << aStr << "'" << std::endl; return false; } } @@ -839,8 +839,8 @@ CPPUNIT_TEST_FIXTURE(ScExportTest3, testSharedFormulaStringResultExportXLSX) OUString aExpected = OUString::createFromAscii(expected[i]); if (aStr != aExpected) { - cerr << "Wrong value in C" << (i + 2) << ": expected='" << aExpected - << "', actual='" << aStr << "'" << endl; + std::cerr << "Wrong value in C" << (i + 2) << ": expected='" << aExpected + << "', actual='" << aStr << "'" << std::endl; return false; } } diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index 72a26a250005..4377a3cca636 100644 --- a/sc/qa/unit/ucalc.cxx +++ b/sc/qa/unit/ucalc.cxx @@ -69,8 +69,6 @@ class ScUndoPaste; class ScUndoCut; -using ::std::cerr; -using ::std::endl; namespace { @@ -414,8 +412,8 @@ CPPUNIT_TEST_FIXTURE(Test, testSharedStringPoolUndoDoc) svl::SharedString aSS2 = rCopyDoc.GetSharedString(aPos); if (aSS1.getDataIgnoreCase() != aSS2.getDataIgnoreCase()) { - cerr << "String hash values are not equal at row " << (i+1) - << " for string '" << aSS1.getString() << "'" << endl; + std::cerr << "String hash values are not equal at row " << (i+1) + << " for string '" << aSS1.getString() << "'" << std::endl; return false; } } @@ -1165,27 +1163,27 @@ bool Test::checkHorizontalIterator(ScDocument& rDoc, const std::vector<std::vect { if (i >= nCheckCount) { - cerr << "hit invalid check " << i << " of " << nCheckCount << endl; + std::cerr << "hit invalid check " << i << " of " << nCheckCount << std::endl; CPPUNIT_FAIL("Iterator claims there is more data than there should be."); return false; } if (pChecks[i].nCol != nCol) { - cerr << "Column mismatch " << pChecks[i].nCol << " vs. " << nCol << endl; + std::cerr << "Column mismatch " << pChecks[i].nCol << " vs. " << nCol << std::endl; return false; } if (pChecks[i].nRow != nRow) { - cerr << "Row mismatch " << pChecks[i].nRow << " vs. " << nRow << endl; + std::cerr << "Row mismatch " << pChecks[i].nRow << " vs. " << nRow << std::endl; return false; } if (OUString::createFromAscii(pChecks[i].pVal) != pCell->getString(rDoc)) { - cerr << "String mismatch " << pChecks[i].pVal << " vs. " << - pCell->getString(rDoc) << endl; + std::cerr << "String mismatch " << pChecks[i].pVal << " vs. " << + pCell->getString(rDoc) << std::endl; return false; } } @@ -1549,14 +1547,14 @@ bool broadcasterShifted(const ScDocument& rDoc, const ScAddress& rFrom, const Sc const SvtBroadcaster* pBC = rDoc.GetBroadcaster(rFrom); if (pBC) { - cerr << "Broadcaster shouldn't be here." << endl; + std::cerr << "Broadcaster shouldn't be here." << std::endl; return false; } pBC = rDoc.GetBroadcaster(rTo); if (!pBC) { - cerr << "Broadcaster should be here." << endl; + std::cerr << "Broadcaster should be here." << std::endl; return false; } return true; @@ -1567,21 +1565,21 @@ formula::FormulaToken* getSingleRefToken(ScDocument& rDoc, const ScAddress& rPos ScFormulaCell* pFC = rDoc.GetFormulaCell(rPos); if (!pFC) { - cerr << "Formula cell expected, but not found." << endl; + std::cerr << "Formula cell expected, but not found." << std::endl; return nullptr; } ScTokenArray* pTokens = pFC->GetCode(); if (!pTokens) { - cerr << "Token array is not present." << endl; + std::cerr << "Token array is not present." << std::endl; return nullptr; } formula::FormulaToken* pToken = pTokens->FirstToken(); if (!pToken || pToken->GetType() != formula::svSingleRef) { - cerr << "Not a single reference token." << endl; + std::cerr << "Not a single reference token." << std::endl; return nullptr; } @@ -1597,13 +1595,13 @@ bool checkRelativeRefToken(ScDocument& rDoc, const ScAddress& rPos, SCCOL nRelCo ScSingleRefData& rRef = *pToken->GetSingleRef(); if (!rRef.IsColRel() || rRef.Col() != nRelCol) { - cerr << "Unexpected relative column address." << endl; + std::cerr << "Unexpected relative column address." << std::endl; return false; } if (!rRef.IsRowRel() || rRef.Row() != nRelRow) { - cerr << "Unexpected relative row address." << endl; + std::cerr << "Unexpected relative row address." << std::endl; return false; } @@ -1619,7 +1617,7 @@ bool checkDeletedRefToken(ScDocument& rDoc, const ScAddress& rPos) ScSingleRefData& rRef = *pToken->GetSingleRef(); if (!rRef.IsDeleted()) { - cerr << "Deleted reference is expected, but it's still a valid reference." << endl; + std::cerr << "Deleted reference is expected, but it's still a valid reference." << std::endl; return false; } diff --git a/sc/qa/unit/ucalc_copypaste.cxx b/sc/qa/unit/ucalc_copypaste.cxx index e00135f69034..499abdaf22bb 100644 --- a/sc/qa/unit/ucalc_copypaste.cxx +++ b/sc/qa/unit/ucalc_copypaste.cxx @@ -31,9 +31,6 @@ #include <memory> -using ::std::cerr; -using ::std::endl; - class TestCopyPaste : public ScUcalcTestBase { protected: @@ -9225,15 +9222,16 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSkipEmpty) { if (!mpDoc->GetString(aPos).equalsAscii(p->mpStr)) { - cerr << aPosStr << ": incorrect string value: expected='" << p->mpStr - << "' actual='" << mpDoc->GetString(aPos) << endl; + std::cerr << aPosStr << ": incorrect string value: expected='" << p->mpStr + << "' actual='" << mpDoc->GetString(aPos) << std::endl; return false; } const SvxBrushItem* pBrush = mpDoc->GetAttr(aPos, ATTR_BACKGROUND); if (!pBrush) { - cerr << aPosStr << ": failed to get brush item from the cell." << endl; + std::cerr << aPosStr << ": failed to get brush item from the cell." + << std::endl; return false; } @@ -9241,13 +9239,13 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSkipEmpty) { Color aExpected = p->maColor; Color aActual = pBrush->GetColor(); - cerr << aPosStr << ": incorrect cell background color: expected=(" - << static_cast<int>(aExpected.GetRed()) << "," - << static_cast<int>(aExpected.GetGreen()) << "," - << static_cast<int>(aExpected.GetBlue()) << "), actual=(" - << static_cast<int>(aActual.GetRed()) << "," - << static_cast<int>(aActual.GetGreen()) << "," - << static_cast<int>(aActual.GetBlue()) << ")" << endl; + std::cerr << aPosStr << ": incorrect cell background color: expected=(" + << static_cast<int>(aExpected.GetRed()) << "," + << static_cast<int>(aExpected.GetGreen()) << "," + << static_cast<int>(aExpected.GetBlue()) << "), actual=(" + << static_cast<int>(aActual.GetRed()) << "," + << static_cast<int>(aActual.GetGreen()) << "," + << static_cast<int>(aActual.GetBlue()) << ")" << std::endl; return false; } @@ -9255,11 +9253,12 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSkipEmpty) bool bHasNote = mpDoc->HasNote(aPos); if (bHasNote != p->mbHasNote) { - cerr << aPosStr << ": "; + std::cerr << aPosStr << ": "; if (p->mbHasNote) - cerr << "this cell should have a cell note, but doesn't." << endl; + std::cerr << "this cell should have a cell note, but doesn't." << std::endl; else - cerr << "this cell should NOT have a cell note, but one is found." << endl; + std::cerr << "this cell should NOT have a cell note, but one is found." + << std::endl; return false; } diff --git a/sc/qa/unit/ucalc_formula.cxx b/sc/qa/unit/ucalc_formula.cxx index fc39d635ba67..fc521cd966b3 100644 --- a/sc/qa/unit/ucalc_formula.cxx +++ b/sc/qa/unit/ucalc_formula.cxx @@ -30,8 +30,6 @@ #include <vector> using namespace formula; -using ::std::cerr; -using ::std::endl; namespace { void setExpandRefs(bool bExpand) @@ -246,8 +244,8 @@ bool equals( const formula::VectorRefArray& rArray, size_t nPos, const OUString& bool bEquals = OUString(rArray.mpStringArray[nPos]).equalsIgnoreAsciiCase(rVal); if (!bEquals) { - cerr << "Expected: " << rVal.toAsciiUpperCase() << " (upcased)" << endl; - cerr << "Actual: " << OUString(rArray.mpStringArray[nPos]) << " (upcased)" << endl; + std::cerr << "Expected: " << rVal.toAsciiUpperCase() << " (upcased)" << std::endl; + std::cerr << "Actual: " << OUString(rArray.mpStringArray[nPos]) << " (upcased)" << std::endl; } return bEquals; } @@ -885,7 +883,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaTokenEquality) { std::ostringstream os; os << "These two formulas should be evaluated equal: '" - << aTests[i].mpFormula1 << "' vs '" << aTests[i].mpFormula2 << "'" << endl; + << aTests[i].mpFormula1 << "' vs '" << aTests[i].mpFormula2 << "'" << std::endl; CPPUNIT_FAIL(os.str()); } } @@ -895,7 +893,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaTokenEquality) { std::ostringstream os; os << "These two formulas should be evaluated non-equal: '" - << aTests[i].mpFormula1 << "' vs '" << aTests[i].mpFormula2 << "'" << endl; + << aTests[i].mpFormula1 << "' vs '" << aTests[i].mpFormula2 << "'" << std::endl; CPPUNIT_FAIL(os.str()); } } @@ -4218,7 +4216,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateValidity) if (rList.size() != nCheckSize) { - cerr << "List size is not what is expected." << endl; + std::cerr << "List size is not what is expected." << std::endl; return false; } @@ -4228,8 +4226,8 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateValidity) { if (aExpected[i] != rList[i].GetValue()) { - cerr << "Incorrect value at position " << i - << ": expected=" << aExpected[i] << ", actual=" << rList[i].GetValue() << endl; + std::cerr << "Incorrect value at position " << i + << ": expected=" << aExpected[i] << ", actual=" << rList[i].GetValue() << std::endl; return false; } } @@ -4970,7 +4968,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFuncN) bool bGood = result == checks1[i]; if (!bGood) { - cerr << "row " << (i+1) << ": expected=" << checks1[i] << " actual=" << result << endl; + std::cerr << "row " << (i+1) << ": expected=" << checks1[i] << " actual=" << result << std::endl; CPPUNIT_ASSERT_MESSAGE("Unexpected result for N", false); } } @@ -4983,7 +4981,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFuncN) bool bGood = result == checks2[i]; if (!bGood) { - cerr << "row " << (i+2+1) << ": expected=" << checks2[i] << " actual=" << result << endl; + std::cerr << "row " << (i+2+1) << ": expected=" << checks2[i] << " actual=" << result << std::endl; CPPUNIT_ASSERT_MESSAGE("Unexpected result for N", false); } } @@ -5053,8 +5051,8 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFuncCOUNTIF) bool bGood = result == aChecks[i].fResult; if (!bGood) { - cerr << "row " << (nRow+1) << ": formula" << aChecks[i].pFormula - << " expected=" << aChecks[i].fResult << " actual=" << result << endl; + std::cerr << "row " << (nRow+1) << ": formula" << aChecks[i].pFormula + << " expected=" << aChecks[i].fResult << " actual=" << result << std::endl; CPPUNIT_ASSERT_MESSAGE("Unexpected result for COUNTIF", false); } } diff --git a/sc/qa/unit/ucalc_formula2.cxx b/sc/qa/unit/ucalc_formula2.cxx index 0416e6c25845..5ab27fab9e8e 100644 --- a/sc/qa/unit/ucalc_formula2.cxx +++ b/sc/qa/unit/ucalc_formula2.cxx @@ -31,9 +31,6 @@ #include <vector> using namespace formula; -using ::std::vector; -using ::std::cerr; -using ::std::endl; namespace { @@ -41,12 +38,12 @@ ScRange getCachedRange(const ScExternalRefCache::TableTypeRef& pCacheTab) { ScRange aRange; - vector<SCROW> aRows; + std::vector<SCROW> aRows; pCacheTab->getAllRows(aRows); bool bFirst = true; for (const SCROW nRow : aRows) { - vector<SCCOL> aCols; + std::vector<SCCOL> aCols; pCacheTab->getAllCols(nRow, aCols); for (const SCCOL nCol : aCols) { @@ -643,8 +640,9 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFuncVLOOKUP) bool bGood = aRes.equalsAscii(aChecks[i].pRes); if (!bGood) { - cerr << "row " << (i + 1) << ": lookup value='" << aChecks[i].pLookup << "' expected='" - << aChecks[i].pRes << "' actual='" << aRes << "'" << endl; + std::cerr << "row " << (i + 1) << ": lookup value='" << aChecks[i].pLookup + << "' expected='" << aChecks[i].pRes << "' actual='" << aRes << "'" + << std::endl; CPPUNIT_ASSERT_MESSAGE("Unexpected result for VLOOKUP", false); } } @@ -750,10 +748,11 @@ void TestFormula2::runTestMATCH(ScDocument* pDoc, const char* aData[DataSize], OUString aStr = pDoc->GetString(2, i, 0); if (!aStr.equalsAscii(aChecks[i].pRes)) { - cerr << "row " << (i + 1) << ": expected='" << aChecks[i].pRes << "' actual='" << aStr - << "'" - " criterion='" - << aChecks[i].pVal << "'" << endl; + std::cerr << "row " << (i + 1) << ": expected='" << aChecks[i].pRes << "' actual='" + << aStr + << "'" + " criterion='" + << aChecks[i].pVal << "'" << std::endl; CPPUNIT_ASSERT_MESSAGE("Unexpected result for MATCH", false); } } @@ -787,11 +786,11 @@ void TestFormula2::runTestHorizontalMATCH(ScDocument* pDoc, const char* aData[Da OUString aStr = pDoc->GetString(i, 2, 0); if (!aStr.equalsAscii(aChecks[i].pRes)) { - cerr << "column " << char('A' + i) << ": expected='" << aChecks[i].pRes << "' actual='" - << aStr - << "'" - " criterion='" - << aChecks[i].pVal << "'" << endl; + std::cerr << "column " << char('A' + i) << ": expected='" << aChecks[i].pRes + << "' actual='" << aStr + << "'" + " criterion='" + << aChecks[i].pVal << "'" << std::endl; CPPUNIT_ASSERT_MESSAGE("Unexpected result for horizontal MATCH", false); } } @@ -1608,7 +1607,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testExternalRef) // that the first 3 are what we expect. ScExternalRefManager* pRefMgr = m_pDoc->GetExternalRefManager(); sal_uInt16 nFileId = pRefMgr->getExternalFileId(aExtDocName); - vector<OUString> aTabNames; + std::vector<OUString> aTabNames; pRefMgr->getAllCachedTableNames(nFileId, aTabNames); CPPUNIT_ASSERT_MESSAGE("There should be at least 3 sheets.", aTabNames.size() >= 3); CPPUNIT_ASSERT_EQUAL_MESSAGE("Unexpected sheet name.", aTabNames[0], aExtSh1Name); diff --git a/sc/qa/unit/ucalc_sharedformula.cxx b/sc/qa/unit/ucalc_sharedformula.cxx index 9c6da4e28398..37ea7d8ecb2c 100644 --- a/sc/qa/unit/ucalc_sharedformula.cxx +++ b/sc/qa/unit/ucalc_sharedformula.cxx @@ -26,9 +26,6 @@ #include <memory> #include <string_view> -using ::std::cerr; -using ::std::endl; - class TestSharedFormula : public ScUcalcTestBase { }; @@ -873,7 +870,7 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulasInsertRow) ScFormulaCell* pFC = pDoc->GetFormulaCell(ScAddress(1,0,0)); if (!pFC || pFC->GetSharedTopRow() != 0 || pFC->GetSharedLength() != 2) { - cerr << "B1:B2 should be grouped." << endl; + std::cerr << "B1:B2 should be grouped." << std::endl; return false; } @@ -881,7 +878,7 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulasInsertRow) pFC = pDoc->GetFormulaCell(ScAddress(1,3,0)); if (!pFC || pFC->GetSharedTopRow() != 3 || pFC->GetSharedLength() != 2) { - cerr << "B4:B5 should be grouped." << endl; + std::cerr << "B4:B5 should be grouped." << std::endl; return false; } @@ -899,7 +896,7 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulasInsertRow) // Ensure that B5 is empty. if (pDoc->GetCellType(ScAddress(1,4,0)) != CELLTYPE_NONE) { - cerr << "B5 should be empty." << endl; + std::cerr << "B5 should be empty." << std::endl; return false; } @@ -907,7 +904,7 @@ CPPUNIT_TEST_FIXTURE(TestSharedFormula, testSharedFormulasInsertRow) ScFormulaCell* pFC = pDoc->GetFormulaCell(ScAddress(1,0,0)); if (!pFC || pFC->GetSharedTopRow() != 0 || pFC->GetSharedLength() != 4) { - cerr << "B1:B4 should be grouped." << endl; + std::cerr << "B1:B4 should be grouped." << std::endl; return false; } diff --git a/sc/qa/unit/ucalc_sort.cxx b/sc/qa/unit/ucalc_sort.cxx index 8fa964138501..0c24b4b8063b 100644 --- a/sc/qa/unit/ucalc_sort.cxx +++ b/sc/qa/unit/ucalc_sort.cxx @@ -31,9 +31,6 @@ #include <svx/svdpage.hxx> #include <rtl/math.hxx> -using ::std::cerr; -using ::std::endl; - class TestSort : public ScUcalcTestBase { protected: @@ -546,14 +543,14 @@ CPPUNIT_TEST_FIXTURE(TestSort, testSortWithCellFormats) { if (!pPat) { - cerr << "Pattern is NULL!" << endl; + std::cerr << "Pattern is NULL!" << std::endl; return false; } const SfxPoolItem* pItem = nullptr; if (!pPat->GetItemSet().HasItem(ATTR_FONT_WEIGHT, &pItem)) { - cerr << "Pattern does not have a font weight item, but it should." << endl; + std::cerr << "Pattern does not have a font weight item, but it should." << std::endl; return false; } @@ -561,7 +558,7 @@ CPPUNIT_TEST_FIXTURE(TestSort, testSortWithCellFormats) if (pItem->StaticWhichCast(ATTR_FONT_WEIGHT).GetWeight() != WEIGHT_BOLD) { - cerr << "Font weight should be bold." << endl; + std::cerr << "Font weight should be bold." << std::endl; return false; } @@ -572,14 +569,14 @@ CPPUNIT_TEST_FIXTURE(TestSort, testSortWithCellFormats) { if (!pPat) { - cerr << "Pattern is NULL!" << endl; + std::cerr << "Pattern is NULL!" << std::endl; return false; } const SfxPoolItem* pItem = nullptr; if (!pPat->GetItemSet().HasItem(ATTR_FONT_POSTURE, &pItem)) { - cerr << "Pattern does not have a font posture item, but it should." << endl; + std::cerr << "Pattern does not have a font posture item, but it should." << std::endl; return false; } @@ -587,7 +584,7 @@ CPPUNIT_TEST_FIXTURE(TestSort, testSortWithCellFormats) if (pItem->StaticWhichCast(ATTR_FONT_POSTURE).GetPosture() != ITALIC_NORMAL) { - cerr << "Italic should be applied.." << endl; + std::cerr << "Italic should be applied.." << std::endl; return false; } @@ -598,7 +595,7 @@ CPPUNIT_TEST_FIXTURE(TestSort, testSortWithCellFormats) { if (!pPat) { - cerr << "Pattern is NULL!" << endl; + std::cerr << "Pattern is NULL!" << std::endl; return false; } @@ -608,7 +605,7 @@ CPPUNIT_TEST_FIXTURE(TestSort, testSortWithCellFormats) // Check if the font weight is applied. if (pItem->StaticWhichCast(ATTR_FONT_WEIGHT).GetWeight() == WEIGHT_BOLD) { - cerr << "This cell is bold, but shouldn't." << endl; + std::cerr << "This cell is bold, but shouldn't." << std::endl; return false; } } @@ -618,7 +615,7 @@ CPPUNIT_TEST_FIXTURE(TestSort, testSortWithCellFormats) // Check if the italics is applied. if (pItem->StaticWhichCast(ATTR_FONT_POSTURE).GetPosture() == ITALIC_NORMAL) { - cerr << "This cell is italic, but shouldn't." << endl; + std::cerr << "This cell is italic, but shouldn't." << std::endl; return false; } } diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx index c51f6fa2a67a..dc09a0066669 100644 --- a/sc/source/core/data/column2.cxx +++ b/sc/source/core/data/column2.cxx @@ -1718,12 +1718,12 @@ void ScColumn::CellStorageModified() { if (itCell->position != itAttr->position || itCell->size != itAttr->size) { - cout << "ScColumn::CellStorageModified: Cell array and cell text attribute array are out of sync." << endl; - cout << "-- cell array" << endl; - maCells.dump_blocks(cout); - cout << "-- attribute array" << endl; - maCellTextAttrs.dump_blocks(cout); - cout.flush(); + std::cout << "ScColumn::CellStorageModified: Cell array and cell text attribute array are out of sync." << std::endl; + std::cout << "-- cell array" << std::endl; + maCells.dump_blocks(std::cout); + std::cout << "-- attribute array" << endl; + maCellTextAttrs.dump_blocks(std::cout); + std::cout.flush(); abort(); } @@ -1754,28 +1754,28 @@ struct ColumnStorageDumper switch (rNode.type) { case sc::element_type_numeric: - cout << " * numeric block (pos=" << rNode.position << ", length=" << rNode.size << ")" << endl; + std::cout << " * numeric block (pos=" << rNode.position << ", length=" << rNode.size << ")" << std::endl; break; case sc::element_type_string: - cout << " * string block (pos=" << rNode.position << ", length=" << rNode.size << ")" << endl; + std::cout << " * string block (pos=" << rNode.position << ", length=" << rNode.size << ")" << std::endl; break; case sc::element_type_edittext: - cout << " * edit-text block (pos=" << rNode.position << ", length=" << rNode.size << ")" << endl; + std::cout << " * edit-text block (pos=" << rNode.position << ", length=" << rNode.size << ")" << std::endl; break; case sc::element_type_formula: dumpFormulaBlock(rNode); break; case sc::element_type_empty: - cout << " * empty block (pos=" << rNode.position << ", length=" << rNode.size << ")" << endl; + std::cout << " * empty block (pos=" << rNode.position << ", length=" << rNode.size << ")" << std::endl; break; default: - cout << " * unknown block" << endl; + std::cout << " * unknown block" << std::endl; } } void dumpFormulaBlock(const sc::CellStoreType::value_type& rNode) const { - cout << " * formula block (pos=" << rNode.position << ", length=" << rNode.size << ")" << endl; + std::cout << " * formula block (pos=" << rNode.position << ", length=" << rNode.size << ")" << std::endl; sc::formula_block::const_iterator it = sc::formula_block::begin(*rNode.data); sc::formula_block::const_iterator itEnd = sc::formula_block::end(*rNode.data); @@ -1784,7 +1784,7 @@ struct ColumnStorageDumper const ScFormulaCell* pCell = *it; if (!pCell->IsShared()) { - cout << " * row " << pCell->aPos.Row() << " not shared" << endl; + std::cout << " * row " << pCell->aPos.Row() << " not shared" << std::endl; printFormula(pCell); printResult(pCell); continue; @@ -1792,14 +1792,14 @@ struct ColumnStorageDumper if (pCell->GetSharedTopRow() != pCell->aPos.Row()) { - cout << " * row " << pCell->aPos.Row() << " shared with top row " + std::cout << " * row " << pCell->aPos.Row() << " shared with top row " << pCell->GetSharedTopRow() << " with length " << pCell->GetSharedLength() - << endl; + << std::endl; continue; } SCROW nLen = pCell->GetSharedLength(); - cout << " * group: start=" << pCell->aPos.Row() << ", length=" << nLen << endl; + std::cout << " * group: start=" << pCell->aPos.Row() << ", length=" << nLen << std::endl; printFormula(pCell); printResult(pCell); @@ -1818,14 +1818,14 @@ struct ColumnStorageDumper { sc::TokenStringContext aCxt(mrDoc, mrDoc.GetGrammar()); OUString aFormula = pCell->GetCode()->CreateString(aCxt, pCell->aPos); - cout << " * formula: " << aFormula << endl; + std::cout << " * formula: " << aFormula << std::endl; } #if DUMP_FORMULA_RESULTS void printResult(const ScFormulaCell* pCell) const { sc::FormulaResultValue aRes = pCell->GetResult(); - cout << " * result: "; + std::cout << " * result: "; switch (aRes.meType) { case sc::FormulaResultValue::Value: @@ -1842,7 +1842,7 @@ struct ColumnStorageDumper break; } - cout << endl; + std::cout << std::endl; } #else void printResult(const ScFormulaCell*) const @@ -1856,9 +1856,9 @@ struct ColumnStorageDumper void ScColumn::DumpColumnStorage() const { - cout << "-- table: " << nTab << "; column: " << nCol << endl; + std::cout << "-- table: " << nTab << "; column: " << nCol << std::endl; std::for_each(maCells.begin(), maCells.end(), ColumnStorageDumper(GetDoc())); - cout << "--" << endl; + std::cout << "--" << std::endl; } #endif diff --git a/sc/source/core/data/dociter.cxx b/sc/source/core/data/dociter.cxx index fa72e915010a..fc5635c291c3 100644 --- a/sc/source/core/data/dociter.cxx +++ b/sc/source/core/data/dociter.cxx @@ -52,10 +52,6 @@ #include <limits> #include <vector> -using ::rtl::math::approxEqual; -using ::std::vector; -using ::std::set; - // iterators have very high frequency use -> custom debug. // #define debugiter(...) fprintf(stderr, __VA_ARGS__) #define debugiter(...) @@ -602,7 +598,7 @@ bool isQueryByString(const ScQueryEntry& rEntry, const ScQueryEntry::Item& rItem bool ScDBQueryDataIterator::DataAccessMatrix::isValidQuery(SCROW nRow, const ScMatrix& rMat) const { SCSIZE nEntryCount = mpParam->GetEntryCount(); - vector<bool> aResults; + std::vector<bool> aResults; aResults.reserve(nEntryCount); const CollatorWrapper& rCollator = ScGlobal::GetCollator(mpParam->bCaseSens); @@ -637,7 +633,7 @@ bool ScDBQueryDataIterator::DataAccessMatrix::isValidQuery(SCROW nRow, const ScM { // By value double fMatVal = rMat.GetDouble(nField, nRow); - bool bEqual = approxEqual(fMatVal, rItem.mfVal); + bool bEqual = rtl::math::approxEqual(fMatVal, rItem.mfVal); switch (rEntry.eOp) { case SC_EQUAL: @@ -1620,7 +1616,7 @@ ScDocRowHeightUpdater::TabRanges::TabRanges(SCTAB nTab, SCROW nMaxRow) : { } -ScDocRowHeightUpdater::ScDocRowHeightUpdater(ScDocument& rDoc, OutputDevice* pOutDev, double fPPTX, double fPPTY, const vector<TabRanges>* pTabRangesArray) : +ScDocRowHeightUpdater::ScDocRowHeightUpdater(ScDocument& rDoc, OutputDevice* pOutDev, double fPPTX, double fPPTY, const std::vector<TabRanges>* pTabRangesArray) : mrDoc(rDoc), mpOutDev(pOutDev), mfPPTX(fPPTX), mfPPTY(fPPTY), mpTabRangesArray(pTabRangesArray) { } @@ -1766,7 +1762,7 @@ const ScPatternAttr* ScAttrRectIterator::GetNext( SCCOL& rCol1, SCCOL& rCol2, return nullptr; // Nothing anymore } -ScRowBreakIterator::ScRowBreakIterator(set<SCROW>& rBreaks) : +ScRowBreakIterator::ScRowBreakIterator(std::set<SCROW>& rBreaks) : mrBreaks(rBreaks), maItr(rBreaks.begin()), maEnd(rBreaks.end()) { diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index f76c534dfdd9..e4eb11cc165c 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -109,7 +109,6 @@ using namespace ::com::sun::star; namespace WritingMode2 = ::com::sun::star::text::WritingMode2; using ::com::sun::star::uno::Sequence; using ::com::sun::star::sheet::TablePageBreakData; -using ::std::set; namespace { @@ -4399,13 +4398,13 @@ CRFlags ScDocument::GetRowFlags( SCROW nRow, SCTAB nTab ) const return CRFlags::NONE; } -void ScDocument::GetAllRowBreaks(set<SCROW>& rBreaks, SCTAB nTab, bool bPage, bool bManual) const +void ScDocument::GetAllRowBreaks(std::set<SCROW>& rBreaks, SCTAB nTab, bool bPage, bool bManual) const { if (const ScTable* pTable = FetchTable(nTab)) pTable->GetAllRowBreaks(rBreaks, bPage, bManual); } -void ScDocument::GetAllColBreaks(set<SCCOL>& rBreaks, SCTAB nTab, bool bPage, bool bManual) const +void ScDocument::GetAllColBreaks(std::set<SCCOL>& rBreaks, SCTAB nTab, bool bPage, bool bManual) const { if (const ScTable* pTable = FetchTable(nTab)) pTable->GetAllColBreaks(rBreaks, bPage, bManual); @@ -6410,7 +6409,7 @@ bool lcl_hasDirtyRange(const ScDocument& rDoc, ScFormulaCell* pCell, const ScRan void ScDocument::SetSubTotalCellsDirty(const ScRange& rDirtyRange) { // to update the list by skipping cells that no longer contain subtotal function. - set<ScFormulaCell*> aNewSet; + std::set<ScFormulaCell*> aNewSet; bool bOldRecalc = GetAutoCalc(); SetAutoCalc(false); diff --git a/sc/source/core/data/dpcache.cxx b/sc/source/core/data/dpcache.cxx index e364d27cb8d0..098bcafa8dc5 100644 --- a/sc/source/core/data/dpcache.cxx +++ b/sc/source/core/data/dpcache.cxx @@ -178,14 +178,12 @@ struct Bucket #if DEBUG_PIVOT_TABLE #include <iostream> -using std::cout; -using std::endl; struct PrintBucket { void operator() (const Bucket& v) const { - cout << "value: " << v.maValue.GetValue() << " order index: " << v.mnOrderIndex << " data index: " << v.mnDataIndex << endl; + std::cout << "value: " << v.maValue.GetValue() << " order index: " << v.mnOrderIndex << " data index: " << v.mnDataIndex << std::endl; } }; @@ -1405,13 +1403,13 @@ namespace { void dumpItems(const ScDPCache& rCache, tools::Long nDim, const ScDPCache::ScDPItemDataVec& rItems, size_t nOffset) { for (size_t i = 0; i < rItems.size(); ++i) - cout << " " << (i+nOffset) << ": " << rCache.GetFormattedString(nDim, rItems[i], false) << endl; + std::cout << " " << (i+nOffset) << ": " << rCache.GetFormattedString(nDim, rItems[i], false) << std::endl; } void dumpSourceData(const ScDPCache& rCache, tools::Long nDim, const ScDPCache::ScDPItemDataVec& rItems, const ScDPCache::IndexArrayType& rArray) { for (const auto& rIndex : rArray) - cout << " '" << rCache.GetFormattedString(nDim, rItems[rIndex], false) << "'" << endl; + std::cout << " '" << rCache.GetFormattedString(nDim, rItems[rIndex], false) << "'" << std::endl; } const char* getGroupTypeName(sal_Int32 nType) @@ -1444,27 +1442,27 @@ void ScDPCache::Dump() const bool bDumpItems = false; bool bDumpSourceData = false; - cout << "--- pivot cache dump" << endl; + std::cout << "--- pivot cache dump" << std::endl; { size_t i = 0; for (const auto& rxField : maFields) { const Field& fld = *rxField; - cout << "* source dimension: " << GetDimensionName(i) << " (ID = " << i << ")" << endl; - cout << " item count: " << fld.maItems.size() << endl; + std::cout << "* source dimension: " << GetDimensionName(i) << " (ID = " << i << ")" << std::endl; + std::cout << " item count: " << fld.maItems.size() << std::endl; if (bDumpItems) dumpItems(*this, i, fld.maItems, 0); if (fld.mpGroup) { - cout << " group item count: " << fld.mpGroup->maItems.size() << endl; - cout << " group type: " << getGroupTypeName(fld.mpGroup->mnGroupType) << endl; + std::cout << " group item count: " << fld.mpGroup->maItems.size() << std::endl; + std::cout << " group type: " << getGroupTypeName(fld.mpGroup->mnGroupType) << std::endl; if (bDumpItems) dumpItems(*this, i, fld.mpGroup->maItems, fld.maItems.size()); } if (bDumpSourceData) { - cout << " source data (re-constructed):" << endl; + std::cout << " source data (re-constructed):" << std::endl; dumpSourceData(*this, i, fld.maItems, fld.maData); } @@ -1477,9 +1475,9 @@ void ScDPCache::Dump() const for (const auto& rxGroupField : maGroupFields) { const GroupItems& gi = *rxGroupField; - cout << "* group dimension: (unnamed) (ID = " << i << ")" << endl; - cout << " item count: " << gi.maItems.size() << endl; - cout << " group type: " << getGroupTypeName(gi.mnGroupType) << endl; + std::cout << "* group dimension: (unnamed) (ID = " << i << ")" << std::endl; + std::cout << " item count: " << gi.maItems.size() << std::endl; + std::cout << " group type: " << getGroupTypeName(gi.mnGroupType) << std::endl; if (bDumpItems) dumpItems(*this, i, gi.maItems, 0); ++i; @@ -1488,7 +1486,7 @@ void ScDPCache::Dump() const { struct { SCROW start; SCROW end; bool empty; } aRange; - cout << "* empty rows: " << endl; + std::cout << "* empty rows: " << std::endl; mdds::flat_segment_tree<SCROW, bool>::const_iterator it = maEmptyRows.begin(), itEnd = maEmptyRows.end(); if (it != itEnd) { @@ -1498,14 +1496,14 @@ void ScDPCache::Dump() const for (++it; it != itEnd; ++it) { aRange.end = it->first-1; - cout << " rows " << aRange.start << "-" << aRange.end << ": " << (aRange.empty ? "empty" : "not-empty") << endl; + std::cout << " rows " << aRange.start << "-" << aRange.end << ": " << (aRange.empty ? "empty" : "not-empty") << std::endl; aRange.start = it->first; aRange.empty = it->second; } } } - cout << "---" << endl; + std::cout << "---" << std::endl; } #endif diff --git a/sc/source/core/data/dpfilteredcache.cxx b/sc/source/core/data/dpfilteredcache.cxx index d1c6b38b06d2..c93c45a44937 100644 --- a/sc/source/core/data/dpfilteredcache.cxx +++ b/sc/source/core/data/dpfilteredcache.cxx @@ -27,7 +27,6 @@ #include <osl/diagnose.h> #include <algorithm> -using ::std::vector; using ::com::sun::star::uno::Sequence; using ::com::sun::star::uno::Any; @@ -229,7 +228,7 @@ bool ScDPFilteredCache::isRowActive(sal_Int32 nRow, sal_Int32* pLastRow) const return bFilter && bPage; } -void ScDPFilteredCache::filterByPageDimension(const vector<Criterion>& rCriteria, const std::unordered_set<sal_Int32>& rRepeatIfEmptyDims) +void ScDPFilteredCache::filterByPageDimension(const std::vector<Criterion>& rCriteria, const std::unordered_set<sal_Int32>& rRepeatIfEmptyDims) { SCROW nRowSize = getRowSize(); SCROW nDataSize = mrCache.GetDataSize(); @@ -276,18 +275,18 @@ const OUString & ScDPFilteredCache::getFieldName(SCCOL nIndex) const return mrCache.GetDimensionName(nIndex); } -const ::std::vector<SCROW>& ScDPFilteredCache::getFieldEntries( sal_Int32 nColumn ) const +const std::vector<SCROW>& ScDPFilteredCache::getFieldEntries( sal_Int32 nColumn ) const { if (nColumn < 0 || o3tl::make_unsigned(nColumn) >= maFieldEntries.size()) { // index out of bound. Hopefully this code will never be reached. - static const ::std::vector<SCROW> emptyEntries{}; + static const std::vector<SCROW> emptyEntries{}; return emptyEntries; } return maFieldEntries[nColumn]; } -void ScDPFilteredCache::filterTable(const vector<Criterion>& rCriteria, Sequence< Sequence<Any> >& rTabData, +void ScDPFilteredCache::filterTable(const std::vector<Criterion>& rCriteria, Sequence< Sequence<Any> >& rTabData, const std::unordered_set<sal_Int32>& rRepeatIfEmptyDims) { sal_Int32 nRowSize = getRowSize(); @@ -298,7 +297,7 @@ void ScDPFilteredCache::filterTable(const vector<Criterion>& rCriteria, Sequence return; // Row first, then column. - vector< Sequence<Any> > tableData; + std::vector< Sequence<Any> > tableData; tableData.reserve(nRowSize+1); // Header first. @@ -365,7 +364,7 @@ bool ScDPFilteredCache::empty() const return maFieldEntries.empty(); } -bool ScDPFilteredCache::isRowQualified(sal_Int32 nRow, const vector<Criterion>& rCriteria, +bool ScDPFilteredCache::isRowQualified(sal_Int32 nRow, const std::vector<Criterion>& rCriteria, const std::unordered_set<sal_Int32>& rRepeatIfEmptyDims) const { sal_Int32 nColSize = getColSize(); @@ -395,7 +394,7 @@ void ScDPFilteredCache::dumpRowFlag( const RowFlagType& rFlag ) for (++it; it != itEnd; ++it) { SCROW nRow2 = it->first; - cout << " * range " << nRow1 << "-" << nRow2 << ": " << (bShow ? "on" : "off") << endl; + std::cout << " * range " << nRow1 << "-" << nRow2 << ": " << (bShow ? "on" : "off") << std::endl; bShow = it->second; nRow1 = nRow2; } @@ -403,27 +402,27 @@ void ScDPFilteredCache::dumpRowFlag( const RowFlagType& rFlag ) void ScDPFilteredCache::dump() const { - cout << "--- pivot filtered cache dump" << endl; + std::cout << "--- pivot filtered cache dump" << std::endl; - cout << endl; - cout << "* show by filter" << endl; + std::cout << std::endl; + std::cout << "* show by filter" << std::endl; dumpRowFlag(maShowByFilter); - cout << endl; - cout << "* show by page dimensions" << endl; + std::cout << std::endl; + std::cout << "* show by page dimensions" << std::endl; dumpRowFlag(maShowByPage); - cout << endl; - cout << "* field entries" << endl; + std::cout << std::endl; + std::cout << "* field entries" << std::endl; size_t nFieldCount = maFieldEntries.size(); for (size_t i = 0; i < nFieldCount; ++i) { - const vector<SCROW>& rField = maFieldEntries[i]; - cout << " * field " << i << endl; + const std::vector<SCROW>& rField = maFieldEntries[i]; + std::cout << " * field " << i << std::endl; for (size_t j = 0, n = rField.size(); j < n; ++j) - cout << " ID: " << rField[j] << endl; + std::cout << " ID: " << rField[j] << std::endl; } - cout << "---" << endl; + std::cout << "---" << std::endl; } #endif diff --git a/sc/source/core/data/dpgroup.cxx b/sc/source/core/data/dpgroup.cxx index 97f38e5a7d8e..4476ddfa966e 100644 --- a/sc/source/core/data/dpgroup.cxx +++ b/sc/source/core/data/dpgroup.cxx @@ -40,9 +40,6 @@ using namespace ::com::sun::star; using ::com::sun::star::uno::Any; using ::com::sun::star::uno::Sequence; -using ::std::vector; -using ::std::shared_ptr; - const sal_uInt16 SC_DP_LEAPYEAR = 1648; // arbitrary leap year for date calculations namespace { @@ -462,7 +459,7 @@ const std::vector<SCROW>& ScDPNumGroupDimension::GetNumEntries( return maMemberEntries; } -ScDPGroupTableData::ScDPGroupTableData( const shared_ptr<ScDPTableData>& pSource, ScDocument* pDocument ) : +ScDPGroupTableData::ScDPGroupTableData( const std::shared_ptr<ScDPTableData>& pSource, ScDocument* pDocument ) : ScDPTableData(pDocument), pSourceData( pSource ), pDoc( pDocument ) @@ -638,7 +635,7 @@ public: } -void ScDPGroupTableData::ModifyFilterCriteria(vector<ScDPFilteredCache::Criterion>& rCriteria) +void ScDPGroupTableData::ModifyFilterCriteria(std::vector<ScDPFilteredCache::Criterion>& rCriteria) { // Build dimension ID to object map for group dimensions. typedef std::unordered_map<tools::Long, const ScDPGroupDimension*> GroupFieldMapType; @@ -649,7 +646,7 @@ void ScDPGroupTableData::ModifyFilterCriteria(vector<ScDPFilteredCache::Criterio aGroupFieldIds.emplace(rGroup.GetGroupDim(), &rGroup); } - vector<ScDPFilteredCache::Criterion> aNewCriteria; + std::vector<ScDPFilteredCache::Criterion> aNewCriteria; aNewCriteria.reserve(rCriteria.size() + aGroups.size()); // Go through all the filtered field names and process them appropriately. @@ -801,7 +798,7 @@ void ScDPGroupTableData::ReloadCacheTable() pSourceData->ReloadCacheTable(); } -void ScDPGroupTableData::FillGroupValues(vector<SCROW>& rItems, const vector<sal_Int32>& rDims) +void ScDPGroupTableData::FillGroupValues(std::vector<SCROW>& rItems, const std::vector<sal_Int32>& rDims) { sal_Int32 nGroupedColumns = aGroups.size(); @@ -1017,14 +1014,14 @@ sal_Int32 ScDPGroupTableData::Compare(sal_Int32 nDim, sal_Int32 nDataId1, sal_In void ScDPGroupTableData::Dump() const { - cout << "--- ScDPGroupTableData" << endl; + std::cout << "--- ScDPGroupTableData" << std::endl; for (tools::Long i = 0; i < nSourceCount; ++i) { - cout << "* dimension: " << i << endl; + std::cout << "* dimension: " << i << std::endl; const ScDPNumGroupDimension& rGrp = pNumGroups[i]; rGrp.GetInfo().Dump(); } - cout << "---" << endl; + std::cout << "---" << std::endl; } #endif diff --git a/sc/source/core/data/dpnumgroupinfo.cxx b/sc/source/core/data/dpnumgroupinfo.cxx index f57822e163bf..a1d01ff099b1 100644 --- a/sc/source/core/data/dpnumgroupinfo.cxx +++ b/sc/source/core/data/dpnumgroupinfo.cxx @@ -21,14 +21,14 @@ ScDPNumGroupInfo::ScDPNumGroupInfo() : void ScDPNumGroupInfo::Dump() const { - cout << "--- ScDPNumGroupInfo" << endl; - cout << " enabled: " << mbEnable << endl; - cout << " auto start: " << mbAutoStart << endl; - cout << " auto end: " << mbAutoEnd << endl; - cout << " start: " << mfStart << endl; - cout << " end: " << mfEnd << endl; - cout << " step: " << mfStep << endl; - cout << "---" << endl; + std::cout << "--- ScDPNumGroupInfo" << std::endl; + std::cout << " enabled: " << mbEnable << std::endl; + std::cout << " auto start: " << mbAutoStart << std::endl; + std::cout << " auto end: " << mbAutoEnd << std::endl; + std::cout << " start: " << mfStart << std::endl; + std::cout << " end: " << mfEnd << std::endl; + std::cout << " step: " << mfStep << std::endl; + std::cout << "---" << std::endl; } #endif diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx index 9727deaaf831..3c1cfaa7250a 100644 --- a/sc/source/core/data/dpobject.cxx +++ b/sc/source/core/data/dpobject.cxx @@ -82,8 +82,6 @@ #include <algorithm> using namespace com::sun::star; -using ::std::vector; -using ::std::shared_ptr; using ::com::sun::star::uno::Sequence; using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::UNO_QUERY; @@ -688,7 +686,7 @@ ScDPTableData* ScDPObject::GetTableData() { if (!mpTableData) { - shared_ptr<ScDPTableData> pData; + std::shared_ptr<ScDPTableData> pData; const ScDPDimensionSaveData* pDimData = mpSaveData ? mpSaveData->GetExistingDimensionData() : nullptr; if (mpImportDescription) @@ -847,7 +845,7 @@ void ScDPObject::ReloadGroupTableData() { // This is already a group table data. Salvage the source data and // re-create a new group data. - const shared_ptr<ScDPTableData>& pSource = pData->GetSourceTableData(); + const std::shared_ptr<ScDPTableData>& pSource = pData->GetSourceTableData(); auto pGroupData = std::make_shared<ScDPGroupTableData>(pSource, mpDocument); pDimData->WriteToData(*pGroupData); mpTableData = pGroupData; @@ -1005,7 +1003,7 @@ bool ScDPObject::SyncAllDimensionMembers() bool ScDPObject::GetMemberNames( sal_Int32 nDim, Sequence<OUString>& rNames ) { - vector<ScDPLabelData::Member> aMembers; + std::vector<ScDPLabelData::Member> aMembers; if (!GetMembers(nDim, GetUsedHierarchy(nDim), aMembers)) return false; @@ -1018,7 +1016,7 @@ bool ScDPObject::GetMemberNames( sal_Int32 nDim, Sequence<OUString>& rNames ) return true; } -bool ScDPObject::GetMembers( sal_Int32 nDim, sal_Int32 nHier, vector<ScDPLabelData::Member>& rMembers ) +bool ScDPObject::GetMembers( sal_Int32 nDim, sal_Int32 nHier, std::vector<ScDPLabelData::Member>& rMembers ) { Reference< sheet::XMembersAccess > xMembersNA; if (!GetMembersNA( nDim, nHier, xMembersNA )) @@ -1026,7 +1024,7 @@ bool ScDPObject::GetMembers( sal_Int32 nDim, sal_Int32 nHier, vector<ScDPLabelDa Reference<container::XIndexAccess> xMembersIA( new ScNameToIndexAccess(xMembersNA) ); sal_Int32 nCount = xMembersIA->getCount(); - vector<ScDPLabelData::Member> aMembers; + std::vector<ScDPLabelData::Member> aMembers; aMembers.reserve(nCount); for (sal_Int32 i = 0; i < nCount; ++i) @@ -1161,7 +1159,7 @@ bool ScDPObject::GetDataFieldPositionData( { CreateOutput(); - vector<sheet::DataPilotFieldFilter> aFilters; + std::vector<sheet::DataPilotFieldFilter> aFilters; if (!mpOutput->GetDataResultPositionData(aFilters, rPos)) return false; @@ -2183,7 +2181,7 @@ static void lcl_FillOldFields( ScPivotFieldVector& rFields, //TODO: merge multiple occurrences (data field with different functions) //TODO: force data field in one dimension - vector<tools::Long> aPos; + std::vector<tools::Long> aPos; uno::Reference<container::XNameAccess> xDimsName = xSource->getDimensions(); uno::Reference<container::XIndexAccess> xDims = new ScNameToIndexAccess( xDimsName ); @@ -2629,7 +2627,7 @@ OUString lcl_GetDimName( const uno::Reference<sheet::XDimensionsSupplier>& xSour return aName; } -bool hasFieldColumn(const vector<ScPivotField>* pRefFields, SCCOL nCol) +bool hasFieldColumn(const std::vector<ScPivotField>* pRefFields, SCCOL nCol) { if (!pRefFields) return false; diff --git a/sc/source/core/data/dpoutput.cxx b/sc/source/core/data/dpoutput.cxx index 1c6a0c102438..4cdf3d6f834f 100644 --- a/sc/source/core/data/dpoutput.cxx +++ b/sc/source/core/data/dpoutput.cxx @@ -71,7 +71,6 @@ #include <iostream> using namespace com::sun::star; -using ::std::vector; using ::com::sun::star::beans::XPropertySet; using ::com::sun::star::uno::Sequence; using ::com::sun::star::uno::UNO_QUERY; @@ -100,11 +99,11 @@ class ScDPOutputImpl { ScDocument* mpDoc; sal_uInt16 mnTab; - ::std::vector< bool > mbNeedLineCols; - ::std::vector< SCCOL > mnCols; + std::vector< bool > mbNeedLineCols; + std::vector< SCCOL > mnCols; - ::std::vector< bool > mbNeedLineRows; - ::std::vector< SCROW > mnRows; + std::vector< bool > mbNeedLineRows; + std::vector< SCROW > mnRows; SCCOL mnTabStartCol; SCROW mnTabStartRow; @@ -1508,7 +1507,7 @@ void ScDPOutput::GetPositionData(const ScAddress& rPos, DataPilotTablePositionDa { case DataPilotTablePositionType::RESULT: { - vector<DataPilotFieldFilter> aFilters; + std::vector<DataPilotFieldFilter> aFilters; GetDataResultPositionData(aFilters, rPos); DataPilotTableResultData aResData; @@ -1596,7 +1595,7 @@ void ScDPOutput::GetPositionData(const ScAddress& rPos, DataPilotTablePositionDa } } -bool ScDPOutput::GetDataResultPositionData(vector<sheet::DataPilotFieldFilter>& rFilters, const ScAddress& rPos) +bool ScDPOutput::GetDataResultPositionData(std::vector<sheet::DataPilotFieldFilter>& rFilters, const ScAddress& rPos) { // Check to make sure there is at least one data field. Reference<beans::XPropertySet> xPropSet(mxSource, UNO_QUERY); diff --git a/sc/source/core/data/dpoutputgeometry.cxx b/sc/source/core/data/dpoutputgeometry.cxx index 0c5307258c9b..d9dd87217341 100644 --- a/sc/source/core/data/dpoutputgeometry.cxx +++ b/sc/source/core/data/dpoutputgeometry.cxx @@ -22,8 +22,6 @@ #include <vector> -using ::std::vector; - ScDPOutputGeometry::ScDPOutputGeometry(const ScRange& rOutRange, bool bShowFilter) : maOutRange(rOutRange), mnRowFields(0), @@ -72,12 +70,12 @@ void ScDPOutputGeometry::setCompactMode(bool bCompactMode) mbCompactMode = bCompactMode; } -void ScDPOutputGeometry::getColumnFieldPositions(vector<ScAddress>& rAddrs) const +void ScDPOutputGeometry::getColumnFieldPositions(std::vector<ScAddress>& rAddrs) const { sal_uInt32 nColumnFields, nRowFields; adjustFieldsForDataLayout(nColumnFields, nRowFields); - vector<ScAddress> aAddrs; + std::vector<ScAddress> aAddrs; if (!nColumnFields) { rAddrs.swap(aAddrs); @@ -107,12 +105,12 @@ void ScDPOutputGeometry::getColumnFieldPositions(vector<ScAddress>& rAddrs) cons rAddrs.swap(aAddrs); } -void ScDPOutputGeometry::getRowFieldPositions(vector<ScAddress>& rAddrs) const +void ScDPOutputGeometry::getRowFieldPositions(std::vector<ScAddress>& rAddrs) const { sal_uInt32 nColumnFields, nRowFields; adjustFieldsForDataLayout(nColumnFields, nRowFields); - vector<ScAddress> aAddrs; + std::vector<ScAddress> aAddrs; if (!nRowFields) { rAddrs.swap(aAddrs); @@ -132,9 +130,9 @@ void ScDPOutputGeometry::getRowFieldPositions(vector<ScAddress>& rAddrs) const rAddrs.swap(aAddrs); } -void ScDPOutputGeometry::getPageFieldPositions(vector<ScAddress>& rAddrs) const +void ScDPOutputGeometry::getPageFieldPositions(std::vector<ScAddress>& rAddrs) const { - vector<ScAddress> aAddrs; + std::vector<ScAddress> aAddrs; if (!mnPageFields) { rAddrs.swap(aAddrs); diff --git a/sc/source/core/data/dpsave.cxx b/sc/source/core/data/dpsave.cxx index 79cdc86e5af7..fce29e78358a 100644 --- a/sc/source/core/data/dpsave.cxx +++ b/sc/source/core/data/dpsave.cxx @@ -52,7 +52,6 @@ using namespace com::sun::star; using namespace com::sun::star::sheet; -using ::std::unique_ptr; #define SC_DPSAVEMODE_DONTKNOW 2 @@ -162,21 +161,21 @@ void ScDPSaveMember::WriteToSource( const uno::Reference<uno::XInterface>& xMemb void ScDPSaveMember::Dump(int nIndent) const { std::string aIndent(nIndent*4, ' '); - cout << aIndent << "* member name: '" << aName << "'" << endl; + std::cout << aIndent << "* member name: '" << aName << "'" << std::endl; - cout << aIndent << " + layout name: "; + std::cout << aIndent << " + layout name: "; if (mpLayoutName) - cout << "'" << *mpLayoutName << "'"; + std::cout << "'" << *mpLayoutName << "'"; else - cout << "(none)"; - cout << endl; + std::cout << "(none)"; + std::cout << std::endl; - cout << aIndent << " + visibility: "; + std::cout << aIndent << " + visibility: "; if (nVisibleMode == SC_DPSAVEMODE_DONTKNOW) - cout << "(unknown)"; + std::cout << "(unknown)"; else - cout << (nVisibleMode ? "visible" : "hidden"); - cout << endl; + std::cout << (nVisibleMode ? "visible" : "hidden"); + std::cout << std::endl; } #endif @@ -652,38 +651,38 @@ void ScDPSaveDimension::Dump(int nIndent) const static const char* const pOrientNames[] = { "hidden", "column", "row", "page", "data" }; std::string aIndent(nIndent*4, ' '); - cout << aIndent << "* dimension name: '" << aName << "'" << endl; + std::cout << aIndent << "* dimension name: '" << aName << "'" << std::endl; - cout << aIndent << " + orientation: "; + std::cout << aIndent << " + orientation: "; if (nOrientation <= DataPilotFieldOrientation_DATA) - cout << pOrientNames[static_cast<int>(nOrientation)]; + std::cout << pOrientNames[static_cast<int>(nOrientation)]; else - cout << "(invalid)"; - cout << endl; + std::cout << "(invalid)"; + std::cout << std::endl; - cout << aIndent << " + layout name: "; + std::cout << aIndent << " + layout name: "; if (mpLayoutName) - cout << "'" << *mpLayoutName << "'"; + std::cout << "'" << *mpLayoutName << "'"; else - cout << "(none)"; - cout << endl; + std::cout << "(none)"; + std::cout << std::endl; - cout << aIndent << " + subtotal name: "; + std::cout << aIndent << " + subtotal name: "; if (mpSubtotalName) - cout << "'" << *mpSubtotalName << "'"; + std::cout << "'" << *mpSubtotalName << "'"; else - cout << "(none)"; - cout << endl; + std::cout << "(none)"; + std::cout << std::endl; - cout << aIndent << " + is data layout: " << (bIsDataLayout ? "yes" : "no") << endl; - cout << aIndent << " + is duplicate: " << (bDupFlag ? "yes" : "no") << endl; + std::cout << aIndent << " + is data layout: " << (bIsDataLayout ? "yes" : "no") << std::endl; + std::cout << aIndent << " + is duplicate: " << (bDupFlag ? "yes" : "no") << std::endl; for (ScDPSaveMember* pMem : maMemberList) { pMem->Dump(nIndent+1); } - cout << endl; // blank line + std::cout << std::endl; // blank line } #endif @@ -1265,7 +1264,7 @@ void ScDPSaveData::BuildAllDimensionMembers(ScDPTableData* pData) // this member instance already exists. nothing to do. continue; - unique_ptr<ScDPSaveMember> pNewMember(new ScDPSaveMember(aMemName)); + std::unique_ptr<ScDPSaveMember> pNewMember(new ScDPSaveMember(aMemName)); pNewMember->SetIsVisible(true); iter->AddMember(std::move(pNewMember)); } diff --git a/sc/source/core/data/dpsdbtab.cxx b/sc/source/core/data/dpsdbtab.cxx index b56217c27f43..a212d26c976f 100644 --- a/sc/source/core/data/dpsdbtab.cxx +++ b/sc/source/core/data/dpsdbtab.cxx @@ -28,7 +28,6 @@ using namespace com::sun::star; -using ::std::vector; using ::com::sun::star::uno::Sequence; using ::com::sun::star::uno::Any; diff --git a/sc/source/core/data/dpshttab.cxx b/sc/source/core/data/dpshttab.cxx index ae9407a6a64c..f8cfa6de61e9 100644 --- a/sc/source/core/data/dpshttab.cxx +++ b/sc/source/core/data/dpshttab.cxx @@ -38,7 +38,6 @@ using namespace ::com::sun::star; using ::com::sun::star::uno::Any; using ::com::sun::star::uno::Sequence; -using ::std::vector; ScSheetDPData::ScSheetDPData(const ScDocument* pD, const ScSheetSourceDesc& rDesc, const ScDPCache& rCache) : ScDPTableData(pD), diff --git a/sc/source/core/data/dptabdat.cxx b/sc/source/core/data/dptabdat.cxx index 7b3c80712404..d9706f961e2d 100644 --- a/sc/source/core/data/dptabdat.cxx +++ b/sc/source/core/data/dptabdat.cxx @@ -27,7 +27,6 @@ using namespace ::com::sun::star; -using ::std::vector; ScDPTableData::CalcInfo::CalcInfo() : pInitState( nullptr ), @@ -187,7 +186,7 @@ void ScDPTableData::ProcessRowData(CalcInfo& rInfo, const CalcRowData& rData, bo //TODO: single process method with ColMembers, RowMembers and data !!! if (rInfo.pColRoot->GetChildDimension()) { - vector<SCROW> aEmptyData; + std::vector<SCROW> aEmptyData; rInfo.pColRoot->GetChildDimension()->ProcessData(rData.aColData, nullptr, aEmptyData, rData.aValues); } @@ -215,7 +214,7 @@ void ScDPTableData::CalcResultsFromCacheTable(const ScDPFilteredCache& rCacheTab } void ScDPTableData::GetItemData(const ScDPFilteredCache& rCacheTable, sal_Int32 nRow, - const vector<sal_Int32>& rDims, vector<SCROW>& rItemData) + const std::vector<sal_Int32>& rDims, std::vector<SCROW>& rItemData) { sal_Int32 nDimSize = rDims.size(); rItemData.reserve(rItemData.size() + nDimSize); @@ -250,7 +249,7 @@ const ScDPItemData* ScDPTableData::GetMemberByIndex( sal_Int32 nDim, sal_Int32 n if ( nIndex >= GetMembersCount( nDim ) ) return nullptr; - const ::std::vector<SCROW>& nMembers = GetCacheTable().getFieldEntries( nDim ); + const std::vector<SCROW>& nMembers = GetCacheTable().getFieldEntries( nDim ); return GetCacheTable().getCache().GetItemDataById( static_cast<SCCOL>(nDim), static_cast<SCROW>(nMembers[nIndex]) ); } diff --git a/sc/source/core/data/dptabres.cxx b/sc/source/core/data/dptabres.cxx index 961c25db71cb..b32d419919eb 100644 --- a/sc/source/core/data/dptabres.cxx +++ b/sc/source/core/data/dptabres.cxx @@ -53,8 +53,6 @@ #include <com/sun/star/sheet/GeneralFunction2.hpp> using namespace com::sun::star; -using ::std::vector; -using ::std::pair; using ::com::sun::star::uno::Sequence; namespace { @@ -1017,7 +1015,7 @@ bool ScDPResultMember::IsNamedItem( SCROW nIndex ) const return false; } -bool ScDPResultMember::IsValidEntry( const vector< SCROW >& aMembers ) const +bool ScDPResultMember::IsValidEntry( const std::vector< SCROW >& aMembers ) const { if ( !IsValid() ) return false; @@ -1028,15 +1026,15 @@ bool ScDPResultMember::IsValidEntry( const vector< SCROW >& aMembers ) const if (aMembers.size() < 2) return false; - vector<SCROW>::const_iterator itr = aMembers.begin(); - vector<SCROW> aChildMembers(++itr, aMembers.end()); + std::vector<SCROW>::const_iterator itr = aMembers.begin(); + std::vector<SCROW> aChildMembers(++itr, aMembers.end()); return pChildDim->IsValidEntry(aChildMembers); } else return true; } -void ScDPResultMember::InitFrom( const vector<ScDPDimension*>& ppDim, const vector<ScDPLevel*>& ppLev, +void ScDPResultMember::InitFrom( const std::vector<ScDPDimension*>& ppDim, const std::vector<ScDPLevel*>& ppLev, size_t nPos, ScDPInitState& rInitState , bool bInitChild ) { @@ -1081,7 +1079,7 @@ void ScDPResultMember::InitFrom( const vector<ScDPDimension*>& ppDim, const vect } void ScDPResultMember::LateInitFrom( - LateInitParams& rParams, const vector<SCROW>& pItemData, size_t nPos, ScDPInitState& rInitState) + LateInitParams& rParams, const std::vector<SCROW>& pItemData, size_t nPos, ScDPInitState& rInitState) { // without LateInit, everything has already been initialized if ( !pResultData->IsLateInit() ) @@ -1254,8 +1252,8 @@ tools::Long ScDPResultMember::GetSubTotalCount( tools::Long* pUserSubStart ) con return 0; } -void ScDPResultMember::ProcessData( const vector< SCROW >& aChildMembers, const ScDPResultDimension* pDataDim, - const vector< SCROW >& aDataMembers, const vector<ScDPValue>& aValues ) +void ScDPResultMember::ProcessData( const std::vector< SCROW >& aChildMembers, const ScDPResultDimension* pDataDim, + const std::vector< SCROW >& aDataMembers, const std::vector<ScDPValue>& aValues ) { SetHasElements(); @@ -1910,7 +1908,7 @@ static tools::Long lcl_GetSubTotalPos( const ScDPSubTotalState& rSubState ) return nRet; } -void ScDPDataMember::UpdateValues( const vector<ScDPValue>& aValues, const ScDPSubTotalState& rSubState ) +void ScDPDataMember::UpdateValues( const std::vector<ScDPValue>& aValues, const ScDPSubTotalState& rSubState ) { //TODO: find out how many and which subtotals are used @@ -1934,7 +1932,7 @@ void ScDPDataMember::UpdateValues( const vector<ScDPValue>& aValues, const ScDPS } } -void ScDPDataMember::ProcessData( const vector< SCROW >& aChildMembers, const vector<ScDPValue>& aValues, +void ScDPDataMember::ProcessData( const std::vector< SCROW >& aChildMembers, const std::vector<ScDPValue>& aValues, const ScDPSubTotalState& rSubState ) { if ( pResultData->IsLateInit() && !pChildDimension && pResultMember && pResultMember->GetChildDimension() ) @@ -2797,7 +2795,7 @@ ScDPResultMember *ScDPResultDimension::FindMember( SCROW iData ) const } void ScDPResultDimension::InitFrom( - const vector<ScDPDimension*>& ppDim, const vector<ScDPLevel*>& ppLev, + const std::vector<ScDPDimension*>& ppDim, const std::vector<ScDPLevel*>& ppLev, size_t nPos, ScDPInitState& rInitState, bool bInitChild ) { if (nPos >= ppDim.size() || nPos >= ppLev.size()) @@ -2865,7 +2863,7 @@ void ScDPResultDimension::InitFrom( } void ScDPResultDimension::LateInitFrom( - LateInitParams& rParams, const vector<SCROW>& pItemData, size_t nPos, ScDPInitState& rInitState) + LateInitParams& rParams, const std::vector<SCROW>& pItemData, size_t nPos, ScDPInitState& rInitState) { if ( rParams.IsEnd( nPos ) ) return; @@ -3004,7 +3002,7 @@ tools::Long ScDPResultDimension::GetSize(tools::Long nMeasure) const return nTotal; } -bool ScDPResultDimension::IsValidEntry( const vector< SCROW >& aMembers ) const +bool ScDPResultDimension::IsValidEntry( const std::vector< SCROW >& aMembers ) const { if (aMembers.empty()) return false; @@ -3018,10 +3016,10 @@ bool ScDPResultDimension::IsValidEntry( const vector< SCROW >& aMembers ) const return false; } -void ScDPResultDimension::ProcessData( const vector< SCROW >& aMembers, +void ScDPResultDimension::ProcessData( const std::vector< SCROW >& aMembers, const ScDPResultDimension* pDataDim, - const vector< SCROW >& aDataMembers, - const vector<ScDPValue>& aValues ) const + const std::vector< SCROW >& aDataMembers, + const std::vector<ScDPValue>& aValues ) const { if (aMembers.empty()) return; @@ -3029,10 +3027,10 @@ void ScDPResultDimension::ProcessData( const vector< SCROW >& aMembers, ScDPResultMember* pMember = FindMember( aMembers[0] ); if ( nullptr != pMember ) { - vector<SCROW> aChildMembers; + std::vector<SCROW> aChildMembers; if (aMembers.size() > 1) { - vector<SCROW>::const_iterator itr = aMembers.begin(); + std::vector<SCROW>::const_iterator itr = aMembers.begin(); aChildMembers.insert(aChildMembers.begin(), ++itr, aMembers.end()); } pMember->ProcessData( aChildMembers, pDataDim, aDataMembers, aValues ); @@ -3578,7 +3576,7 @@ void ScDPDataDimension::InitFrom( const ScDPResultDimension* pDim ) } } -void ScDPDataDimension::ProcessData( const vector< SCROW >& aDataMembers, const vector<ScDPValue>& aValues, +void ScDPDataDimension::ProcessData( const std::vector< SCROW >& aDataMembers, const std::vector<ScDPValue>& aValues, const ScDPSubTotalState& rSubState ) { // the ScDPItemData array must contain enough entries for all dimensions - this isn't checked @@ -3591,10 +3589,10 @@ void ScDPDataDimension::ProcessData( const vector< SCROW >& aDataMembers, const // always first member for data layout dim if ( bIsDataLayout || ( !aDataMembers.empty() && pMember->IsNamedItem(aDataMembers[0]) ) ) { - vector<SCROW> aChildDataMembers; + std::vector<SCROW> aChildDataMembers; if (aDataMembers.size() > 1) { - vector<SCROW>::const_iterator itr = aDataMembers.begin(); + std::vector<SCROW>::const_iterator itr = aDataMembers.begin(); aChildDataMembers.insert(aChildDataMembers.begin(), ++itr, aDataMembers.end()); } pMember->ProcessData( aChildDataMembers, aValues, rSubState ); @@ -3907,7 +3905,7 @@ void ScDPResultVisibilityData::addVisibleMember(const OUString& rDimName, const DimMemberType::iterator itr = maDimensions.find(rDimName); if (itr == maDimensions.end()) { - pair<DimMemberType::iterator, bool> r = maDimensions.emplace( + std::pair<DimMemberType::iterator, bool> r = maDimensions.emplace( rDimName, VisibleMemberType()); if (!r.second) @@ -3920,7 +3918,7 @@ void ScDPResultVisibilityData::addVisibleMember(const OUString& rDimName, const rMem.insert(rMemberItem); } -void ScDPResultVisibilityData::fillFieldFilters(vector<ScDPFilteredCache::Criterion>& rFilters) const +void ScDPResultVisibilityData::fillFieldFilters(std::vector<ScDPFilteredCache::Criterion>& rFilters) const { typedef std::unordered_map<OUString, tools::Long> FieldNameMapType; FieldNameMapType aFieldNames; @@ -4071,7 +4069,7 @@ ResultMembers::~ResultMembers() } LateInitParams::LateInitParams( - const vector<ScDPDimension*>& ppDim, const vector<ScDPLevel*>& ppLev, bool bRow ) : + const std::vector<ScDPDimension*>& ppDim, const std::vector<ScDPLevel*>& ppLev, bool bRow ) : mppDim( ppDim ), mppLev( ppLev ), mbRow( bRow ), diff --git a/sc/source/core/data/dptabsrc.cxx b/sc/source/core/data/dptabsrc.cxx index 8ac4bfcf4783..ba8f3d55ab78 100644 --- a/sc/source/core/data/dptabsrc.cxx +++ b/sc/source/core/data/dptabsrc.cxx @@ -56,7 +56,6 @@ #include <com/sun/star/i18n/CalendarDisplayIndex.hpp> using namespace com::sun::star; -using ::std::vector; using ::com::sun::star::uno::Sequence; using ::com::sun::star::uno::Any; using ::com::sun::star::sheet::DataPilotFieldAutoShowInfo; @@ -421,7 +420,7 @@ Sequence< Sequence<Any> > SAL_CALL ScDPSource::getDrillDownData(const Sequence<s { sal_Int32 nColumnCount = GetData()->GetColumnCount(); - vector<ScDPFilteredCache::Criterion> aFilterCriteria; -e ... etc. - the rest is truncated