summaryrefslogtreecommitdiff
path: root/sc/source/ui
diff options
context:
space:
mode:
authorArkadiy Illarionov <qarkai@gmail.com>2019-08-10 22:20:30 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2019-08-12 15:23:53 +0200
commit4721cbb1bb118d33ac9fcf93dda8c083b364003d (patch)
treef958d6b46d40fd573483139512b4c31dbd6e153b /sc/source/ui
parenta684613daf9ed5670c5f80267cc1bea0b878b1f6 (diff)
Mark Sequence const in sc
It ensures that const begin()/end() methods will be called, removing any overhead. fca94779872b8ba0b0583d0b7068f1a46beb88c5 follow-up. Change-Id: Id680744abb1b3887f25c9bfa033106de18a9c2d0 Reviewed-on: https://gerrit.libreoffice.org/77250 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sc/source/ui')
-rw-r--r--sc/source/ui/dbgui/dapidata.cxx18
-rw-r--r--sc/source/ui/dbgui/tpsort.cxx2
-rw-r--r--sc/source/ui/docshell/docsh2.cxx2
-rw-r--r--sc/source/ui/miscdlgs/solverutil.cxx2
-rw-r--r--sc/source/ui/unoobj/cellsuno.cxx8
-rw-r--r--sc/source/ui/unoobj/chart2uno.cxx2
-rw-r--r--sc/source/ui/unoobj/chartuno.cxx2
-rw-r--r--sc/source/ui/unoobj/condformatuno.cxx4
-rw-r--r--sc/source/ui/unoobj/cursuno.cxx4
-rw-r--r--sc/source/ui/unoobj/dapiuno.cxx2
-rw-r--r--sc/source/ui/unoobj/docuno.cxx2
-rw-r--r--sc/source/ui/vba/vbachartobjects.cxx6
-rw-r--r--sc/source/ui/vba/vbapagebreaks.cxx4
-rw-r--r--sc/source/ui/vba/vbapagesetup.cxx2
-rw-r--r--sc/source/ui/vba/vbarange.cxx6
-rw-r--r--sc/source/ui/vba/vbasheetobject.cxx2
-rw-r--r--sc/source/ui/view/drawvie4.cxx8
-rw-r--r--sc/source/ui/view/viewdata.cxx2
18 files changed, 36 insertions, 42 deletions
diff --git a/sc/source/ui/dbgui/dapidata.cxx b/sc/source/ui/dbgui/dapidata.cxx
index 638d6a20b8f3..75e895f25a5f 100644
--- a/sc/source/ui/dbgui/dapidata.cxx
+++ b/sc/source/ui/dbgui/dapidata.cxx
@@ -54,7 +54,7 @@ ScDataPilotDatabaseDlg::ScDataPilotDatabaseDlg(weld::Window* pParent)
uno::Reference<sdb::XDatabaseContext> xContext = sdb::DatabaseContext::create(
comphelper::getProcessComponentContext() );
- uno::Sequence<OUString> aNames = xContext->getElementNames();
+ const uno::Sequence<OUString> aNames = xContext->getElementNames();
for( const OUString& aName : aNames )
{
m_xLbDatabase->append_text(aName);
@@ -131,7 +131,7 @@ void ScDataPilotDatabaseDlg::FillObjects()
uno::Reference<sdbc::XConnection> xConnection = xSource->connectWithCompletion( xHandler );
- uno::Sequence<OUString> aNames;
+ uno::Reference<container::XNameAccess> xItems;
if ( nSelect == DP_TYPELIST_TABLE )
{
// get all tables
@@ -139,10 +139,7 @@ void ScDataPilotDatabaseDlg::FillObjects()
uno::Reference<sdbcx::XTablesSupplier> xTablesSupp( xConnection, uno::UNO_QUERY );
if ( !xTablesSupp.is() ) return;
- uno::Reference<container::XNameAccess> xTables = xTablesSupp->getTables();
- if ( !xTables.is() ) return;
-
- aNames = xTables->getElementNames();
+ xItems = xTablesSupp->getTables();
}
else
{
@@ -151,14 +148,13 @@ void ScDataPilotDatabaseDlg::FillObjects()
uno::Reference<sdb::XQueriesSupplier> xQueriesSupp( xConnection, uno::UNO_QUERY );
if ( !xQueriesSupp.is() ) return;
- uno::Reference<container::XNameAccess> xQueries = xQueriesSupp->getQueries();
- if ( !xQueries.is() ) return;
-
- aNames = xQueries->getElementNames();
+ xItems = xQueriesSupp->getQueries();
}
- // fill list
+ if ( !xItems.is() ) return;
+ // fill list
+ const uno::Sequence<OUString> aNames = xItems->getElementNames();
for( const OUString& aName : aNames )
{
m_xCbObject->append_text(aName);
diff --git a/sc/source/ui/dbgui/tpsort.cxx b/sc/source/ui/dbgui/tpsort.cxx
index d4654e3b83f4..1df0446cf722 100644
--- a/sc/source/ui/dbgui/tpsort.cxx
+++ b/sc/source/ui/dbgui/tpsort.cxx
@@ -887,7 +887,7 @@ void ScTabPageSortOptions::FillAlgor()
else
{
lang::Locale aLocale( LanguageTag::convertToLocale( eLang ));
- uno::Sequence<OUString> aAlgos = m_xColWrap->listCollatorAlgorithms( aLocale );
+ const uno::Sequence<OUString> aAlgos = m_xColWrap->listCollatorAlgorithms( aLocale );
long nCount = aAlgos.getLength();
for (const OUString& sAlg : aAlgos)
diff --git a/sc/source/ui/docshell/docsh2.cxx b/sc/source/ui/docshell/docsh2.cxx
index 00ecfe4b293d..3749d4eff038 100644
--- a/sc/source/ui/docshell/docsh2.cxx
+++ b/sc/source/ui/docshell/docsh2.cxx
@@ -123,7 +123,7 @@ void ScDocShell::InitItems()
if (!m_aDocument.GetForbiddenCharacters())
{
// set forbidden characters if necessary
- uno::Sequence<lang::Locale> aLocales = aAsian.GetStartEndCharLocales();
+ const uno::Sequence<lang::Locale> aLocales = aAsian.GetStartEndCharLocales();
if (aLocales.hasElements())
{
std::shared_ptr<SvxForbiddenCharactersTable> xForbiddenTable(
diff --git a/sc/source/ui/miscdlgs/solverutil.cxx b/sc/source/ui/miscdlgs/solverutil.cxx
index 48af88892c21..c5f3752bdfb4 100644
--- a/sc/source/ui/miscdlgs/solverutil.cxx
+++ b/sc/source/ui/miscdlgs/solverutil.cxx
@@ -152,7 +152,7 @@ uno::Sequence<beans::PropertyValue> ScSolverUtil::GetDefaults( const OUString& r
if ( !xInfo.is() )
return aDefaults;
- uno::Sequence<beans::Property> aPropSeq = xInfo->getProperties();
+ const uno::Sequence<beans::Property> aPropSeq = xInfo->getProperties();
const sal_Int32 nSize = aPropSeq.getLength();
aDefaults.realloc(nSize);
sal_Int32 nValid = 0;
diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx
index a6237eb32731..7a6d0d8f5a1b 100644
--- a/sc/source/ui/unoobj/cellsuno.cxx
+++ b/sc/source/ui/unoobj/cellsuno.cxx
@@ -904,7 +904,7 @@ static void lcl_CopyProperties( beans::XPropertySet& rDest, beans::XPropertySet&
uno::Reference<beans::XPropertySetInfo> xInfo(rSource.getPropertySetInfo());
if (xInfo.is())
{
- uno::Sequence<beans::Property> aSeq(xInfo->getProperties());
+ const uno::Sequence<beans::Property> aSeq(xInfo->getProperties());
for (const beans::Property& rProp : aSeq)
{
OUString aName(rProp.Name);
@@ -1112,9 +1112,8 @@ static bool lcl_PutDataArray( ScDocShell& rDocShell, const ScRange& rRange,
long nCols = 0;
long nRows = aData.getLength();
- const uno::Sequence<uno::Any>* pArray = aData.getConstArray();
if ( nRows )
- nCols = pArray[0].getLength();
+ nCols = aData[0].getLength();
if ( nCols != nEndCol-nStartCol+1 || nRows != nEndRow-nStartRow+1 )
{
@@ -1248,9 +1247,8 @@ static bool lcl_PutFormulaArray( ScDocShell& rDocShell, const ScRange& rRange,
long nCols = 0;
long nRows = aData.getLength();
- const uno::Sequence<OUString>* pArray = aData.getConstArray();
if ( nRows )
- nCols = pArray[0].getLength();
+ nCols = aData[0].getLength();
if ( nCols != nEndCol-nStartCol+1 || nRows != nEndRow-nStartRow+1 )
{
diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx
index 797784786db0..f0a94b4f75a5 100644
--- a/sc/source/ui/unoobj/chart2uno.cxx
+++ b/sc/source/ui/unoobj/chart2uno.cxx
@@ -1746,7 +1746,7 @@ uno::Sequence< beans::PropertyValue > SAL_CALL ScChart2DataProvider::detectArgum
sal_Int32 nDataInCols = 0;
bool bRowSourceAmbiguous = false;
- Sequence< uno::Reference< chart2::data::XLabeledDataSequence > > aSequences( xDataSource->getDataSequences());
+ const Sequence< uno::Reference< chart2::data::XLabeledDataSequence > > aSequences( xDataSource->getDataSequences());
const sal_Int32 nCount( aSequences.getLength());
RangeAnalyzer aPrevLabel,aPrevValues;
for( const uno::Reference< chart2::data::XLabeledDataSequence >& xLS : aSequences )
diff --git a/sc/source/ui/unoobj/chartuno.cxx b/sc/source/ui/unoobj/chartuno.cxx
index 9818888a7197..01bff2042eb8 100644
--- a/sc/source/ui/unoobj/chartuno.cxx
+++ b/sc/source/ui/unoobj/chartuno.cxx
@@ -446,7 +446,7 @@ void ScChartObj::GetData_Impl( ScRangeListRef& rRanges, bool& rColHeaders, bool&
uno::Reference< chart2::data::XDataProvider > xProvider = xChartDoc->getDataProvider();
if( xReceiver.is() && xProvider.is() )
{
- uno::Sequence< beans::PropertyValue > aArgs( xProvider->detectArguments( xReceiver->getUsedData() ) );
+ const uno::Sequence< beans::PropertyValue > aArgs( xProvider->detectArguments( xReceiver->getUsedData() ) );
OUString aRanges;
chart::ChartDataRowSource eDataRowSource = chart::ChartDataRowSource_COLUMNS;
diff --git a/sc/source/ui/unoobj/condformatuno.cxx b/sc/source/ui/unoobj/condformatuno.cxx
index 747b31402778..813ad3515d43 100644
--- a/sc/source/ui/unoobj/condformatuno.cxx
+++ b/sc/source/ui/unoobj/condformatuno.cxx
@@ -340,7 +340,7 @@ sal_Int32 ScCondFormatsObj::createByRange(const uno::Reference< sheet::XSheetCel
if (!xRanges.is())
throw lang::IllegalArgumentException();
- uno::Sequence<table::CellRangeAddress> aRanges =
+ const uno::Sequence<table::CellRangeAddress> aRanges =
xRanges->getRangeAddresses();
ScRangeList aCoreRange;
@@ -576,7 +576,7 @@ void SAL_CALL ScCondFormatObj::setPropertyValue(
if (aValue >>= xRange)
{
ScConditionalFormat* pFormat = getCoreObject();
- uno::Sequence<table::CellRangeAddress> aRanges =
+ const uno::Sequence<table::CellRangeAddress> aRanges =
xRange->getRangeAddresses();
ScRangeList aTargetRange;
for (const auto& rRange : aRanges)
diff --git a/sc/source/ui/unoobj/cursuno.cxx b/sc/source/ui/unoobj/cursuno.cxx
index 196fef8c1c88..e5aef385d361 100644
--- a/sc/source/ui/unoobj/cursuno.cxx
+++ b/sc/source/ui/unoobj/cursuno.cxx
@@ -440,7 +440,7 @@ sal_Bool SAL_CALL ScCellCursorObj::supportsService( const OUString& rServiceName
uno::Sequence<OUString> SAL_CALL ScCellCursorObj::getSupportedServiceNames()
{
// get all service names from cell range
- uno::Sequence<OUString> aParentSeq(ScCellRangeObj::getSupportedServiceNames());
+ const uno::Sequence<OUString> aParentSeq(ScCellRangeObj::getSupportedServiceNames());
sal_Int32 nParentLen = aParentSeq.getLength();
// SheetCellCursor should be first (?)
@@ -450,7 +450,7 @@ uno::Sequence<OUString> SAL_CALL ScCellCursorObj::getSupportedServiceNames()
pTotalArr[1] = SCCELLCURSOR_SERVICE;
// append cell range services
- std::copy_n(aParentSeq.begin(), nParentLen, std::next(aTotalSeq.begin(), 2));
+ std::copy_n(aParentSeq.begin(), nParentLen, std::next(pTotalArr, 2));
return aTotalSeq;
}
diff --git a/sc/source/ui/unoobj/dapiuno.cxx b/sc/source/ui/unoobj/dapiuno.cxx
index 8228df10868c..3a3f51600f06 100644
--- a/sc/source/ui/unoobj/dapiuno.cxx
+++ b/sc/source/ui/unoobj/dapiuno.cxx
@@ -1905,7 +1905,7 @@ Any SAL_CALL ScDataPilotFieldObj::getPropertyValue( const OUString& aPropertyNam
aRet <<= getFunction();
else if ( aPropertyName == SC_UNONAME_SUBTOTALS )
{
- uno::Sequence<sal_Int16> aSeq = getSubtotals();
+ const uno::Sequence<sal_Int16> aSeq = getSubtotals();
uno::Sequence<sheet::GeneralFunction> aNewSeq;
aNewSeq.realloc(aSeq.getLength());
std::transform(aSeq.begin(), aSeq.end(), aNewSeq.begin(),
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index 7148fce0b323..30067f6ada2d 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -1538,7 +1538,7 @@ bool ScModelObj::FillRenderMarkData( const uno::Any& aSelection,
uno::Reference<sheet::XSelectedSheetsSupplier> xSelectedSheets(xView, uno::UNO_QUERY);
if (bSelectedSheetsOnly && xSelectedSheets.is())
{
- uno::Sequence<sal_Int32> aSelected = xSelectedSheets->getSelectedSheets();
+ const uno::Sequence<sal_Int32> aSelected = xSelectedSheets->getSelectedSheets();
ScMarkData::MarkedTabsType aSelectedTabs;
SCTAB nMaxTab = pDocShell->GetDocument().GetTableCount() -1;
for (const auto& rSelected : aSelected)
diff --git a/sc/source/ui/vba/vbachartobjects.cxx b/sc/source/ui/vba/vbachartobjects.cxx
index 148fe7b94bce..f817dd8fbb90 100644
--- a/sc/source/ui/vba/vbachartobjects.cxx
+++ b/sc/source/ui/vba/vbachartobjects.cxx
@@ -107,11 +107,11 @@ ScVbaChartObjects::getChartObjectNames()
uno::Reference< sheet::XSpreadsheets > xSpreadsheets = xSpreadsheetDocument->getSheets();
std::vector< OUString > aChartNamesVector;
- uno::Sequence< OUString > sSheetNames = xSpreadsheets->getElementNames();
+ const uno::Sequence< OUString > sSheetNames = xSpreadsheets->getElementNames();
for (const auto& rSheetName : sSheetNames)
{
uno::Reference< table::XTableChartsSupplier > xLocTableChartsSupplier( xSpreadsheets->getByName(rSheetName), uno::UNO_QUERY_THROW );
- uno::Sequence< OUString > scurchartnames = xLocTableChartsSupplier->getCharts()->getElementNames();
+ const uno::Sequence< OUString > scurchartnames = xLocTableChartsSupplier->getCharts()->getElementNames();
std::copy(scurchartnames.begin(), scurchartnames.end(), std::back_inserter(aChartNamesVector));
}
sChartNames = comphelper::containerToSequence( aChartNamesVector );
@@ -150,7 +150,7 @@ ScVbaChartObjects::Add( double _nX, double _nY, double _nWidth, double _nHeight
}
void SAL_CALL ScVbaChartObjects::Delete( )
{
- uno::Sequence< OUString > sChartNames = xTableCharts->getElementNames();
+ const uno::Sequence< OUString > sChartNames = xTableCharts->getElementNames();
for (const auto& rChartName : sChartNames)
removeByName(rChartName);
}
diff --git a/sc/source/ui/vba/vbapagebreaks.cxx b/sc/source/ui/vba/vbapagebreaks.cxx
index 5372c32a5079..89c871edd3a8 100644
--- a/sc/source/ui/vba/vbapagebreaks.cxx
+++ b/sc/source/ui/vba/vbapagebreaks.cxx
@@ -113,7 +113,7 @@ sal_Int32 SAL_CALL RangePageBreaks::getCount( )
uno::Reference< excel::XRange > xRange = xWorksheet->getUsedRange();
sal_Int32 nUsedStart = getAPIStartofRange( xRange );
sal_Int32 nUsedEnd = getAPIEndIndexofRange( xRange, nUsedStart );
- uno::Sequence<sheet::TablePageBreakData> aTablePageBreakData = getAllPageBreaks();
+ const uno::Sequence<sheet::TablePageBreakData> aTablePageBreakData = getAllPageBreaks();
auto pPageBreak = std::find_if(aTablePageBreakData.begin(), aTablePageBreakData.end(),
[nUsedEnd](const sheet::TablePageBreakData& rPageBreak) { return rPageBreak.Position > nUsedEnd + 1; });
@@ -147,7 +147,7 @@ sheet::TablePageBreakData RangePageBreaks::getTablePageBreakData( sal_Int32 nAPI
uno::Reference< excel::XRange > xRange = xWorksheet->getUsedRange();
sal_Int32 nUsedStart = getAPIStartofRange( xRange );
sal_Int32 nUsedEnd = getAPIEndIndexofRange( xRange, nUsedStart );
- uno::Sequence<sheet::TablePageBreakData> aTablePageBreakDataList = getAllPageBreaks();
+ const uno::Sequence<sheet::TablePageBreakData> aTablePageBreakDataList = getAllPageBreaks();
for( const auto& rTablePageBreakData : aTablePageBreakDataList )
{
diff --git a/sc/source/ui/vba/vbapagesetup.cxx b/sc/source/ui/vba/vbapagesetup.cxx
index f7a4ac9e6585..f06dbbe701b9 100644
--- a/sc/source/ui/vba/vbapagesetup.cxx
+++ b/sc/source/ui/vba/vbapagesetup.cxx
@@ -66,7 +66,7 @@ OUString SAL_CALL ScVbaPageSetup::getPrintArea()
{
OUString aPrintArea;
uno::Reference< sheet::XPrintAreas > xPrintAreas( mxSheet, uno::UNO_QUERY_THROW );
- uno::Sequence< table::CellRangeAddress > aSeq = xPrintAreas->getPrintAreas();
+ const uno::Sequence< table::CellRangeAddress > aSeq = xPrintAreas->getPrintAreas();
if( aSeq.hasElements() )
{
ScAddress::Details aDetails( formula::FormulaGrammar::CONV_XL_A1, 0, 0 );
diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx
index 4776e6750048..ae253133be66 100644
--- a/sc/source/ui/vba/vbarange.cxx
+++ b/sc/source/ui/vba/vbarange.cxx
@@ -204,7 +204,7 @@ static uno::Any lcl_makeRange( const uno::Reference< XHelperInterface >& rParent
static uno::Reference< excel::XRange > lcl_makeXRangeFromSheetCellRanges( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< sheet::XSheetCellRanges >& xLocSheetCellRanges, ScDocShell* pDoc )
{
uno::Reference< excel::XRange > xRange;
- uno::Sequence< table::CellRangeAddress > sAddresses = xLocSheetCellRanges->getRangeAddresses();
+ const uno::Sequence< table::CellRangeAddress > sAddresses = xLocSheetCellRanges->getRangeAddresses();
ScRangeList aCellRanges;
if ( sAddresses.hasElements() )
{
@@ -2286,7 +2286,7 @@ ScVbaRange::Activate()
if ( xRanges.is() )
{
- uno::Sequence< table::CellRangeAddress > nAddrs = xRanges->getRangeAddresses();
+ const uno::Sequence< table::CellRangeAddress > nAddrs = xRanges->getRangeAddresses();
for ( const auto& rAddr : nAddrs )
{
if ( cellInRange( rAddr, thisRangeAddress.StartColumn, thisRangeAddress.StartRow ) )
@@ -4076,7 +4076,7 @@ static uno::Reference< sheet::XCellRangeReferrer > getNamedRange( const uno::Ref
uno::Reference< beans::XPropertySet > xProps( xIf, uno::UNO_QUERY_THROW );
uno::Reference< container::XNameAccess > xNameAccess( xProps->getPropertyValue( "NamedRanges" ), uno::UNO_QUERY_THROW );
- uno::Sequence< OUString > sNames = xNameAccess->getElementNames();
+ const uno::Sequence< OUString > sNames = xNameAccess->getElementNames();
// uno::Reference< table::XCellRange > thisRange( getCellRange(), uno::UNO_QUERY_THROW );
uno::Reference< sheet::XCellRangeReferrer > xNamedRange;
for ( const auto& rName : sNames )
diff --git a/sc/source/ui/vba/vbasheetobject.cxx b/sc/source/ui/vba/vbasheetobject.cxx
index bf88b991f05d..2df219af7874 100644
--- a/sc/source/ui/vba/vbasheetobject.cxx
+++ b/sc/source/ui/vba/vbasheetobject.cxx
@@ -318,7 +318,7 @@ OUString SAL_CALL ScVbaControlObjectBase::getOnAction()
{
uno::Reference< script::XEventAttacherManager > xEventMgr( mxFormIC, uno::UNO_QUERY_THROW );
sal_Int32 nIndex = getModelIndexInForm();
- uno::Sequence< script::ScriptEventDescriptor > aEvents = xEventMgr->getScriptEvents( nIndex );
+ const uno::Sequence< script::ScriptEventDescriptor > aEvents = xEventMgr->getScriptEvents( nIndex );
if( aEvents.hasElements() )
{
const OUString aScriptType = "Script";
diff --git a/sc/source/ui/view/drawvie4.cxx b/sc/source/ui/view/drawvie4.cxx
index 2af1ee854489..e1f0d04da7a4 100644
--- a/sc/source/ui/view/drawvie4.cxx
+++ b/sc/source/ui/view/drawvie4.cxx
@@ -105,7 +105,7 @@ namespace {
void getRangeFromDataSource( uno::Reference< chart2::data::XDataSource > const & xDataSource, std::vector<OUString>& rRangeRep)
{
- uno::Sequence<uno::Reference<chart2::data::XLabeledDataSequence> > xSeqs = xDataSource->getDataSequences();
+ const uno::Sequence<uno::Reference<chart2::data::XLabeledDataSequence> > xSeqs = xDataSource->getDataSequences();
for (const uno::Reference<chart2::data::XLabeledDataSequence>& xLS : xSeqs)
{
uno::Reference<chart2::data::XDataSequence> xSeq = xLS->getValues();
@@ -133,21 +133,21 @@ void getRangeFromErrorBar(const uno::Reference< chart2::XChartDocument >& rChart
if(!xCooSysContainer.is())
return;
- uno::Sequence< uno::Reference< chart2::XCoordinateSystem > > xCooSysSequence( xCooSysContainer->getCoordinateSystems());
+ const uno::Sequence< uno::Reference< chart2::XCoordinateSystem > > xCooSysSequence( xCooSysContainer->getCoordinateSystems());
for(const auto& rCooSys : xCooSysSequence)
{
uno::Reference< chart2::XChartTypeContainer > xChartTypeContainer( rCooSys, uno::UNO_QUERY);
if(!xChartTypeContainer.is())
continue;
- uno::Sequence< uno::Reference< chart2::XChartType > > xChartTypeSequence( xChartTypeContainer->getChartTypes() );
+ const uno::Sequence< uno::Reference< chart2::XChartType > > xChartTypeSequence( xChartTypeContainer->getChartTypes() );
for(const auto& rChartType : xChartTypeSequence)
{
uno::Reference< chart2::XDataSeriesContainer > xDataSequenceContainer( rChartType, uno::UNO_QUERY);
if(!xDataSequenceContainer.is())
continue;
- uno::Sequence< uno::Reference< chart2::XDataSeries > > xSeriesSequence( xDataSequenceContainer->getDataSeries() );
+ const uno::Sequence< uno::Reference< chart2::XDataSeries > > xSeriesSequence( xDataSequenceContainer->getDataSeries() );
for(const uno::Reference<chart2::XDataSeries>& xSeries : xSeriesSequence)
{
uno::Reference< beans::XPropertySet > xPropSet( xSeries, uno::UNO_QUERY);
diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx
index 4bc2f0947a84..a87dc2dd3ed8 100644
--- a/sc/source/ui/view/viewdata.cxx
+++ b/sc/source/ui/view/viewdata.cxx
@@ -3312,7 +3312,7 @@ void ScViewData::ReadUserDataSequence(const uno::Sequence <beans::PropertyValue>
uno::Reference<container::XNameContainer> xNameContainer;
if ((rSetting.Value >>= xNameContainer) && xNameContainer->hasElements())
{
- uno::Sequence< OUString > aNames(xNameContainer->getElementNames());
+ const uno::Sequence< OUString > aNames(xNameContainer->getElementNames());
for (const OUString& sTabName : aNames)
{
SCTAB nTab(0);