diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2021-06-09 17:28:19 +0200 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2021-06-11 14:54:14 +0200 |
commit | b1fe17f280b24e78e7ee55d4762dc64a98d6f302 (patch) | |
tree | 819aecb52d9c92a3cf6b640c52da8cfcf6a077fa /sc | |
parent | 51178765e8afe33ebbb2016219cff869d88ca07f (diff) |
Simplify Sequences initializations (sc)
Change-Id: I0c581b3a900a6b89c0f4e203310d65600545987f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116929
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'sc')
25 files changed, 53 insertions, 79 deletions
diff --git a/sc/qa/extras/scchartobj.cxx b/sc/qa/extras/scchartobj.cxx index d5cd726f9164..04eaeba8131d 100644 --- a/sc/qa/extras/scchartobj.cxx +++ b/sc/qa/extras/scchartobj.cxx @@ -157,8 +157,7 @@ uno::Reference<uno::XInterface> ScChartObj::init() uno::UNO_SET_THROW); uno::Reference<sheet::XCellRangeAddressable> xCRA(xCellRange1, uno::UNO_QUERY_THROW); - uno::Sequence<table::CellRangeAddress> aCRA(1); - aCRA[0] = xCRA->getRangeAddress(); + uno::Sequence<table::CellRangeAddress> aCRA{ xCRA->getRangeAddress() }; uno::Reference<table::XTableChartsSupplier> xTCS(xSheet0, uno::UNO_QUERY_THROW); uno::Reference<table::XTableCharts> xTC = xTCS->getCharts(); diff --git a/sc/qa/extras/scchartsobj.cxx b/sc/qa/extras/scchartsobj.cxx index 7424e1d68c76..0b85a2988d25 100644 --- a/sc/qa/extras/scchartsobj.cxx +++ b/sc/qa/extras/scchartsobj.cxx @@ -165,12 +165,10 @@ uno::Reference<uno::XInterface> ScChartsObj::init() uno::UNO_SET_THROW); uno::Reference<sheet::XCellRangeAddressable> xCRA(xCellRange1, uno::UNO_QUERY_THROW); - uno::Sequence<table::CellRangeAddress> aCRA(1); - aCRA[0] = xCRA->getRangeAddress(); - uno::Reference<table::XTableChartsSupplier> xTCS(xSheet0, uno::UNO_QUERY_THROW); uno::Reference<table::XTableCharts> xTC = xTCS->getCharts(); - xTC->addNewByName("ScChartsObj", awt::Rectangle(500, 3000, 25000, 11000), aCRA, true, true); + xTC->addNewByName("ScChartsObj", awt::Rectangle(500, 3000, 25000, 11000), + { xCRA->getRangeAddress() }, true, true); return xTC; } diff --git a/sc/qa/extras/scdatapilotfieldgroupitemobj.cxx b/sc/qa/extras/scdatapilotfieldgroupitemobj.cxx index e40170e5198c..6e0716020957 100644 --- a/sc/qa/extras/scdatapilotfieldgroupitemobj.cxx +++ b/sc/qa/extras/scdatapilotfieldgroupitemobj.cxx @@ -146,10 +146,7 @@ uno::Reference<uno::XInterface> ScDataPilotFieldGroupItemObj::init() uno::Reference<sheet::XDataPilotFieldGrouping> xDPFG(xIA_RF0->getByIndex(0), uno::UNO_QUERY_THROW); - uno::Sequence<OUString> aElements(2); - aElements[0] = "aName"; - aElements[1] = "otherName"; - xDPFG->createNameGroup(aElements); + xDPFG->createNameGroup({ "aName", "otherName" }); uno::Reference<container::XIndexAccess> xIA_DPT1(xDPTS->getDataPilotTables(), uno::UNO_QUERY_THROW); diff --git a/sc/qa/extras/scdatapilotfieldgroupobj.cxx b/sc/qa/extras/scdatapilotfieldgroupobj.cxx index 8fc85a85faea..f908dd160c6b 100644 --- a/sc/qa/extras/scdatapilotfieldgroupobj.cxx +++ b/sc/qa/extras/scdatapilotfieldgroupobj.cxx @@ -172,10 +172,7 @@ uno::Reference<uno::XInterface> ScDataPilotFieldGroupObj::init() uno::Reference<sheet::XDataPilotFieldGrouping> xDPFG(xIA_RF0->getByIndex(0), uno::UNO_QUERY_THROW); - uno::Sequence<OUString> aElements(2); - aElements[0] = "aName"; - aElements[1] = "otherName"; - xDPFG->createNameGroup(aElements); + xDPFG->createNameGroup({ "aName", "otherName" }); uno::Reference<container::XIndexAccess> xIA_DPT1(xDPTS->getDataPilotTables(), uno::UNO_QUERY_THROW); diff --git a/sc/qa/extras/scdatapilotfieldgroupsobj.cxx b/sc/qa/extras/scdatapilotfieldgroupsobj.cxx index e742d2328205..36ca8fa32a3b 100644 --- a/sc/qa/extras/scdatapilotfieldgroupsobj.cxx +++ b/sc/qa/extras/scdatapilotfieldgroupsobj.cxx @@ -176,10 +176,7 @@ uno::Reference<uno::XInterface> ScDataPilotFieldGroupsObj::init() uno::Reference<sheet::XDataPilotFieldGrouping> xDPFG(xIA_RF0->getByIndex(0), uno::UNO_QUERY_THROW); - uno::Sequence<OUString> aElements(2); - aElements[0] = "aName"; - aElements[1] = "otherName"; - xDPFG->createNameGroup(aElements); + xDPFG->createNameGroup({ "aName", "otherName" }); uno::Reference<container::XIndexAccess> xIA_DPT1(xDPTS->getDataPilotTables(), uno::UNO_QUERY_THROW); diff --git a/sc/qa/extras/scindexenumeration_scenariosenumeration.cxx b/sc/qa/extras/scindexenumeration_scenariosenumeration.cxx index c4ba4fc32a70..dc96e1d767d6 100644 --- a/sc/qa/extras/scindexenumeration_scenariosenumeration.cxx +++ b/sc/qa/extras/scindexenumeration_scenariosenumeration.cxx @@ -75,9 +75,8 @@ uno::Reference<uno::XInterface> ScIndexEnumeration_ScenariosEnumeration::init() uno::UNO_SET_THROW); uno::Reference<sheet::XCellRangeAddressable> xCRA(xCellRange1, uno::UNO_QUERY_THROW); - uno::Sequence<table::CellRangeAddress> aCRA(1); - aCRA[0] = xCRA->getRangeAddress(); - xScenariosSupplier->getScenarios()->addNewByName("ScScenario", aCRA, "Range"); + xScenariosSupplier->getScenarios()->addNewByName("ScScenario", { xCRA->getRangeAddress() }, + "Range"); uno::Reference<container::XEnumerationAccess> xEA(xScenariosSupplier->getScenarios(), uno::UNO_QUERY_THROW); diff --git a/sc/qa/extras/scindexenumeration_subtotalfieldsenumeration.cxx b/sc/qa/extras/scindexenumeration_subtotalfieldsenumeration.cxx index f4ca48888482..ec270ee54136 100644 --- a/sc/qa/extras/scindexenumeration_subtotalfieldsenumeration.cxx +++ b/sc/qa/extras/scindexenumeration_subtotalfieldsenumeration.cxx @@ -70,10 +70,7 @@ uno::Reference<uno::XInterface> ScIndexEnumeration_SubTotalFieldsEnumeration::in uno::Reference<sheet::XSubTotalDescriptor> xSTD(xSTC->createSubTotalDescriptor(true), uno::UNO_SET_THROW); - uno::Sequence<sheet::SubTotalColumn> aSubTotalColumns(1); - aSubTotalColumns[0].Column = 5; - aSubTotalColumns[0].Function = sheet::GeneralFunction_SUM; - xSTD->addNew(aSubTotalColumns, 1); + xSTD->addNew({ { 5, sheet::GeneralFunction_SUM } }, 1); uno::Reference<container::XIndexAccess> xIA_STD(xSTD, uno::UNO_QUERY_THROW); uno::Reference<container::XEnumerationAccess> xEA(xIA_STD, uno::UNO_QUERY_THROW); diff --git a/sc/qa/extras/scindexenumeration_tablechartsenumeration.cxx b/sc/qa/extras/scindexenumeration_tablechartsenumeration.cxx index 21bf34abc0ca..7e974fff43fc 100644 --- a/sc/qa/extras/scindexenumeration_tablechartsenumeration.cxx +++ b/sc/qa/extras/scindexenumeration_tablechartsenumeration.cxx @@ -132,12 +132,10 @@ uno::Reference<uno::XInterface> ScIndexEnumeration_TableChartsEnumeration::init( uno::UNO_SET_THROW); uno::Reference<sheet::XCellRangeAddressable> xCRA(xCellRange1, uno::UNO_QUERY_THROW); - uno::Sequence<table::CellRangeAddress> aCRA(1); - aCRA[0] = xCRA->getRangeAddress(); - uno::Reference<table::XTableChartsSupplier> xTCS(xSheet0, uno::UNO_QUERY_THROW); uno::Reference<table::XTableCharts> xTC = xTCS->getCharts(); - xTC->addNewByName("ScChartObj", awt::Rectangle(500, 3000, 25000, 11000), aCRA, true, false); + xTC->addNewByName("ScChartObj", awt::Rectangle(500, 3000, 25000, 11000), + { xCRA->getRangeAddress() }, true, false); uno::Reference<container::XEnumerationAccess> xEA(xTC, uno::UNO_QUERY_THROW); diff --git a/sc/qa/extras/scscenariosobj.cxx b/sc/qa/extras/scscenariosobj.cxx index 78e94ae381db..2805772f1f01 100644 --- a/sc/qa/extras/scscenariosobj.cxx +++ b/sc/qa/extras/scscenariosobj.cxx @@ -110,10 +110,8 @@ uno::Reference<uno::XInterface> ScScenariosObj::init() uno::Reference<sheet::XCellRangeAddressable> xCRAddressable(xCellRange2, uno::UNO_QUERY_THROW); table::CellRangeAddress aCellRangeAddr = xCRAddressable->getRangeAddress(); - uno::Sequence<table::CellRangeAddress> aCellRangeAddresses(1); - aCellRangeAddresses[0] = aCellRangeAddr; uno::Reference<sheet::XScenariosSupplier> xSupplier(xSheet, uno::UNO_QUERY_THROW); - xSupplier->getScenarios()->addNewByName("ScScenarios", aCellRangeAddresses, "Range"); + xSupplier->getScenarios()->addNewByName("ScScenarios", { aCellRangeAddr }, "Range"); return xSupplier->getScenarios(); } diff --git a/sc/qa/extras/sctablesheetobj.cxx b/sc/qa/extras/sctablesheetobj.cxx index d0b12d1d937e..3179ae54d2d3 100644 --- a/sc/qa/extras/sctablesheetobj.cxx +++ b/sc/qa/extras/sctablesheetobj.cxx @@ -271,8 +271,7 @@ uno::Reference< uno::XInterface > ScTableSheetObj::init() xSheet->getCellByPosition(8, 6)->setFormula("= SUM(G7:H7)"); xSheet->getCellByPosition(9, 6)->setFormula("= G7*I7"); - uno::Sequence<table::CellRangeAddress> aCellRangeAddr(1); - aCellRangeAddr[0] = table::CellRangeAddress(0, 0, 0, 10, 10); + uno::Sequence<table::CellRangeAddress> aCellRangeAddr { { 0, 0, 0, 10, 10 } }; uno::Reference<sheet::XScenariosSupplier> xScence(xSheet, UNO_QUERY_THROW); xScence->getScenarios()->addNewByName("Scenario", aCellRangeAddr, "Comment"); @@ -309,8 +308,7 @@ uno::Reference<uno::XInterface> ScTableSheetObj::getScenarioSpreadsheet() xSheet->getCellByPosition(8, 6)->setFormula("= SUM(G7:H7)"); xSheet->getCellByPosition(9, 6)->setFormula("= G7*I7"); - uno::Sequence<table::CellRangeAddress> aCellRangeAddr(1); - aCellRangeAddr[0] = table::CellRangeAddress(0, 0, 0, 10, 10); + uno::Sequence<table::CellRangeAddress> aCellRangeAddr { { 0, 0, 0, 10, 10 } }; uno::Reference<sheet::XScenariosSupplier> xScence(xSheet, UNO_QUERY_THROW); xScence->getScenarios()->addNewByName("Scenario", aCellRangeAddr, "Comment"); @@ -336,8 +334,7 @@ uno::Reference< uno::XInterface > ScTableSheetObj::getXSpreadsheet() xSheet->getCellByPosition(8, 6)->setFormula("= SUM(G7:H7)"); xSheet->getCellByPosition(9, 6)->setFormula("= G7*I7"); - uno::Sequence<table::CellRangeAddress> aCellRangeAddr(1); - aCellRangeAddr[0] = table::CellRangeAddress(0, 0, 0, 10, 10); + uno::Sequence<table::CellRangeAddress> aCellRangeAddr { {0, 0, 0, 10, 10} }; uno::Reference<sheet::XScenariosSupplier> xScence(xSheet, UNO_QUERY_THROW); xScence->getScenarios()->addNewByName("Scenario", aCellRangeAddr, "Comment"); xSheets->getByName("Scenario"); diff --git a/sc/qa/perf/scperfobj.cxx b/sc/qa/perf/scperfobj.cxx index 17b7345cb2f5..fb7854bd88be 100644 --- a/sc/qa/perf/scperfobj.cxx +++ b/sc/qa/perf/scperfobj.cxx @@ -553,9 +553,7 @@ namespace { uno::Sequence< uno::Sequence< OUString > > aFormulae(1000); for (sal_Int32 i = 0; i < 1000; ++i) { - uno::Sequence< OUString > aRow(1); - aRow[0] = rFormula; - aFormulae[i] = aRow; + aFormulae[i] = { rFormula }; } // NB. not set Array (matrix) formula diff --git a/sc/source/core/data/dptabsrc.cxx b/sc/source/core/data/dptabsrc.cxx index b74bfd0ba152..1950c8500d39 100644 --- a/sc/source/core/data/dptabsrc.cxx +++ b/sc/source/core/data/dptabsrc.cxx @@ -410,9 +410,7 @@ uno::Sequence<double> ScDPSource::getFilteredResults( double fVal = maResFilterSet.getLeafResult(aFilters[0]); if (!std::isnan(fVal)) { - uno::Sequence<double> aRet(1); - aRet[0] = fVal; - return aRet; + return { fVal }; } } @@ -1988,7 +1986,7 @@ uno::Sequence<sheet::MemberResult> SAL_CALL ScDPLevel::getResults() if (pRes) return *pRes; - return uno::Sequence<sheet::MemberResult>(0); //TODO: Error? + return {}; //TODO: Error? } OUString SAL_CALL ScDPLevel::getName() @@ -2059,7 +2057,7 @@ uno::Sequence<sal_Int16> ScDPLevel::getSubTotals() const tools::Long nSrcDim = pSource->GetSourceDim( nDim ); if ( !pSource->SubTotalAllowed( nSrcDim ) ) - return uno::Sequence<sal_Int16>(0); + return {}; return aSubTotals; } diff --git a/sc/source/filter/xml/xmlimprt.cxx b/sc/source/filter/xml/xmlimprt.cxx index 938f0c79d403..968ebb0cdbfe 100644 --- a/sc/source/filter/xml/xmlimprt.cxx +++ b/sc/source/filter/xml/xmlimprt.cxx @@ -1687,11 +1687,16 @@ extern "C" SAL_DLLPUBLIC_EXPORT bool TestImportFODS(SvStream &rStream) uno::Reference<io::XInputStream> xStream(new ::utl::OSeekableInputStreamWrapper(rStream)); uno::Reference<uno::XInterface> xInterface(xMultiServiceFactory->createInstance("com.sun.star.comp.Writer.XmlFilterAdaptor"), uno::UNO_SET_THROW); - css::uno::Sequence<OUString> aUserData(7); - aUserData[0] = "com.sun.star.comp.filter.OdfFlatXml"; - aUserData[2] = "com.sun.star.comp.Calc.XMLOasisImporter"; - aUserData[3] = "com.sun.star.comp.Calc.XMLOasisExporter"; - aUserData[6] = "true"; + css::uno::Sequence<OUString> aUserData + { + "com.sun.star.comp.filter.OdfFlatXml", + "", + "com.sun.star.comp.Calc.XMLOasisImporter", + "com.sun.star.comp.Calc.XMLOasisExporter", + "", + "", + "true" + }; uno::Sequence<beans::PropertyValue> aAdaptorArgs(comphelper::InitPropertySequence( { { "UserData", uno::Any(aUserData) }, diff --git a/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx b/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx index 6c38d4d81fba..d04abdbeb68e 100644 --- a/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx +++ b/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx @@ -246,13 +246,13 @@ uno::Reference< XAccessibleTable > SAL_CALL ScAccessiblePreviewTable::getAccessi uno::Sequence< sal_Int32 > SAL_CALL ScAccessiblePreviewTable::getSelectedAccessibleRows() { // in the page preview, there is no selection - return uno::Sequence<sal_Int32>(0); + return {}; } uno::Sequence< sal_Int32 > SAL_CALL ScAccessiblePreviewTable::getSelectedAccessibleColumns() { // in the page preview, there is no selection - return uno::Sequence<sal_Int32>(0); + return {}; } sal_Bool SAL_CALL ScAccessiblePreviewTable::isAccessibleRowSelected( sal_Int32 nRow ) diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx index 9276a57ecfc6..f3eca38a7da9 100644 --- a/sc/source/ui/docshell/docsh4.cxx +++ b/sc/source/ui/docshell/docsh4.cxx @@ -1395,8 +1395,7 @@ bool ScDocShell::ExecuteChangeProtectionDialog( bool bJustQueryIfProtected ) if ( bJustQueryIfProtected ) bDone = true; else - pChangeTrack->SetProtection( - css::uno::Sequence< sal_Int8 > (0) ); + pChangeTrack->SetProtection( {} ); } else { diff --git a/sc/source/ui/unoobj/appluno.cxx b/sc/source/ui/unoobj/appluno.cxx index cab5fc67026b..60adeffe2722 100644 --- a/sc/source/ui/unoobj/appluno.cxx +++ b/sc/source/ui/unoobj/appluno.cxx @@ -382,7 +382,7 @@ uno::Sequence<sal_Int32> SAL_CALL ScRecentFunctionsObj::getRecentFunctionIds() pAry[i] = pFuncs[i]; return aSeq; } - return uno::Sequence<sal_Int32>(0); + return {}; } void SAL_CALL ScRecentFunctionsObj::setRecentFunctionIds( @@ -597,7 +597,7 @@ uno::Sequence<OUString> SAL_CALL ScFunctionListObj::getElementNames() } return aSeq; } - return uno::Sequence<OUString>(0); + return {}; } sal_Bool SAL_CALL ScFunctionListObj::hasByName( const OUString& aName ) diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx index 365291851c6f..1922781652d5 100644 --- a/sc/source/ui/unoobj/cellsuno.cxx +++ b/sc/source/ui/unoobj/cellsuno.cxx @@ -2978,7 +2978,7 @@ uno::Sequence< uno::Sequence<double> > SAL_CALL ScCellRangesBase::getData() return aRowSeq; } - return uno::Sequence< uno::Sequence<double> >(0); + return {}; } ScRangeListRef ScCellRangesBase::GetLimitedChartRanges_Impl( sal_Int32 nDataColumns, sal_Int32 nDataRows ) const @@ -3080,7 +3080,7 @@ uno::Sequence<OUString> SAL_CALL ScCellRangesBase::getRowDescriptions() return aSeq; } - return uno::Sequence<OUString>(0); + return {}; } void SAL_CALL ScCellRangesBase::setRowDescriptions( @@ -3149,7 +3149,7 @@ uno::Sequence<OUString> SAL_CALL ScCellRangesBase::getColumnDescriptions() return aSeq; } - return uno::Sequence<OUString>(0); + return {}; } void SAL_CALL ScCellRangesBase::setColumnDescriptions( @@ -4094,7 +4094,7 @@ uno::Sequence<table::CellRangeAddress> SAL_CALL ScCellRangesObj::getRangeAddress return aSeq; } - return uno::Sequence<table::CellRangeAddress>(0); // can be empty + return {}; // can be empty } uno::Reference<container::XEnumerationAccess> SAL_CALL ScCellRangesObj::getCells() @@ -4484,7 +4484,7 @@ uno::Sequence<OUString> SAL_CALL ScCellRangesObj::getElementNames() } return aSeq; } - return uno::Sequence<OUString>(0); + return {}; } sal_Bool SAL_CALL ScCellRangesObj::hasByName( const OUString& aName ) @@ -6829,7 +6829,7 @@ uno::Sequence<sheet::TablePageBreakData> SAL_CALL ScTableSheetObj::getColumnPage } return aSeq; } - return uno::Sequence<sheet::TablePageBreakData>(0); + return {}; } uno::Sequence<sheet::TablePageBreakData> SAL_CALL ScTableSheetObj::getRowPageBreaks() @@ -6852,7 +6852,7 @@ uno::Sequence<sheet::TablePageBreakData> SAL_CALL ScTableSheetObj::getRowPageBre } return rDoc.GetRowBreakData(nTab); } - return uno::Sequence<sheet::TablePageBreakData>(0); + return {}; } void SAL_CALL ScTableSheetObj::removeAllManualPageBreaks() diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx index 708833db0b1f..3bcdf315db82 100644 --- a/sc/source/ui/unoobj/chart2uno.cxx +++ b/sc/source/ui/unoobj/chart2uno.cxx @@ -2948,8 +2948,7 @@ uno::Sequence< OUString > SAL_CALL ScChart2DataSequence::getTextualData() { if( m_aTokens.front()->GetType() == svString ) { - aSeq = uno::Sequence<OUString>(1); - aSeq[0] = m_aTokens.front()->GetString().getString(); + aSeq = uno::Sequence<OUString> { m_aTokens.front()->GetString().getString() }; } } diff --git a/sc/source/ui/unoobj/chartuno.cxx b/sc/source/ui/unoobj/chartuno.cxx index 1530ed818b92..60e3d2aa4536 100644 --- a/sc/source/ui/unoobj/chartuno.cxx +++ b/sc/source/ui/unoobj/chartuno.cxx @@ -390,7 +390,7 @@ uno::Sequence<OUString> SAL_CALL ScChartsObj::getElementNames() return aSeq; } - return uno::Sequence<OUString>(0); + return {}; } sal_Bool SAL_CALL ScChartsObj::hasByName( const OUString& aName ) diff --git a/sc/source/ui/unoobj/condformatuno.cxx b/sc/source/ui/unoobj/condformatuno.cxx index e5e65dd7dcbf..573d70a75794 100644 --- a/sc/source/ui/unoobj/condformatuno.cxx +++ b/sc/source/ui/unoobj/condformatuno.cxx @@ -1340,9 +1340,11 @@ uno::Any SAL_CALL ScDataBarFormatObj::getPropertyValue( const OUString& aPropert break; case DataBarEntries: { - uno::Sequence<uno::Reference<sheet::XDataBarEntry> > aEntries(2); - aEntries[0] = new ScDataBarEntryObj(this, 0); - aEntries[1] = new ScDataBarEntryObj(this, 1); + uno::Sequence<uno::Reference<sheet::XDataBarEntry> > aEntries + { + new ScDataBarEntryObj(this, 0), + new ScDataBarEntryObj(this, 1) + }; aAny <<= aEntries; } break; diff --git a/sc/source/ui/unoobj/dapiuno.cxx b/sc/source/ui/unoobj/dapiuno.cxx index b7d3b9f33290..6b2abcb752dc 100644 --- a/sc/source/ui/unoobj/dapiuno.cxx +++ b/sc/source/ui/unoobj/dapiuno.cxx @@ -554,7 +554,7 @@ Sequence<OUString> SAL_CALL ScDataPilotTablesObj::getElementNames() return aSeq; } } - return Sequence<OUString>(0); + return {}; } sal_Bool SAL_CALL ScDataPilotTablesObj::hasByName( const OUString& aName ) diff --git a/sc/source/ui/unoobj/datauno.cxx b/sc/source/ui/unoobj/datauno.cxx index 8bdc638c9705..0ed0529948ad 100644 --- a/sc/source/ui/unoobj/datauno.cxx +++ b/sc/source/ui/unoobj/datauno.cxx @@ -2298,7 +2298,7 @@ uno::Sequence<OUString> SAL_CALL ScDatabaseRangesObj::getElementNames() return aSeq; } } - return uno::Sequence<OUString>(0); + return {}; } sal_Bool SAL_CALL ScDatabaseRangesObj::hasByName( const OUString& aName ) diff --git a/sc/source/ui/unoobj/fielduno.cxx b/sc/source/ui/unoobj/fielduno.cxx index 151675b229ee..f537eaf94977 100644 --- a/sc/source/ui/unoobj/fielduno.cxx +++ b/sc/source/ui/unoobj/fielduno.cxx @@ -1252,8 +1252,7 @@ uno::Any SAL_CALL ScEditFieldObj::getPropertyValue( const OUString& aPropertyNam if (aPropertyName == SC_UNONAME_ANCTYPES) { uno::Any aRet; - uno::Sequence<text::TextContentAnchorType> aSeq(1); - aSeq[0] = text::TextContentAnchorType_AS_CHARACTER; + uno::Sequence<text::TextContentAnchorType> aSeq { text::TextContentAnchorType_AS_CHARACTER }; aRet <<= aSeq; return aRet; } diff --git a/sc/source/ui/unoobj/nameuno.cxx b/sc/source/ui/unoobj/nameuno.cxx index a9fa465e6d2d..939cea49323d 100644 --- a/sc/source/ui/unoobj/nameuno.cxx +++ b/sc/source/ui/unoobj/nameuno.cxx @@ -686,7 +686,7 @@ uno::Sequence<OUString> SAL_CALL ScNamedRangesObj::getElementNames() return aSeq; } } - return uno::Sequence<OUString>(0); + return {}; } sal_Bool SAL_CALL ScNamedRangesObj::hasByName( const OUString& aName ) diff --git a/sc/source/ui/vba/vbachart.cxx b/sc/source/ui/vba/vbachart.cxx index dcd73199f2bb..09c061a36ced 100644 --- a/sc/source/ui/vba/vbachart.cxx +++ b/sc/source/ui/vba/vbachart.cxx @@ -564,15 +564,12 @@ ScVbaChart::setSourceData( const css::uno::Reference< ::ooo::vba::excel::XRange { try { - uno::Sequence< table::CellRangeAddress > aRangeAddresses(1); table::CellRangeAddress aSingleRangeAddress; uno::Reference< sheet::XCellRangeAddressable > xAddressable( _xCalcRange->getCellRange(), uno::UNO_QUERY_THROW ); aSingleRangeAddress = xAddressable->getRangeAddress(); - aRangeAddresses[0] = aSingleRangeAddress; - - mxTableChart->setRanges(aRangeAddresses); + mxTableChart->setRanges({ aSingleRangeAddress } ); bool bsetRowHeaders = false; bool bsetColumnHeaders = false; |