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/source/ui | |
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/source/ui')
-rw-r--r-- | sc/source/ui/Accessibility/AccessiblePreviewTable.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/docshell/docsh4.cxx | 3 | ||||
-rw-r--r-- | sc/source/ui/unoobj/appluno.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/unoobj/cellsuno.cxx | 14 | ||||
-rw-r--r-- | sc/source/ui/unoobj/chart2uno.cxx | 3 | ||||
-rw-r--r-- | sc/source/ui/unoobj/chartuno.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/unoobj/condformatuno.cxx | 8 | ||||
-rw-r--r-- | sc/source/ui/unoobj/dapiuno.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/unoobj/datauno.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/unoobj/fielduno.cxx | 3 | ||||
-rw-r--r-- | sc/source/ui/unoobj/nameuno.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/vba/vbachart.cxx | 5 |
12 files changed, 24 insertions, 28 deletions
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; |