include/xmloff/xmlevent.hxx | 2 +- ucb/source/core/FileAccess.cxx | 4 ++-- ucb/source/core/ucb.cxx | 2 +- ucb/source/core/ucbstore.cxx | 2 +- ucb/source/ucp/cmis/cmis_content.cxx | 2 +- ucb/source/ucp/ext/ucpext_datasupplier.cxx | 2 +- ucb/source/ucp/file/bc.cxx | 2 +- ucb/source/ucp/file/filnot.cxx | 6 +++--- ucb/source/ucp/file/filtask.cxx | 8 ++++---- ucb/source/ucp/webdav-neon/DAVResourceAccess.cxx | 2 +- ucb/source/ucp/webdav-neon/webdavcontent.cxx | 2 +- ucbhelper/source/provider/propertyvalueset.cxx | 4 ++-- ucbhelper/source/provider/providerhelper.cxx | 8 ++++---- unotools/source/config/compatibility.cxx | 4 ++-- unotools/source/config/configitem.cxx | 4 ++-- unotools/source/config/eventcfg.cxx | 4 ++-- unotools/source/config/fontcfg.cxx | 6 +++--- unotools/source/config/historyoptions.cxx | 4 ++-- unotools/source/config/lingucfg.cxx | 2 +- unotools/source/config/optionsdlg.cxx | 4 ++-- unotools/source/config/pathoptions.cxx | 2 +- unotools/source/config/securityoptions.cxx | 2 +- unotools/source/i18n/localedatawrapper.cxx | 2 +- unotools/source/misc/ServiceDocumenter.cxx | 6 ++++-- unotools/source/ucbhelper/progresshandlerwrap.cxx | 2 +- unotools/source/ucbhelper/ucbhelper.cxx | 2 +- unotools/source/ucbhelper/ucblockbytes.cxx | 2 +- xmloff/inc/XMLScriptExportHandler.hxx | 2 +- xmloff/inc/XMLStarBasicExportHandler.hxx | 2 +- xmloff/source/chart/SchXMLChartContext.cxx | 2 +- xmloff/source/chart/SchXMLExport.cxx | 16 ++++++++-------- xmloff/source/chart/SchXMLImport.cxx | 4 ++-- xmloff/source/chart/SchXMLSeries2Context.cxx | 2 +- xmloff/source/chart/SchXMLSeriesHelper.cxx | 8 ++++---- xmloff/source/chart/SchXMLTableContext.cxx | 10 +++++----- xmloff/source/chart/SchXMLTools.cxx | 2 +- xmloff/source/core/SettingsExportHelper.cxx | 4 ++-- xmloff/source/core/xmlexp.cxx | 14 +++++++------- xmloff/source/core/xmlictxt.cxx | 2 +- xmloff/source/core/xmlimp.cxx | 3 ++- xmloff/source/core/xmluconv.cxx | 2 +- xmloff/source/draw/XMLImageMapExport.cxx | 2 +- xmloff/source/draw/animationexport.cxx | 8 ++++---- xmloff/source/draw/sdxmlexp.cxx | 2 +- xmloff/source/draw/shapeexport.cxx | 18 +++++++++--------- xmloff/source/draw/ximpshap.cxx | 2 +- xmloff/source/forms/elementexport.cxx | 4 ++-- xmloff/source/forms/propertyexport.cxx | 2 +- xmloff/source/script/XMLEventExport.cxx | 2 +- xmloff/source/script/XMLScriptExportHandler.cxx | 2 +- xmloff/source/script/XMLStarBasicExportHandler.cxx | 2 +- xmloff/source/style/AttributeContainerHandler.cxx | 2 +- xmloff/source/style/XMLFontAutoStylePool.cxx | 6 ++++-- xmloff/source/style/XMLPageExport.cxx | 2 +- xmloff/source/style/styleexp.cxx | 2 +- xmloff/source/style/xmlexppr.cxx | 4 ++-- xmloff/source/style/xmlimppr.cxx | 2 +- xmloff/source/style/xmltabe.cxx | 2 +- xmloff/source/text/XMLRedlineExport.cxx | 2 +- xmloff/source/text/XMLSectionExport.cxx | 4 ++-- xmloff/source/text/XMLSectionExport.hxx | 2 +- xmloff/source/text/XMLTextColumnsExport.cxx | 2 +- xmloff/source/text/txtflde.cxx | 4 ++-- xmloff/source/text/txtfldi.cxx | 2 +- xmloff/source/text/txtparae.cxx | 4 ++-- xmloff/source/xforms/xformsapi.cxx | 2 +- xmloff/source/xforms/xformsexport.cxx | 6 +++--- xmloff/source/xforms/xformsimport.cxx | 4 ++-- 68 files changed, 133 insertions(+), 128 deletions(-)
New commits: commit 50679d449fa71bebdc3cba1d30c6c81ac846990c Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Thu Aug 15 20:26:46 2019 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Fri Aug 16 08:11:34 2019 +0200 loplugin:sequenceloop in xmloff Change-Id: I1fde11da5f6e97255a9140f11c298d6d525f7230 Reviewed-on: https://gerrit.libreoffice.org/77543 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/include/xmloff/xmlevent.hxx b/include/xmloff/xmlevent.hxx index d300c8d06679..b0fa87403f62 100644 --- a/include/xmloff/xmlevent.hxx +++ b/include/xmloff/xmlevent.hxx @@ -98,7 +98,7 @@ public: virtual void Export( SvXMLExport& rExport, /// the current XML export const OUString& rEventQName, /// the XML name of the event - css::uno::Sequence<css::beans::PropertyValue> & rValues, /// the values for the event + const css::uno::Sequence<css::beans::PropertyValue> & rValues, /// the values for the event bool bUseWhitespace) = 0; /// create whitespace around elements? }; diff --git a/xmloff/inc/XMLScriptExportHandler.hxx b/xmloff/inc/XMLScriptExportHandler.hxx index e232376fe752..1708d7a1ba3d 100644 --- a/xmloff/inc/XMLScriptExportHandler.hxx +++ b/xmloff/inc/XMLScriptExportHandler.hxx @@ -40,7 +40,7 @@ public: virtual void Export( SvXMLExport& rExport, const OUString& rEventName, - css::uno::Sequence<css::beans::PropertyValue> & rValues, + const css::uno::Sequence<css::beans::PropertyValue> & rValues, bool bUseWhitespace) override; }; diff --git a/xmloff/inc/XMLStarBasicExportHandler.hxx b/xmloff/inc/XMLStarBasicExportHandler.hxx index de909e0d24eb..878d748680f9 100644 --- a/xmloff/inc/XMLStarBasicExportHandler.hxx +++ b/xmloff/inc/XMLStarBasicExportHandler.hxx @@ -40,7 +40,7 @@ public: virtual void Export( SvXMLExport& rExport, const OUString& rEventName, - css::uno::Sequence<css::beans::PropertyValue> & rValues, + const css::uno::Sequence<css::beans::PropertyValue> & rValues, bool bUseWhitespace) override; }; diff --git a/xmloff/source/chart/SchXMLChartContext.cxx b/xmloff/source/chart/SchXMLChartContext.cxx index 5d38b50b1dce..1b0d52ef4bc8 100644 --- a/xmloff/source/chart/SchXMLChartContext.cxx +++ b/xmloff/source/chart/SchXMLChartContext.cxx @@ -962,7 +962,7 @@ void SchXMLChartContext::MergeSeriesForStockChart() bool bHasJapaneseCandlestick = true; uno::Reference< chart2::XDataSeriesContainer > xDSContainer; uno::Reference< chart2::XCoordinateSystemContainer > xCooSysCnt( xDiagram, uno::UNO_QUERY_THROW ); - uno::Sequence< uno::Reference< chart2::XCoordinateSystem > > aCooSysSeq( xCooSysCnt->getCoordinateSystems()); + const uno::Sequence< uno::Reference< chart2::XCoordinateSystem > > aCooSysSeq( xCooSysCnt->getCoordinateSystems()); for( const auto& rCooSys : aCooSysSeq ) { uno::Reference< chart2::XChartTypeContainer > xCTCnt( rCooSys, uno::UNO_QUERY_THROW ); diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx index 90e0adcb1f1e..2157955521ce 100644 --- a/xmloff/source/chart/SchXMLExport.cxx +++ b/xmloff/source/chart/SchXMLExport.cxx @@ -212,7 +212,7 @@ public: void exportPropertyMapping( const css::uno::Reference< css::chart2::data::XDataSource > & xSource, - Sequence< OUString >& rSupportedMappings ); + const Sequence< OUString >& rSupportedMappings ); void exportCandleStickSeries( const css::uno::Sequence< @@ -319,7 +319,7 @@ Reference< chart2::data::XLabeledDataSequence > lcl_getCategories( const Referen { Reference< chart2::XCoordinateSystemContainer > xCooSysCnt( xDiagram, uno::UNO_QUERY_THROW ); - Sequence< Reference< chart2::XCoordinateSystem > > aCooSysSeq( + const Sequence< Reference< chart2::XCoordinateSystem > > aCooSysSeq( xCooSysCnt->getCoordinateSystems()); for( const auto& rCooSys : aCooSysSeq ) { @@ -881,7 +881,7 @@ void lcl_exportNumberFormat( const OUString& rPropertyName, const Reference< bea if( !xErrorBarDataSource.is()) return aResult; - Sequence< Reference< chart2::data::XLabeledDataSequence > > aSequences( + const Sequence< Reference< chart2::data::XLabeledDataSequence > > aSequences( xErrorBarDataSource->getDataSequences()); for( const auto& rSequence : aSequences ) { @@ -2487,14 +2487,14 @@ void SchXMLExportHelper_Impl::exportSeries( std::vector< XMLPropertyState > aPropertyStates; - Sequence< Reference< chart2::XCoordinateSystem > > + const Sequence< Reference< chart2::XCoordinateSystem > > aCooSysSeq( xBCooSysCnt->getCoordinateSystems()); for( const auto& rCooSys : aCooSysSeq ) { Reference< chart2::XChartTypeContainer > xCTCnt( rCooSys, uno::UNO_QUERY ); if( ! xCTCnt.is()) continue; - Sequence< Reference< chart2::XChartType > > aCTSeq( xCTCnt->getChartTypes()); + const Sequence< Reference< chart2::XChartType > > aCTSeq( xCTCnt->getChartTypes()); for( const auto& rChartType : aCTSeq ) { Reference< chart2::XDataSeriesContainer > xDSCnt( rChartType, uno::UNO_QUERY ); @@ -2812,7 +2812,7 @@ void SchXMLExportHelper_Impl::exportSeries( } void SchXMLExportHelper_Impl::exportPropertyMapping( - const Reference< chart2::data::XDataSource > & xSource, Sequence< OUString >& rSupportedMappings ) + const Reference< chart2::data::XDataSource > & xSource, const Sequence< OUString >& rSupportedMappings ) { Reference< chart2::XChartDocument > xNewDoc( mrExport.GetModel(), uno::UNO_QUERY ); Sequence< Reference< chart2::data::XLabeledDataSequence > > aSeqCnt( @@ -2851,7 +2851,7 @@ void SchXMLExportHelper_Impl::exportRegressionCurve( Reference< chart2::XRegressionCurveContainer > xRegressionCurveContainer( xSeries, uno::UNO_QUERY ); if( xRegressionCurveContainer.is() ) { - Sequence< Reference< chart2::XRegressionCurve > > aRegCurveSeq = xRegressionCurveContainer->getRegressionCurves(); + const Sequence< Reference< chart2::XRegressionCurve > > aRegCurveSeq = xRegressionCurveContainer->getRegressionCurves(); for( const auto& xRegCurve : aRegCurveSeq ) { @@ -3593,7 +3593,7 @@ void SchXMLExportHelper_Impl::InitRangeSegmentationProperties( const Reference< if( xDataProvider.is()) { Reference< chart2::data::XDataSource > xDataSource( lcl_pressUsedDataIntoRectangularFormat( xChartDoc, mbHasCategoryLabels )); - Sequence< beans::PropertyValue > aArgs( xDataProvider->detectArguments( xDataSource )); + const Sequence< beans::PropertyValue > aArgs( xDataProvider->detectArguments( xDataSource )); OUString sCellRange, sBrokenRange; bool bBrokenRangeAvailable = false; for( const auto& rArg : aArgs ) diff --git a/xmloff/source/chart/SchXMLImport.cxx b/xmloff/source/chart/SchXMLImport.cxx index 5f4c92f3501a..52e24fdf56d3 100644 --- a/xmloff/source/chart/SchXMLImport.cxx +++ b/xmloff/source/chart/SchXMLImport.cxx @@ -379,13 +379,13 @@ void SchXMLImportHelper::DeleteDataSeries( { Reference< chart2::XCoordinateSystemContainer > xCooSysCnt( xDoc->getFirstDiagram(), uno::UNO_QUERY_THROW ); - Sequence< Reference< chart2::XCoordinateSystem > > aCooSysSeq( + const Sequence< Reference< chart2::XCoordinateSystem > > aCooSysSeq( xCooSysCnt->getCoordinateSystems()); for( const auto& rCooSys : aCooSysSeq ) { Reference< chart2::XChartTypeContainer > xCTCnt( rCooSys, uno::UNO_QUERY_THROW ); - Sequence< Reference< chart2::XChartType > > aChartTypes( xCTCnt->getChartTypes()); + const Sequence< Reference< chart2::XChartType > > aChartTypes( xCTCnt->getChartTypes()); for( const auto& rChartType : aChartTypes ) { diff --git a/xmloff/source/chart/SchXMLSeries2Context.cxx b/xmloff/source/chart/SchXMLSeries2Context.cxx index 9b2af97f4c33..51d49b12067a 100644 --- a/xmloff/source/chart/SchXMLSeries2Context.cxx +++ b/xmloff/source/chart/SchXMLSeries2Context.cxx @@ -183,7 +183,7 @@ void lcl_insertErrorBarLSequencesToMap( if( ( xSeriesProp->getPropertyValue( "ErrorBarY" ) >>= xErrorBarSource ) && xErrorBarSource.is() ) { - Sequence< Reference< chart2::data::XLabeledDataSequence > > aLSequences( + const Sequence< Reference< chart2::data::XLabeledDataSequence > > aLSequences( xErrorBarSource->getDataSequences()); for( const auto& rLSequence : aLSequences ) { diff --git a/xmloff/source/chart/SchXMLSeriesHelper.cxx b/xmloff/source/chart/SchXMLSeriesHelper.cxx index b206d10df4d8..e8a44512515f 100644 --- a/xmloff/source/chart/SchXMLSeriesHelper.cxx +++ b/xmloff/source/chart/SchXMLSeriesHelper.cxx @@ -46,12 +46,12 @@ using ::com::sun::star::uno::Sequence; { Reference< chart2::XCoordinateSystemContainer > xCooSysCnt( xDiagram, uno::UNO_QUERY_THROW ); - Sequence< Reference< chart2::XCoordinateSystem > > aCooSysSeq( + const Sequence< Reference< chart2::XCoordinateSystem > > aCooSysSeq( xCooSysCnt->getCoordinateSystems()); for( const auto& rCooSys : aCooSysSeq ) { Reference< chart2::XChartTypeContainer > xCTCnt( rCooSys, uno::UNO_QUERY_THROW ); - Sequence< Reference< chart2::XChartType > > aChartTypeSeq( xCTCnt->getChartTypes()); + const Sequence< Reference< chart2::XChartType > > aChartTypeSeq( xCTCnt->getChartTypes()); for( const auto& rChartType : aChartTypeSeq ) { Reference< chart2::XDataSeriesContainer > xDSCnt( rChartType, uno::UNO_QUERY_THROW ); @@ -105,7 +105,7 @@ uno::Reference< chart2::XChartType > lcl_getChartTypeOfSeries( if( !xCooSysContainer.is()) return nullptr; - uno::Sequence< uno::Reference< chart2::XCoordinateSystem > > aCooSysList( xCooSysContainer->getCoordinateSystems() ); + const uno::Sequence< uno::Reference< chart2::XCoordinateSystem > > aCooSysList( xCooSysContainer->getCoordinateSystems() ); for( const auto& xCooSys : aCooSysList ) { //iterate through all chart types in the current coordinate system @@ -113,7 +113,7 @@ uno::Reference< chart2::XChartType > lcl_getChartTypeOfSeries( SAL_WARN_IF( !xChartTypeContainer.is(), "xmloff.chart", "xChartTypeContainer is NULL"); if( !xChartTypeContainer.is() ) continue; - uno::Sequence< uno::Reference< chart2::XChartType > > aChartTypeList( xChartTypeContainer->getChartTypes() ); + const uno::Sequence< uno::Reference< chart2::XChartType > > aChartTypeList( xChartTypeContainer->getChartTypes() ); for( const auto& xChartType : aChartTypeList ) { //iterate through all series in this chart type diff --git a/xmloff/source/chart/SchXMLTableContext.cxx b/xmloff/source/chart/SchXMLTableContext.cxx index 439f3f24c95c..b05b8f3bfd3f 100644 --- a/xmloff/source/chart/SchXMLTableContext.cxx +++ b/xmloff/source/chart/SchXMLTableContext.cxx @@ -950,17 +950,17 @@ void SchXMLTableHelper::switchRangesFromOuterToInternalIfNecessary( try { Reference< chart2::XCoordinateSystemContainer > xCooSysCnt( xChartDoc->getFirstDiagram(), uno::UNO_QUERY_THROW ); - Sequence< Reference< chart2::XCoordinateSystem > > aCooSysSeq( xCooSysCnt->getCoordinateSystems() ); + const Sequence< Reference< chart2::XCoordinateSystem > > aCooSysSeq( xCooSysCnt->getCoordinateSystems() ); for( const auto& rCooSys : aCooSysSeq ) { Reference< chart2::XChartTypeContainer > xCooSysContainer( rCooSys, uno::UNO_QUERY_THROW ); - Sequence< Reference< chart2::XChartType > > aChartTypeSeq( xCooSysContainer->getChartTypes()); + const Sequence< Reference< chart2::XChartType > > aChartTypeSeq( xCooSysContainer->getChartTypes()); for( const auto& rChartType : aChartTypeSeq ) { Reference< chart2::XDataSeriesContainer > xSeriesContainer( rChartType, uno::UNO_QUERY ); if(!xSeriesContainer.is()) continue; - Sequence< Reference< chart2::XDataSeries > > aSeriesSeq( xSeriesContainer->getDataSeries() ); + const Sequence< Reference< chart2::XDataSeries > > aSeriesSeq( xSeriesContainer->getDataSeries() ); std::vector< Reference< chart2::XDataSeries > > aRemainingSeries; for( const auto& rSeries : aSeriesSeq ) @@ -970,7 +970,7 @@ void SchXMLTableHelper::switchRangesFromOuterToInternalIfNecessary( { bool bHasUnhiddenColumns = false; OUString aRange; - uno::Sequence< Reference< chart2::data::XLabeledDataSequence > > aSequences( xDataSource->getDataSequences() ); + const uno::Sequence< Reference< chart2::data::XLabeledDataSequence > > aSequences( xDataSource->getDataSequences() ); for( const auto& xLabeledSequence : aSequences ) { if(!xLabeledSequence.is()) @@ -1011,7 +1011,7 @@ void SchXMLTableHelper::switchRangesFromOuterToInternalIfNecessary( //first detect which columns are really used std::map< sal_Int32, bool > aUsageMap; OUString aRange; - Sequence< Reference< chart2::data::XLabeledDataSequence > > aUsedSequences( xDataSource->getDataSequences() ); + const Sequence< Reference< chart2::data::XLabeledDataSequence > > aUsedSequences( xDataSource->getDataSequences() ); for( const auto& xLabeledSequence : aUsedSequences ) { if(!xLabeledSequence.is()) diff --git a/xmloff/source/chart/SchXMLTools.cxx b/xmloff/source/chart/SchXMLTools.cxx index 3757dfce8e22..155871ab3ac6 100644 --- a/xmloff/source/chart/SchXMLTools.cxx +++ b/xmloff/source/chart/SchXMLTools.cxx @@ -684,7 +684,7 @@ void copyProperties( { Reference< beans::XPropertySetInfo > xSrcInfo( xSource->getPropertySetInfo(), uno::UNO_SET_THROW ); Reference< beans::XPropertySetInfo > xDestInfo( xDestination->getPropertySetInfo(), uno::UNO_SET_THROW ); - Sequence< beans::Property > aProperties( xSrcInfo->getProperties()); + const Sequence< beans::Property > aProperties( xSrcInfo->getProperties()); for( const auto& rProperty : aProperties ) { OUString aName( rProperty.Name); diff --git a/xmloff/source/core/SettingsExportHelper.cxx b/xmloff/source/core/SettingsExportHelper.cxx index 4defc9d35049..c7128965d6b6 100644 --- a/xmloff/source/core/SettingsExportHelper.cxx +++ b/xmloff/source/core/SettingsExportHelper.cxx @@ -362,7 +362,7 @@ void XMLSettingsExportHelper::exportMapEntry(const uno::Any& rAny, if (bNameAccess) m_rContext.AddAttribute( XML_NAME, rName ); m_rContext.StartElement( XML_CONFIG_ITEM_MAP_ENTRY ); - for (const auto& rProp : aProps) + for (const auto& rProp : std::as_const(aProps)) CallTypeFunction(rProp.Value, rProp.Name); m_rContext.EndElement( true ); } @@ -379,7 +379,7 @@ void XMLSettingsExportHelper::exportNameAccess( { m_rContext.AddAttribute( XML_NAME, rName ); m_rContext.StartElement( XML_CONFIG_ITEM_MAP_NAMED ); - uno::Sequence< OUString > aNames(aNamed->getElementNames()); + const uno::Sequence< OUString > aNames(aNamed->getElementNames()); for (const auto& rElementName : aNames) exportMapEntry(aNamed->getByName(rElementName), rElementName, true); m_rContext.EndElement( true ); diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx index 2ca4a01fd0a3..9abd27bb9b1f 100644 --- a/xmloff/source/core/xmlexp.cxx +++ b/xmloff/source/core/xmlexp.cxx @@ -627,7 +627,7 @@ void SAL_CALL SvXMLExport::setSourceDocument( const uno::Reference< lang::XCompo Reference< XNameAccess > xNamespaceMap( xIfc, UNO_QUERY ); if( xNamespaceMap.is() ) { - Sequence< OUString > aPrefixes( xNamespaceMap->getElementNames() ); + const Sequence< OUString > aPrefixes( xNamespaceMap->getElementNames() ); for( OUString const & prefix : aPrefixes ) { OUString aURL; @@ -1530,7 +1530,7 @@ void SvXMLExport::ExportStyles_( bool ) if( xGradient->hasElements() ) { - uno::Sequence< OUString > aNamesSeq ( xGradient->getElementNames() ); + const uno::Sequence< OUString > aNamesSeq ( xGradient->getElementNames() ); for( const OUString& rStrName : aNamesSeq ) { try @@ -1560,7 +1560,7 @@ void SvXMLExport::ExportStyles_( bool ) if( xHatch->hasElements() ) { - uno::Sequence< OUString > aNamesSeq ( xHatch->getElementNames() ); + const uno::Sequence< OUString > aNamesSeq ( xHatch->getElementNames() ); for( const OUString& rStrName : aNamesSeq ) { try @@ -1587,7 +1587,7 @@ void SvXMLExport::ExportStyles_( bool ) { if( xBitmap->hasElements() ) { - uno::Sequence< OUString > aNamesSeq ( xBitmap->getElementNames() ); + const uno::Sequence< OUString > aNamesSeq ( xBitmap->getElementNames() ); for( const OUString& rStrName : aNamesSeq ) { try @@ -1617,7 +1617,7 @@ void SvXMLExport::ExportStyles_( bool ) if( xTransGradient->hasElements() ) { - uno::Sequence< OUString > aNamesSeq ( xTransGradient->getElementNames() ); + const uno::Sequence< OUString > aNamesSeq ( xTransGradient->getElementNames() ); for( const OUString& rStrName : aNamesSeq ) { try @@ -1647,7 +1647,7 @@ void SvXMLExport::ExportStyles_( bool ) if( xMarker->hasElements() ) { - uno::Sequence< OUString > aNamesSeq ( xMarker->getElementNames() ); + const uno::Sequence< OUString > aNamesSeq ( xMarker->getElementNames() ); for( const OUString& rStrName : aNamesSeq ) { try @@ -1677,7 +1677,7 @@ void SvXMLExport::ExportStyles_( bool ) if( xDashes->hasElements() ) { - uno::Sequence< OUString > aNamesSeq ( xDashes->getElementNames() ); + const uno::Sequence< OUString > aNamesSeq ( xDashes->getElementNames() ); for( const OUString& rStrName : aNamesSeq ) { try diff --git a/xmloff/source/core/xmlictxt.cxx b/xmloff/source/core/xmlictxt.cxx index 1014b0e3e2c6..a448e9fa773c 100644 --- a/xmloff/source/core/xmlictxt.cxx +++ b/xmloff/source/core/xmlictxt.cxx @@ -102,7 +102,7 @@ void SAL_CALL SvXMLImportContext::startUnknownElement(const OUString & /*rNamesp mrImport.maAttrList->AddAttribute( sAttrName, "CDATA", it.toString() ); } - uno::Sequence< xml::Attribute > unknownAttribs = Attribs->getUnknownAttributes(); + const uno::Sequence< xml::Attribute > unknownAttribs = Attribs->getUnknownAttributes(); for ( const auto& rUnknownAttrib : unknownAttribs ) { const OUString& rAttrValue = rUnknownAttrib.Value; diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx index 525b557969dc..a8001b591950 100644 --- a/xmloff/source/core/xmlimp.cxx +++ b/xmloff/source/core/xmlimp.cxx @@ -1626,7 +1626,8 @@ void SvXMLImport::SetAutoStyles( SvXMLStylesContext *pAutoStyles ) if (pAutoStyles && mxNumberStyles.is() && (mnImportFlags & SvXMLImportFlags::CONTENT) ) { uno::Reference<xml::sax::XAttributeList> xAttrList; - for (const auto& name : mxNumberStyles->getElementNames()) + const uno::Sequence<OUString> aStyleNames = mxNumberStyles->getElementNames(); + for (const auto& name : aStyleNames) { uno::Any aAny(mxNumberStyles->getByName(name)); sal_Int32 nKey(0); diff --git a/xmloff/source/core/xmluconv.cxx b/xmloff/source/core/xmluconv.cxx index 7833996fc7e8..dcfae65672f1 100644 --- a/xmloff/source/core/xmluconv.cxx +++ b/xmloff/source/core/xmluconv.cxx @@ -692,7 +692,7 @@ void SvXMLUnitConverter::convertPropertySet(uno::Sequence<beans::PropertyValue>& uno::Reference< beans::XPropertySetInfo > xPropertySetInfo = aProperties->getPropertySetInfo(); if (xPropertySetInfo.is()) { - uno::Sequence< beans::Property > aProps = xPropertySetInfo->getProperties(); + const uno::Sequence< beans::Property > aProps = xPropertySetInfo->getProperties(); if (aProps.hasElements()) { rProps.realloc(aProps.getLength()); diff --git a/xmloff/source/draw/XMLImageMapExport.cxx b/xmloff/source/draw/XMLImageMapExport.cxx index c9daabece5ce..e34f85dd891f 100644 --- a/xmloff/source/draw/XMLImageMapExport.cxx +++ b/xmloff/source/draw/XMLImageMapExport.cxx @@ -134,7 +134,7 @@ void XMLImageMapExport::ExportMapEntry( enum XMLTokenEnum eType = XML_TOKEN_INVALID; // distinguish map entries by their service name - Sequence<OUString> sServiceNames = + const Sequence<OUString> sServiceNames = xServiceInfo->getSupportedServiceNames(); for( const OUString& rName : sServiceNames ) { diff --git a/xmloff/source/draw/animationexport.cxx b/xmloff/source/draw/animationexport.cxx index a55f1e991685..7382888d08f9 100644 --- a/xmloff/source/draw/animationexport.cxx +++ b/xmloff/source/draw/animationexport.cxx @@ -724,7 +724,7 @@ void AnimationsExporterImpl::prepareNode( const Reference< XAnimationNode >& xNo break; } - Sequence< NamedValue > aUserData( xNode->getUserData() ); + const Sequence< NamedValue > aUserData( xNode->getUserData() ); for( const auto& rValue : aUserData ) { if( IsXMLToken( rValue.Name, XML_MASTER_ELEMENT ) ) @@ -875,7 +875,7 @@ void AnimationsExporterImpl::exportNode( const Reference< XAnimationNode >& xNod sal_Int16 nContainerNodeType = EffectNodeType::DEFAULT; OUString aPresetId; - Sequence< NamedValue > aUserData( xNode->getUserData() ); + const Sequence< NamedValue > aUserData( xNode->getUserData() ); for( const auto& rValue : aUserData ) { if( IsXMLToken( rValue.Name, XML_NODE_TYPE ) ) @@ -1161,7 +1161,7 @@ void AnimationsExporterImpl::exportAnimate( const Reference< XAnimate >& xAnimat if(nNodeType != AnimationNodeType::SET) { - Sequence< double > aKeyTimes( xAnimate->getKeyTimes() ); + const Sequence< double > aKeyTimes( xAnimate->getKeyTimes() ); if( aKeyTimes.hasElements() ) { for( const auto& rKeyTime : aKeyTimes ) @@ -1202,7 +1202,7 @@ void AnimationsExporterImpl::exportAnimate( const Reference< XAnimate >& xAnimat } } - Sequence< TimeFilterPair > aTimeFilter( xAnimate->getTimeFilter() ); + const Sequence< TimeFilterPair > aTimeFilter( xAnimate->getTimeFilter() ); if( aTimeFilter.hasElements() ) { for( const auto& rPair : aTimeFilter ) diff --git a/xmloff/source/draw/sdxmlexp.cxx b/xmloff/source/draw/sdxmlexp.cxx index 3b58e8468328..f6d4e938efeb 100644 --- a/xmloff/source/draw/sdxmlexp.cxx +++ b/xmloff/source/draw/sdxmlexp.cxx @@ -1966,7 +1966,7 @@ void SdXMLExport::exportPresentationSettings() OUStringBuffer sTmp; - for( const auto& rShowName : aShowNames ) + for( const auto& rShowName : std::as_const(aShowNames) ) { AddAttribute(XML_NAMESPACE_PRESENTATION, XML_NAME, rShowName ); diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx index 4a818e118ae4..92d8f2358716 100644 --- a/xmloff/source/draw/shapeexport.cxx +++ b/xmloff/source/draw/shapeexport.cxx @@ -1596,7 +1596,7 @@ void XMLShapeExport::ImpExportEvents( const uno::Reference< drawing::XShape >& x uno::Sequence< beans::PropertyValue > aClickProperties; if( xEvents->hasByName( gsOnClick ) && (xEvents->getByName( gsOnClick ) >>= aClickProperties) ) { - for( const auto& rProperty : aClickProperties ) + for( const auto& rProperty : std::as_const(aClickProperties) ) { if( !( nFound & Found::CLICKEVENTTYPE ) && rProperty.Name == gsEventType ) { @@ -3113,7 +3113,7 @@ void XMLShapeExport::ImpExportAppletShape( // export parameters uno::Sequence< beans::PropertyValue > aCommands; xPropSet->getPropertyValue("AppletCommands") >>= aCommands; - for( const auto& rCommand : aCommands ) + for( const auto& rCommand : std::as_const(aCommands) ) { rCommand.Value >>= aStr; mrExport.AddAttribute( XML_NAMESPACE_DRAW, XML_NAME, rCommand.Name ); @@ -3159,7 +3159,7 @@ void XMLShapeExport::ImpExportPluginShape( // export parameters uno::Sequence< beans::PropertyValue > aCommands; xPropSet->getPropertyValue("PluginCommands") >>= aCommands; - for( const auto& rCommand : aCommands ) + for( const auto& rCommand : std::as_const(aCommands) ) { rCommand.Value >>= aStr; mrExport.AddAttribute( XML_NAMESPACE_DRAW, XML_NAME, rCommand.Name ); @@ -4120,7 +4120,7 @@ static void ImpExportEnhancedGeometry( SvXMLExport& rExport, const uno::Referenc bool bCoordinates = false; OUString aCustomShapeType( "non-primitive" ); - for ( const beans::PropertyValue& rGeoProp : aGeoPropSeq ) + for ( const beans::PropertyValue& rGeoProp : std::as_const(aGeoPropSeq) ) { switch( EASGet( rGeoProp.Name ) ) { @@ -4173,7 +4173,7 @@ static void ImpExportEnhancedGeometry( SvXMLExport& rExport, const uno::Referenc uno::Sequence< beans::PropertyValue > aExtrusionPropSeq; if ( rGeoProp.Value >>= aExtrusionPropSeq ) { - for ( const beans::PropertyValue& rProp : aExtrusionPropSeq ) + for ( const beans::PropertyValue& rProp : std::as_const(aExtrusionPropSeq) ) { switch( EASGet( rProp.Name ) ) { @@ -4481,7 +4481,7 @@ static void ImpExportEnhancedGeometry( SvXMLExport& rExport, const uno::Referenc uno::Sequence< beans::PropertyValue > aTextPathPropSeq; if ( rGeoProp.Value >>= aTextPathPropSeq ) { - for ( const beans::PropertyValue& rProp : aTextPathPropSeq ) + for ( const beans::PropertyValue& rProp : std::as_const(aTextPathPropSeq) ) { switch( EASGet( rProp.Name ) ) { @@ -4541,7 +4541,7 @@ static void ImpExportEnhancedGeometry( SvXMLExport& rExport, const uno::Referenc uno::Sequence< beans::PropertyValue > aPathPropSeq; if ( rGeoProp.Value >>= aPathPropSeq ) { - for ( const beans::PropertyValue& rProp : aPathPropSeq ) + for ( const beans::PropertyValue& rProp : std::as_const(aPathPropSeq) ) { switch( EASGet( rProp.Name ) ) { @@ -4598,7 +4598,7 @@ static void ImpExportEnhancedGeometry( SvXMLExport& rExport, const uno::Referenc { if ( aGluePoints.hasElements() ) { - for( const auto& rGluePoint : aGluePoints ) + for( const auto& rGluePoint : std::as_const(aGluePoints) ) { ExportParameter( aStrBuffer, rGluePoint.First ); ExportParameter( aStrBuffer, rGluePoint.Second ); @@ -4656,7 +4656,7 @@ static void ImpExportEnhancedGeometry( SvXMLExport& rExport, const uno::Referenc { if ( aPathTextFrames.hasElements() ) { - for ( const auto& rPathTextFrame : aPathTextFrames ) + for ( const auto& rPathTextFrame : std::as_const(aPathTextFrames) ) { ExportParameter( aStrBuffer, rPathTextFrame.TopLeft.First ); ExportParameter( aStrBuffer, rPathTextFrame.TopLeft.Second ); diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx index d61cee0a708e..56efcdb64b2d 100644 --- a/xmloff/source/draw/ximpshap.cxx +++ b/xmloff/source/draw/ximpshap.cxx @@ -3105,7 +3105,7 @@ void SdXMLPluginShapeContext::EndElement() xProps->setPropertyValue("MediaMimeType", uno::makeAny(maMimeType) ); - for( const auto& rParam : maParams ) + for( const auto& rParam : std::as_const(maParams) ) { const OUString& rName = rParam.Name; diff --git a/xmloff/source/forms/elementexport.cxx b/xmloff/source/forms/elementexport.cxx index 9f92db511cd9..13ebf89709c5 100644 --- a/xmloff/source/forms/elementexport.cxx +++ b/xmloff/source/forms/elementexport.cxx @@ -400,7 +400,7 @@ namespace xmloff Sequence< OUString > aListItems; m_xProps->getPropertyValue(PROPERTY_STRING_ITEM_LIST) >>= aListItems; // loop through it and write the sub elements - for (const auto& rListItem : aListItems) + for (const auto& rListItem : std::as_const(aListItems)) { m_rContext.getGlobalContext().ClearAttrList(); AddAttribute( @@ -1260,7 +1260,7 @@ namespace xmloff DBG_CHECK_PROPERTY(_rPropertyName, Sequence< sal_Int16 >); m_xProps->getPropertyValue(_rPropertyName) >>= aValueSequence; - for (const auto& rValue : aValueSequence) + for (const auto& rValue : std::as_const(aValueSequence)) _rOut.insert(rValue); } diff --git a/xmloff/source/forms/propertyexport.cxx b/xmloff/source/forms/propertyexport.cxx index 7c9340657ad7..f83802638968 100644 --- a/xmloff/source/forms/propertyexport.cxx +++ b/xmloff/source/forms/propertyexport.cxx @@ -223,7 +223,7 @@ namespace xmloff void OPropertyExport::examinePersistence() { m_aRemainingProps.clear(); - Sequence< Property > aProperties = m_xPropertyInfo->getProperties(); + const Sequence< Property > aProperties = m_xPropertyInfo->getProperties(); for (const auto& rProp : aProperties) { // no transient props diff --git a/xmloff/source/script/XMLEventExport.cxx b/xmloff/source/script/XMLEventExport.cxx index 02e720b643db..882b4ae3bf76 100644 --- a/xmloff/source/script/XMLEventExport.cxx +++ b/xmloff/source/script/XMLEventExport.cxx @@ -110,7 +110,7 @@ void XMLEventExport::Export( Reference<XNameAccess> const & rAccess, bool bStarted = false; // iterate over all event types - Sequence<OUString> aNames = rAccess->getElementNames(); + const Sequence<OUString> aNames = rAccess->getElementNames(); for(const auto& rName : aNames) { // translate name diff --git a/xmloff/source/script/XMLScriptExportHandler.cxx b/xmloff/source/script/XMLScriptExportHandler.cxx index b2fe8d6497c5..aaed4ded0e86 100644 --- a/xmloff/source/script/XMLScriptExportHandler.cxx +++ b/xmloff/source/script/XMLScriptExportHandler.cxx @@ -44,7 +44,7 @@ XMLScriptExportHandler::~XMLScriptExportHandler() void XMLScriptExportHandler::Export( SvXMLExport& rExport, const OUString& rEventQName, - Sequence<PropertyValue> & rValues, + const Sequence<PropertyValue> & rValues, bool bUseWhitespace) { diff --git a/xmloff/source/script/XMLStarBasicExportHandler.cxx b/xmloff/source/script/XMLStarBasicExportHandler.cxx index 0502bbedcd00..ed6d3a136b04 100644 --- a/xmloff/source/script/XMLStarBasicExportHandler.cxx +++ b/xmloff/source/script/XMLStarBasicExportHandler.cxx @@ -49,7 +49,7 @@ XMLStarBasicExportHandler::~XMLStarBasicExportHandler() void XMLStarBasicExportHandler::Export( SvXMLExport& rExport, const OUString& rEventQName, - Sequence<PropertyValue> & rValues, + const Sequence<PropertyValue> & rValues, bool bUseWhitespace) { rExport.AddAttribute(XML_NAMESPACE_SCRIPT, XML_LANGUAGE, diff --git a/xmloff/source/style/AttributeContainerHandler.cxx b/xmloff/source/style/AttributeContainerHandler.cxx index 5db11689e28d..07d98dedc472 100644 --- a/xmloff/source/style/AttributeContainerHandler.cxx +++ b/xmloff/source/style/AttributeContainerHandler.cxx @@ -47,7 +47,7 @@ bool XMLAttributeContainerHandler::equals( if( ( r1 >>= xContainer1 ) && ( r2 >>= xContainer2 ) ) { - uno::Sequence< OUString > aAttribNames1( xContainer1->getElementNames() ); + const uno::Sequence< OUString > aAttribNames1( xContainer1->getElementNames() ); uno::Sequence< OUString > aAttribNames2( xContainer2->getElementNames() ); if( aAttribNames1.getLength() == aAttribNames2.getLength() ) diff --git a/xmloff/source/style/XMLFontAutoStylePool.cxx b/xmloff/source/style/XMLFontAutoStylePool.cxx index d9b205b1c7df..af44e28525d7 100644 --- a/xmloff/source/style/XMLFontAutoStylePool.cxx +++ b/xmloff/source/style/XMLFontAutoStylePool.cxx @@ -304,14 +304,16 @@ std::unordered_set<OUString> XMLFontAutoStylePool::getUsedFontList() uno::Reference<container::XNameAccess> xFamilies(xFamiliesSupp->getStyleFamilies()); if (xFamilies.is()) { - for (OUString const & sFamilyName : xFamilies->getElementNames()) + const uno::Sequence<OUString> aFamilyNames = xFamilies->getElementNames(); + for (OUString const & sFamilyName : aFamilyNames) { uno::Reference<container::XNameAccess> xStyleContainer; xFamilies->getByName(sFamilyName) >>= xStyleContainer; if (xStyleContainer.is()) { - for (OUString const & rName : xStyleContainer->getElementNames()) + const uno::Sequence<OUString> aStyleNames = xStyleContainer->getElementNames(); + for (OUString const & rName : aStyleNames) { uno::Reference<style::XStyle> xStyle; xStyleContainer->getByName(rName) >>= xStyle; diff --git a/xmloff/source/style/XMLPageExport.cxx b/xmloff/source/style/XMLPageExport.cxx index 64c7645e4980..4baa8a43f24c 100644 --- a/xmloff/source/style/XMLPageExport.cxx +++ b/xmloff/source/style/XMLPageExport.cxx @@ -199,7 +199,7 @@ void XMLPageExport::exportStyles( bool bUsed, bool bAutoStyles ) { if( xPageStyles.is() ) { - uno::Sequence< OUString> aSeq = xPageStyles->getElementNames(); + const uno::Sequence< OUString> aSeq = xPageStyles->getElementNames(); for(const auto& rName : aSeq) { Reference< XStyle > xStyle(xPageStyles->getByName( rName ),uno::UNO_QUERY); diff --git a/xmloff/source/style/styleexp.cxx b/xmloff/source/style/styleexp.cxx index e7f39c6314fe..afffbf832d1a 100644 --- a/xmloff/source/style/styleexp.cxx +++ b/xmloff/source/style/styleexp.cxx @@ -90,7 +90,7 @@ void XMLStyleExport::exportStyleContent( const Reference< XStyle >& rStyle ) aProperty >>= aSeq; - for (beans::NamedValue const& rNamedCond : aSeq) + for (beans::NamedValue const& rNamedCond : std::as_const(aSeq)) { OUString aStyleName; diff --git a/xmloff/source/style/xmlexppr.cxx b/xmloff/source/style/xmlexppr.cxx index a0ed1e483d9d..76fd72c71deb 100644 --- a/xmloff/source/style/xmlexppr.cxx +++ b/xmloff/source/style/xmlexppr.cxx @@ -316,7 +316,7 @@ void FilterPropertiesInfo_Impl::FillPropertyStateArray( } else { - Sequence < beans::GetPropertyTolerantResult > aResults(xTolPropSet->getPropertyValuesTolerant(rApiNames)); + const Sequence < beans::GetPropertyTolerantResult > aResults(xTolPropSet->getPropertyValuesTolerant(rApiNames)); OSL_ENSURE( rApiNames.getLength() == aResults.getLength(), "wrong implemented XTolerantMultiPropertySet" ); FilterPropertyInfoList_Impl::iterator aPropIter(aPropInfos.begin()); XMLPropertyState aNewProperty( -1 ); @@ -919,7 +919,7 @@ void SvXMLExportPropertyMapper::_exportXML( std::unique_ptr<SvXMLNamespaceMap> pNewNamespaceMap; const SvXMLNamespaceMap *pNamespaceMap = &rNamespaceMap; - uno::Sequence< OUString > aAttribNames( xAttrContainer->getElementNames() ); + const uno::Sequence< OUString > aAttribNames( xAttrContainer->getElementNames() ); OUStringBuffer sNameBuffer; xml::AttributeData aData; diff --git a/xmloff/source/style/xmlimppr.cxx b/xmloff/source/style/xmlimppr.cxx index 79f8a5f09b45..d21c219f12cb 100644 --- a/xmloff/source/style/xmlimppr.cxx +++ b/xmloff/source/style/xmlimppr.cxx @@ -688,7 +688,7 @@ bool SvXMLImportPropertyMapper::FillTolerantMultiPropertySet_( // and, finally, try to set the values try { - Sequence< SetPropertyTolerantFailed > aResults(rTolMultiPropSet->setPropertyValuesTolerant( aNames, aValues )); + const Sequence< SetPropertyTolerantFailed > aResults(rTolMultiPropSet->setPropertyValuesTolerant( aNames, aValues )); bSuccessful = !aResults.hasElements(); for( const auto& rResult : aResults) { diff --git a/xmloff/source/style/xmltabe.cxx b/xmloff/source/style/xmltabe.cxx index 63cb2ce79f94..d9cd53384f60 100644 --- a/xmloff/source/style/xmltabe.cxx +++ b/xmloff/source/style/xmltabe.cxx @@ -113,7 +113,7 @@ void SvxXMLTabStopExport::Export( const uno::Any& rAny ) SvXMLElementExport rElem( rExport, XML_NAMESPACE_STYLE, XML_TAB_STOPS, true, true ); - for( const auto& rTab : aSeq ) + for( const auto& rTab : std::as_const(aSeq) ) { if( style::TabAlign_DEFAULT != rTab.Alignment ) exportTabStop( &rTab ); diff --git a/xmloff/source/text/XMLRedlineExport.cxx b/xmloff/source/text/XMLRedlineExport.cxx index e700de15670f..6ac62d6d6cb2 100644 --- a/xmloff/source/text/XMLRedlineExport.cxx +++ b/xmloff/source/text/XMLRedlineExport.cxx @@ -539,7 +539,7 @@ void XMLRedlineExport::ExportStartOrEndRedline( bool bIsStart = true; OUString sId; bool bIdOK = false; // have we seen an ID? - for(const auto& rValue : aValues) + for(const auto& rValue : std::as_const(aValues)) { if (rValue.Name == "RedlineIdentifier") { diff --git a/xmloff/source/text/XMLSectionExport.cxx b/xmloff/source/text/XMLSectionExport.cxx index f01dd7d16879..421bbd51aa25 100644 --- a/xmloff/source/text/XMLSectionExport.cxx +++ b/xmloff/source/text/XMLSectionExport.cxx @@ -1143,7 +1143,7 @@ SvXMLEnumMapEntry<sal_Int16> const aBibliographyDataFieldMap[] = void XMLSectionExport::ExportIndexTemplateElement( SectionTypeEnum eType, //i90246 - Sequence<PropertyValue> & rValues) + const Sequence<PropertyValue> & rValues) { // variables for template values @@ -1525,7 +1525,7 @@ void XMLSectionExport::ExportLevelParagraphStyles( true, true); // iterate over styles in this level - for(const auto& rStyleName : aStyleNames) + for(const auto& rStyleName : std::as_const(aStyleNames)) { // stylename attribute GetExport().AddAttribute(XML_NAMESPACE_TEXT, diff --git a/xmloff/source/text/XMLSectionExport.hxx b/xmloff/source/text/XMLSectionExport.hxx index c2291e373652..da8145bfdcd5 100644 --- a/xmloff/source/text/XMLSectionExport.hxx +++ b/xmloff/source/text/XMLSectionExport.hxx @@ -243,7 +243,7 @@ private: /// export a single template element (e.g. span or tab-stop) void ExportIndexTemplateElement( SectionTypeEnum eType, //i90246, needed for ODF 1.0, 1.0 and 1.2 management - css::uno::Sequence< + const css::uno::Sequence< css::beans::PropertyValue> & rValues); /// export level paragraph styles diff --git a/xmloff/source/text/XMLTextColumnsExport.cxx b/xmloff/source/text/XMLTextColumnsExport.cxx index ff7bb4e4c89d..ec42039dde8c 100644 --- a/xmloff/source/text/XMLTextColumnsExport.cxx +++ b/xmloff/source/text/XMLTextColumnsExport.cxx @@ -62,7 +62,7 @@ void XMLTextColumnsExport::exportXML( const Any& rAny ) Reference < XTextColumns > xColumns; rAny >>= xColumns; - Sequence < TextColumn > aColumns = xColumns->getColumns(); + const Sequence < TextColumn > aColumns = xColumns->getColumns(); sal_Int32 nCount = aColumns.getLength(); OUStringBuffer sValue; diff --git a/xmloff/source/text/txtflde.cxx b/xmloff/source/text/txtflde.cxx index ca796c95cc58..19d7ed74cad9 100644 --- a/xmloff/source/text/txtflde.cxx +++ b/xmloff/source/text/txtflde.cxx @@ -1965,7 +1965,7 @@ void XMLTextFieldExport::ExportFieldDeclarations( aFieldMasters = xFieldMasterNameAccess->getElementNames(); } - for(const OUString& sFieldMaster : aFieldMasters) { + for(const OUString& sFieldMaster : std::as_const(aFieldMasters)) { // workaround for #no-bug# if ( sFieldMaster.startsWithIgnoreAsciiCase( @@ -2706,7 +2706,7 @@ void XMLTextFieldExport::ProcessBibliographyData( aAny >>= aValues; // one attribute per value (unless empty) - for (const auto& rProp : aValues) + for (const auto& rProp : std::as_const(aValues)) { if( rProp.Name == "BibiliographicType" ) { diff --git a/xmloff/source/text/txtfldi.cxx b/xmloff/source/text/txtfldi.cxx index 95986dd42a0a..8a9bcbf84671 100644 --- a/xmloff/source/text/txtfldi.cxx +++ b/xmloff/source/text/txtfldi.cxx @@ -2490,7 +2490,7 @@ void XMLMacroFieldImportContext::PrepareField( Sequence<PropertyValue> aValues; pEvents->GetEventSequence( "OnClick", aValues ); - for( const auto& rValue : aValues ) + for( const auto& rValue : std::as_const(aValues) ) { if ( rValue.Name == "ScriptType" ) { diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx index 5a9ebfcb3dfd..d7bf4e5f433f 100644 --- a/xmloff/source/text/txtparae.cxx +++ b/xmloff/source/text/txtparae.cxx @@ -461,7 +461,7 @@ void FieldParamExporter::Export() const Type aBoolType = cppu::UnoType<sal_Bool>::get(); const Type aSeqType = cppu::UnoType<Sequence<OUString>>::get(); const Type aIntType = ::cppu::UnoType<sal_Int32>::get(); - Sequence<OUString> vParameters(m_xFieldParams->getElementNames()); + const Sequence<OUString> vParameters(m_xFieldParams->getElementNames()); for(const auto & rParameter : vParameters) { const Any aValue = m_xFieldParams->getByName(rParameter); @@ -507,7 +507,7 @@ void FieldParamExporter::Export() { Sequence<OUString> vValue; aValue >>= vValue; - for(const OUString & i : vValue) + for(const OUString & i : std::as_const(vValue)) { ExportParameter(rParameter, i); } diff --git a/xmloff/source/xforms/xformsapi.cxx b/xmloff/source/xforms/xformsapi.cxx index 19d2f1a051b7..1c1d21125418 100644 --- a/xmloff/source/xforms/xformsapi.cxx +++ b/xmloff/source/xforms/xformsapi.cxx @@ -113,7 +113,7 @@ static Reference<XPropertySet> lcl_findXFormsBindingOrSubmission( if( xForms.is() ) { // iterate over all models - Sequence<OUString> aNames = xForms->getElementNames(); + const Sequence<OUString> aNames = xForms->getElementNames(); for( const auto& rName : aNames ) { Reference<xforms::XModel2> xModel( diff --git a/xmloff/source/xforms/xformsexport.cxx b/xmloff/source/xforms/xformsexport.cxx index 09053850c952..76a5a47300eb 100644 --- a/xmloff/source/xforms/xformsexport.cxx +++ b/xmloff/source/xforms/xformsexport.cxx @@ -86,7 +86,7 @@ void exportXForms( SvXMLExport& rExport ) Reference<XNameContainer> xForms = xSupplier->getXForms(); if( xForms.is() ) { - Sequence<OUString> aNames = xForms->getElementNames(); + const Sequence<OUString> aNames = xForms->getElementNames(); for( const auto& rName : aNames ) { @@ -331,7 +331,7 @@ void exportXFormsBinding( SvXMLExport& rExport, if( xNamespaces.is() ) { // iterate over Prefixes for this binding - Sequence<OUString> aPrefixes = xNamespaces->getElementNames(); + const Sequence<OUString> aPrefixes = xNamespaces->getElementNames(); for( const OUString& rPrefix : aPrefixes ) { OUString sURI; @@ -763,7 +763,7 @@ void getXFormsSettings( const Reference< XNameAccess >& _rXForms, Sequence< Prop // are the names of the XForm models, and which in turn provides named sequences of // PropertyValues - which denote the actual property values of the given named model. - Sequence< OUString > aModelNames( _rXForms->getElementNames() ); + const Sequence< OUString > aModelNames( _rXForms->getElementNames() ); Reference< XNameContainer > xModelSettings = document::NamedPropertyValues::create( comphelper::getProcessComponentContext() ); diff --git a/xmloff/source/xforms/xformsimport.cxx b/xmloff/source/xforms/xformsimport.cxx index 03b1ca1d6043..24f948763b06 100644 --- a/xmloff/source/xforms/xformsimport.cxx +++ b/xmloff/source/xforms/xformsimport.cxx @@ -149,7 +149,7 @@ void applyXFormsSettings( const Reference< XNameAccess >& _rXForms, const Sequen try { - Sequence< OUString > aSettingsForModels( xModelSettings->getElementNames() ); + const Sequence< OUString > aSettingsForModels( xModelSettings->getElementNames() ); for ( auto const & modelName : aSettingsForModels ) { // the settings for this particular model @@ -167,7 +167,7 @@ void applyXFormsSettings( const Reference< XNameAccess >& _rXForms, const Sequen Reference< XPropertySet > xModelProps( _rXForms->getByName( modelName ), UNO_QUERY_THROW ); Reference< XPropertySetInfo > xModelPSI( xModelProps->getPropertySetInfo(), UNO_SET_THROW ); - for ( auto const & setting : aModelSettings ) + for ( auto const & setting : std::as_const(aModelSettings) ) { if ( !xModelPSI->hasPropertyByName( setting.Name ) ) { commit a0073744aac89648e89506b79e227b17dacf58d0 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Thu Aug 15 15:21:50 2019 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Fri Aug 16 08:11:27 2019 +0200 loplugin:sequenceloop in ucb..unotools Change-Id: Ie52d993c185ba43386b494baad0a484d5b365499 Reviewed-on: https://gerrit.libreoffice.org/77532 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/ucb/source/core/FileAccess.cxx b/ucb/source/core/FileAccess.cxx index 3f501ee576b8..0a6ec8759b2f 100644 --- a/ucb/source/core/FileAccess.cxx +++ b/ucb/source/core/FileAccess.cxx @@ -354,7 +354,7 @@ void OFileAccess::createFolder( const OUString& NewFolderURL ) ucbhelper::Content aCnt( aURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ), mxEnvironment.get(), comphelper::getProcessComponentContext() ); - Sequence< ContentInfo > aInfo = aCnt.queryCreatableContentsInfo(); + const Sequence< ContentInfo > aInfo = aCnt.queryCreatableContentsInfo(); for ( const ContentInfo & rCurr : aInfo ) { @@ -586,7 +586,7 @@ bool OFileAccess::createNewFile( const OUString & rParentURL, { ucbhelper::Content aParentCnt( rParentURL, mxEnvironment.get(), comphelper::getProcessComponentContext() ); - Sequence< ContentInfo > aInfo = aParentCnt.queryCreatableContentsInfo(); + const Sequence< ContentInfo > aInfo = aParentCnt.queryCreatableContentsInfo(); for ( const ContentInfo & rCurr : aInfo ) { diff --git a/ucb/source/core/ucb.cxx b/ucb/source/core/ucb.cxx index 6e28cd18fc9a..84eb2f61fe24 100644 --- a/ucb/source/core/ucb.cxx +++ b/ucb/source/core/ucb.cxx @@ -864,7 +864,7 @@ bool UniversalContentBroker::getContentProviderData( uno::Reference< container::XNameAccess > xNameAccess( xInterface, uno::UNO_QUERY_THROW ); - uno::Sequence< OUString > aElems = xNameAccess->getElementNames(); + const uno::Sequence< OUString > aElems = xNameAccess->getElementNames(); if ( aElems.hasElements() ) { diff --git a/ucb/source/core/ucbstore.cxx b/ucb/source/core/ucbstore.cxx index 010418323eae..23299e1fa348 100644 --- a/ucb/source/core/ucbstore.cxx +++ b/ucb/source/core/ucbstore.cxx @@ -701,7 +701,7 @@ void PropertySetRegistry::renamePropertySet( const OUString& rOldKey, } // Obtain property names. - Sequence< OUString > aElems + const Sequence< OUString > aElems = xOldNameAccess->getElementNames(); if ( aElems.hasElements() ) { diff --git a/ucb/source/ucp/cmis/cmis_content.cxx b/ucb/source/ucp/cmis/cmis_content.cxx index c51459a4b417..e71d077727fc 100644 --- a/ucb/source/ucp/cmis/cmis_content.cxx +++ b/ucb/source/ucp/cmis/cmis_content.cxx @@ -589,7 +589,7 @@ namespace cmis iCmisProps >>= aPropsSeq; map< string, libcmis::PropertyPtr > aProperties; - for ( const auto& rProp : aPropsSeq ) + for ( const auto& rProp : std::as_const(aPropsSeq) ) { std::string id = OUSTR_TO_STDSTR( rProp.Id ); libcmis::PropertyPtr prop = lcl_unoToCmisProperty( rProp ); diff --git a/ucb/source/ucp/ext/ucpext_datasupplier.cxx b/ucb/source/ucp/ext/ucpext_datasupplier.cxx index 1f4543b22959..4fdfef7bbc49 100644 --- a/ucb/source/ucp/ext/ucpext_datasupplier.cxx +++ b/ucb/source/ucp/ext/ucpext_datasupplier.cxx @@ -126,7 +126,7 @@ namespace ucb { namespace ucp { namespace ext { case E_ROOT: { - Sequence< Sequence< OUString > > aExtensionInfo( xPackageInfo->getExtensionList() ); + const Sequence< Sequence< OUString > > aExtensionInfo( xPackageInfo->getExtensionList() ); for ( auto const & extInfo : aExtensionInfo ) { if ( !extInfo.hasElements() ) diff --git a/ucb/source/ucp/file/bc.cxx b/ucb/source/ucp/file/bc.cxx index 9e17496bd7d9..7bc6e9d1d93a 100644 --- a/ucb/source/ucp/file/bc.cxx +++ b/ucb/source/ucp/file/bc.cxx @@ -1243,7 +1243,7 @@ BaseContent::cPCL() if (!m_pPropertyListener) return nullptr; - Sequence< OUString > seqNames = m_pPropertyListener->getContainedTypes(); + const Sequence< OUString > seqNames = m_pPropertyListener->getContainedTypes(); std::unique_ptr<PropertyChangeNotifier> p; diff --git a/ucb/source/ucp/file/filnot.cxx b/ucb/source/ucp/file/filnot.cxx index 6c199770e59b..ba33e6662bfa 100644 --- a/ucb/source/ucp/file/filnot.cxx +++ b/ucb/source/ucp/file/filnot.cxx @@ -220,7 +220,7 @@ void PropertyChangeNotifier::notifyPropertyChanged( // notify listeners for all Events uno::Sequence< uno::Reference< uno::XInterface > > seqList = (*m_pListeners)[ OUString() ]; - for( const auto& rListener : seqList ) + for( const auto& rListener : std::as_const(seqList) ) { uno::Reference< beans::XPropertiesChangeListener > aListener( rListener,uno::UNO_QUERY ); if( aListener.is() ) @@ -230,12 +230,12 @@ void PropertyChangeNotifier::notifyPropertyChanged( } uno::Sequence< beans::PropertyChangeEvent > seq(1); - for( const auto& rChange : Changes ) + for( const auto& rChange : std::as_const(Changes) ) { seq[0] = rChange; seqList = (*m_pListeners)[ rChange.PropertyName ]; - for( const auto& rListener : seqList ) + for( const auto& rListener : std::as_const(seqList) ) { uno::Reference< beans::XPropertiesChangeListener > aListener( rListener,uno::UNO_QUERY ); if( aListener.is() ) diff --git a/ucb/source/ucp/file/filtask.cxx b/ucb/source/ucp/file/filtask.cxx index 432d18b4bb9a..633b7d2c87b9 100644 --- a/ucb/source/ucp/file/filtask.cxx +++ b/ucb/source/ucp/file/filtask.cxx @@ -2212,7 +2212,7 @@ TaskManager::load( const ContentMap::iterator& it, bool create ) // Now put in all values in the storage in the local hash; PropertySet& properties = it->second.properties; - uno::Sequence< beans::Property > seq = xS->getPropertySetInfo()->getProperties(); + const uno::Sequence< beans::Property > seq = xS->getPropertySetInfo()->getProperties(); for( const auto& rProp : seq ) { @@ -2821,7 +2821,7 @@ TaskManager::erasePersistentSet( const OUString& aUnqPath, } uno::Reference< container::XNameAccess > xName( m_xFileRegistry,uno::UNO_QUERY ); - uno::Sequence< OUString > seqNames = xName->getElementNames(); + const uno::Sequence< OUString > seqNames = xName->getElementNames(); OUString old_Name = aUnqPath; @@ -2853,7 +2853,7 @@ TaskManager::copyPersistentSetWithoutChildren( const OUString& srcUnqPath, if( ! x_src.is() ) return; - uno::Sequence< beans::Property > seqProperty = + const uno::Sequence< beans::Property > seqProperty = x_src->getPropertySetInfo()->getProperties(); if( ! seqProperty.hasElements() ) @@ -2890,7 +2890,7 @@ TaskManager::copyPersistentSet( const OUString& srcUnqPath, } uno::Reference< container::XNameAccess > xName( m_xFileRegistry,uno::UNO_QUERY ); - uno::Sequence< OUString > seqNames = xName->getElementNames(); + const uno::Sequence< OUString > seqNames = xName->getElementNames(); OUString new_Name; diff --git a/ucb/source/ucp/webdav-neon/DAVResourceAccess.cxx b/ucb/source/ucp/webdav-neon/DAVResourceAccess.cxx index fa2a36483891..f0576e049aad 100644 --- a/ucb/source/ucp/webdav-neon/DAVResourceAccess.cxx +++ b/ucb/source/ucp/webdav-neon/DAVResourceAccess.cxx @@ -1081,7 +1081,7 @@ void DAVResourceAccess::getUserRequestHeaders( if ( xDAVEnv.is() ) { - uno::Sequence< beans::StringPair > aRequestHeaders + const uno::Sequence< beans::StringPair > aRequestHeaders = xDAVEnv->getUserRequestHeaders( rURI, eMethod ); for ( const auto& rRequestHeader : aRequestHeaders ) diff --git a/ucb/source/ucp/webdav-neon/webdavcontent.cxx b/ucb/source/ucp/webdav-neon/webdavcontent.cxx index 92534b376201..b360f300265a 100644 --- a/ucb/source/ucp/webdav-neon/webdavcontent.cxx +++ b/ucb/source/ucp/webdav-neon/webdavcontent.cxx @@ -2958,7 +2958,7 @@ Content::ResourceType Content::resourceTypeForLocks( if ( m_xCachedProps->getValue( DAVProperties::SUPPORTEDLOCK ) >>= aSupportedLocks ) //get the cached value for supportedlock { - for ( const auto& rSupportedLock : aSupportedLocks ) + for ( const auto& rSupportedLock : std::as_const(aSupportedLocks) ) { if ( rSupportedLock.Scope == ucb::LockScope_EXCLUSIVE && diff --git a/ucbhelper/source/provider/propertyvalueset.cxx b/ucbhelper/source/provider/propertyvalueset.cxx index 486ac962aa34..32fabcff3b58 100644 --- a/ucbhelper/source/provider/propertyvalueset.cxx +++ b/ucbhelper/source/provider/propertyvalueset.cxx @@ -642,14 +642,14 @@ void PropertyValueSet::appendPropertySet( Reference< XPropertySetInfo > xInfo = rxSet->getPropertySetInfo(); if ( xInfo.is() ) { - Sequence< Property > aProps = xInfo->getProperties(); + const Sequence< Property > aProps = xInfo->getProperties(); Reference< XPropertyAccess > xPropertyAccess( rxSet, UNO_QUERY ); if ( xPropertyAccess.is() ) { // Efficient: Get all prop values with one ( remote) call. - Sequence< css::beans::PropertyValue > aPropValues + const Sequence< css::beans::PropertyValue > aPropValues = xPropertyAccess->getPropertyValues(); for ( const css::beans::PropertyValue& rPropValue : aPropValues ) diff --git a/ucbhelper/source/provider/providerhelper.cxx b/ucbhelper/source/provider/providerhelper.cxx index 52935962f9be..ff15d082e042 100644 --- a/ucbhelper/source/provider/providerhelper.cxx +++ b/ucbhelper/source/provider/providerhelper.cxx @@ -288,7 +288,7 @@ bool ContentProviderImplHelper::renameAdditionalPropertySet( if ( !xNameAccess.is() ) return false; - uno::Sequence< OUString > aKeys + const uno::Sequence< OUString > aKeys = xNameAccess->getElementNames(); if ( aKeys.hasElements() ) { @@ -361,7 +361,7 @@ bool ContentProviderImplHelper::copyAdditionalPropertySet( if ( !xNameAccess.is() ) return false; - uno::Sequence< OUString > aKeys + const uno::Sequence< OUString > aKeys = xNameAccess->getElementNames(); if ( aKeys.hasElements() ) { @@ -410,7 +410,7 @@ bool ContentProviderImplHelper::copyAdditionalPropertySet( return false; // Obtain all values from old set. - uno::Sequence< beans::PropertyValue > aValues + const uno::Sequence< beans::PropertyValue > aValues = xOldPropAccess->getPropertyValues(); uno::Sequence< beans::Property > aProps @@ -481,7 +481,7 @@ bool ContentProviderImplHelper::removeAdditionalPropertySet( if ( !xNameAccess.is() ) return false; - uno::Sequence< OUString > aKeys + const uno::Sequence< OUString > aKeys = xNameAccess->getElementNames(); if ( aKeys.hasElements() ) { diff --git a/unotools/source/config/compatibility.cxx b/unotools/source/config/compatibility.cxx index f0d211de6957..6fe672e78c31 100644 --- a/unotools/source/config/compatibility.cxx +++ b/unotools/source/config/compatibility.cxx @@ -170,7 +170,7 @@ SvtCompatibilityOptions_Impl::SvtCompatibilityOptions_Impl() : ConfigItem( ROOTN // 4 subkeys for every item! bool bDefaultFound = false; sal_Int32 nDestStep = 0; - for ( const auto& rNode : lNodes ) + for ( const auto& rNode : std::as_const(lNodes) ) { SvtCompatibilityEntry aItem; @@ -293,7 +293,7 @@ Sequence< OUString > SvtCompatibilityOptions_Impl::impl_GetPropertyNames( Sequen sal_Int32 nDestStep = 0; // Copy entries to destination and expand every item with 2 supported sub properties. - for ( const auto& rItem : rItems ) + for ( const auto& rItem : std::as_const(rItems) ) { OUString sFixPath = SETNODE_ALLFILEFORMATS; sFixPath += PATHDELIMITER; diff --git a/unotools/source/config/configitem.cxx b/unotools/source/config/configitem.cxx index ac801fc8df60..fd12fbde6796 100644 --- a/unotools/source/config/configitem.cxx +++ b/unotools/source/config/configitem.cxx @@ -281,7 +281,7 @@ void ConfigItem::impl_unpackLocalizedProperties( const Sequence< OUString > lOutValues.realloc ( nDestinationCounter+nPropertiesSize ); } - for( const auto& rProperty : lProperties ) + for( const auto& rProperty : std::as_const(lProperties) ) { lOutNames [nDestinationCounter] = sNodeName + rProperty.Name; lOutValues[nDestinationCounter] = rProperty.Value; @@ -641,7 +641,7 @@ bool ConfigItem::ClearNodeSet(const OUString& rNode) xCont.set(xHierarchyAccess, UNO_QUERY); if(!xCont.is()) return false; - Sequence< OUString > aNames = xCont->getElementNames(); + const Sequence< OUString > aNames = xCont->getElementNames(); Reference<XChangesBatch> xBatch(xHierarchyAccess, UNO_QUERY); for(const OUString& rName : aNames) { diff --git a/unotools/source/config/eventcfg.cxx b/unotools/source/config/eventcfg.cxx index 4c09402e2bcd..362a161bdfaf 100644 --- a/unotools/source/config/eventcfg.cxx +++ b/unotools/source/config/eventcfg.cxx @@ -185,7 +185,7 @@ void GlobalEventConfig_Impl::ImplCommit() void GlobalEventConfig_Impl::initBindingInfo() { // Get ALL names of current existing list items in configuration! - Sequence< OUString > lEventNames = GetNodeNames( SETNODE_BINDINGS, utl::ConfigNameFormat::LocalPath ); + const Sequence< OUString > lEventNames = GetNodeNames( SETNODE_BINDINGS, utl::ConfigNameFormat::LocalPath ); OUString aSetNode( SETNODE_BINDINGS ); aSetNode += PATHDELIMITER; @@ -230,7 +230,7 @@ void GlobalEventConfig_Impl::replaceByName( const OUString& aName, const Any& aE Reference< XInterface > (), 2); } OUString macroURL; - for( const auto& rProp : props ) + for( const auto& rProp : std::as_const(props) ) { if ( rProp.Name == "Script" ) rProp.Value >>= macroURL; diff --git a/unotools/source/config/fontcfg.cxx b/unotools/source/config/fontcfg.cxx index 2b1d3f24fb1f..bd7f7e21330b 100644 --- a/unotools/source/config/fontcfg.cxx +++ b/unotools/source/config/fontcfg.cxx @@ -117,7 +117,7 @@ DefaultFontConfiguration::DefaultFontConfiguration() UNO_QUERY ); if( m_xConfigAccess.is() ) { - Sequence< OUString > aLocales = m_xConfigAccess->getElementNames(); + const Sequence< OUString > aLocales = m_xConfigAccess->getElementNames(); // fill config hash with empty interfaces for( const OUString& rLocaleString : aLocales ) { @@ -331,7 +331,7 @@ FontSubstConfiguration::FontSubstConfiguration() : UNO_QUERY ); if( m_xConfigAccess.is() ) { - Sequence< OUString > aLocales = m_xConfigAccess->getElementNames(); + const Sequence< OUString > aLocales = m_xConfigAccess->getElementNames(); // fill config hash with empty interfaces for( const OUString& rLocaleString : aLocales ) { @@ -973,7 +973,7 @@ void FontSubstConfiguration::readLocaleSubst( const OUString& rBcp47 ) const } if( xNode.is() ) { - Sequence< OUString > aFonts = xNode->getElementNames(); + const Sequence< OUString > aFonts = xNode->getElementNames(); int nFonts = aFonts.getLength(); // improve performance, heap fragmentation it->second.aSubstAttributes.reserve( nFonts ); diff --git a/unotools/source/config/historyoptions.cxx b/unotools/source/config/historyoptions.cxx index ec2233ff32ec..5b17c4e927af 100644 --- a/unotools/source/config/historyoptions.cxx +++ b/unotools/source/config/historyoptions.cxx @@ -231,14 +231,14 @@ void SvtHistoryOptions_Impl::Clear( EHistoryType eHistory ) xListAccess->getByName(s_sItemList) >>= xNode; Sequence<OUString> aStrings(xNode->getElementNames()); - for (const auto& rString : aStrings) + for (const auto& rString : std::as_const(aStrings)) xNode->removeByName(rString); // clear OrderList xListAccess->getByName(s_sOrderList) >>= xNode; aStrings = xNode->getElementNames(); - for (const auto& rString : aStrings) + for (const auto& rString : std::as_const(aStrings)) xNode->removeByName(rString); ::comphelper::ConfigurationHelper::flush(m_xCfg); diff --git a/unotools/source/config/lingucfg.cxx b/unotools/source/config/lingucfg.cxx index 1d62a2f3013e..70efeba7b6c5 100644 --- a/unotools/source/config/lingucfg.cxx +++ b/unotools/source/config/lingucfg.cxx @@ -1021,7 +1021,7 @@ std::vector< SvtLinguConfigDictionaryEntry > SvtLinguConfig::GetActiveDictionari const uno::Sequence< OUString > aDisabledDics( GetDisabledDictionaries() ); SvtLinguConfigDictionaryEntry aDicEntry; - for (const OUString& rElementName : aElementNames) + for (const OUString& rElementName : std::as_const(aElementNames)) { // does dictionary match the format we are looking for? if (GetDictionaryEntry( rElementName, aDicEntry ) && diff --git a/unotools/source/config/optionsdlg.cxx b/unotools/source/config/optionsdlg.cxx index 988ef98f3857..18cd92386f03 100644 --- a/unotools/source/config/optionsdlg.cxx +++ b/unotools/source/config/optionsdlg.cxx @@ -83,7 +83,7 @@ SvtOptionsDlgOptions_Impl::SvtOptionsDlgOptions_Impl() m_aOptionNodeList( OptionNodeList() ) { OUString sRootNode( ROOT_NODE ); - Sequence< OUString > aNodeSeq = GetNodeNames( sRootNode ); + const Sequence< OUString > aNodeSeq = GetNodeNames( sRootNode ); OUString sNode( sRootNode + g_sPathDelimiter ); for ( const auto& rNode : aNodeSeq ) { @@ -143,7 +143,7 @@ void SvtOptionsDlgOptions_Impl::ReadNode( const OUString& _rNode, NodeType _eTyp if ( _eType != NT_Option ) { OUString sNodes( sNode + sSet ); - Sequence< OUString > aNodes = GetNodeNames( sNodes ); + const Sequence< OUString > aNodes = GetNodeNames( sNodes ); for ( const auto& rNode : aNodes ) { OUString sSubNodeName( sNodes + g_sPathDelimiter + rNode ); diff --git a/unotools/source/config/pathoptions.cxx b/unotools/source/config/pathoptions.cxx index 02d71146e120..4219c8c44033 100644 --- a/unotools/source/config/pathoptions.cxx +++ b/unotools/source/config/pathoptions.cxx @@ -404,7 +404,7 @@ SvtPathOptions_Impl::SvtPathOptions_Impl() : // Create temporary hash map to have a mapping between property names and property handles Reference< XPropertySetInfo > xPropSetInfo = xPathSettings->getPropertySetInfo(); - Sequence< Property > aPathPropSeq = xPropSetInfo->getProperties(); + const Sequence< Property > aPathPropSeq = xPropSetInfo->getProperties(); NameToHandleMap aTempHashMap; for ( const css::beans::Property& aProperty : aPathPropSeq ) diff --git a/unotools/source/config/securityoptions.cxx b/unotools/source/config/securityoptions.cxx index 33a87d8ffb6c..59b542879655 100644 --- a/unotools/source/config/securityoptions.cxx +++ b/unotools/source/config/securityoptions.cxx @@ -410,7 +410,7 @@ void SvtSecurityOptions_Impl::SetProperty( sal_Int32 nProperty, const Any& rValu void SvtSecurityOptions_Impl::LoadAuthors() { m_seqTrustedAuthors.realloc( 0 ); // first clear - Sequence< OUString > lAuthors = GetNodeNames( PROPERTYNAME_MACRO_TRUSTEDAUTHORS ); + const Sequence< OUString > lAuthors = GetNodeNames( PROPERTYNAME_MACRO_TRUSTEDAUTHORS ); sal_Int32 c1 = lAuthors.getLength(); if( c1 ) { diff --git a/unotools/source/i18n/localedatawrapper.cxx b/unotools/source/i18n/localedatawrapper.cxx index ead8a1ac53bb..8a16ec556f47 100644 --- a/unotools/source/i18n/localedatawrapper.cxx +++ b/unotools/source/i18n/localedatawrapper.cxx @@ -295,7 +295,7 @@ std::vector< LanguageType > LocaleDataWrapper::getInstalledLanguageTypes() if ( !rInstalledLanguageTypes.empty() ) return rInstalledLanguageTypes; - css::uno::Sequence< css::lang::Locale > xLoc = getInstalledLocaleNames(); + const css::uno::Sequence< css::lang::Locale > xLoc = getInstalledLocaleNames(); sal_Int32 nCount = xLoc.getLength(); std::vector< LanguageType > xLang; xLang.reserve(nCount); diff --git a/unotools/source/misc/ServiceDocumenter.cxx b/unotools/source/misc/ServiceDocumenter.cxx index b29848e5b25e..0823d2a6651e 100644 --- a/unotools/source/misc/ServiceDocumenter.cxx +++ b/unotools/source/misc/ServiceDocumenter.cxx @@ -33,7 +33,8 @@ void unotools::misc::ServiceDocumenter::showInterfaceDocs(const Reference<XTypeP return; auto xMSF(m_xContext->getServiceManager()); Reference<system::XSystemShellExecute> xShell(xMSF->createInstanceWithContext("com.sun.star.system.SystemShellExecute", m_xContext), uno::UNO_QUERY); - for(const auto& aType : xTypeProvider->getTypes()) + const css::uno::Sequence<css::uno::Type> aTypes = xTypeProvider->getTypes(); + for(const auto& aType : aTypes) { auto sUrl = aType.getTypeName(); sal_Int32 nIdx = 0; @@ -51,7 +52,8 @@ void unotools::misc::ServiceDocumenter::showServiceDocs(const Reference<XService return; auto xMSF(m_xContext->getServiceManager()); Reference<system::XSystemShellExecute> xShell(xMSF->createInstanceWithContext("com.sun.star.system.SystemShellExecute", m_xContext), uno::UNO_QUERY); - for(const auto& sService : xService->getSupportedServiceNames()) + const css::uno::Sequence<OUString> aServiceNames = xService->getSupportedServiceNames(); + for(const auto& sService : aServiceNames) { auto sUrl = sService; sal_Int32 nIdx = 0; diff --git a/unotools/source/ucbhelper/progresshandlerwrap.cxx b/unotools/source/ucbhelper/progresshandlerwrap.cxx index 2d085970bd53..0934633836a6 100644 --- a/unotools/source/ucbhelper/progresshandlerwrap.cxx +++ b/unotools/source/ucbhelper/progresshandlerwrap.cxx @@ -38,7 +38,7 @@ static bool getStatusFromAny_Impl( const Any& aAny, OUString& aText, sal_Int32& Sequence< Any > aSetList; if( aAny >>= aSetList ) - for( const auto& rSet : aSetList ) + for( const auto& rSet : std::as_const(aSetList) ) { if( !bNumIsSet && ( rSet >>= nNum ) ) bNumIsSet = true; diff --git a/unotools/source/ucbhelper/ucbhelper.cxx b/unotools/source/ucbhelper/ucbhelper.cxx index c2b25cd4f594..a411870827a6 100644 --- a/unotools/source/ucbhelper/ucbhelper.cxx +++ b/unotools/source/ucbhelper/ucbhelper.cxx @@ -239,7 +239,7 @@ bool utl::UCBContentHelper::MakeFolder( { bool exists = false; try { - css::uno::Sequence<css::ucb::ContentInfo> info( + const css::uno::Sequence<css::ucb::ContentInfo> info( parent.queryCreatableContentsInfo()); for (const auto& rInfo : info) { // Simply look for the first KIND_FOLDER: diff --git a/unotools/source/ucbhelper/ucblockbytes.cxx b/unotools/source/ucbhelper/ucblockbytes.cxx index a1e96fb3a338..0aa836bfd7fb 100644 --- a/unotools/source/ucbhelper/ucblockbytes.cxx +++ b/unotools/source/ucbhelper/ucblockbytes.cxx @@ -505,7 +505,7 @@ void Moderator::handle( const Reference<XInteractionRequest >& Request ) } if(aReplyType == EXIT) { - Sequence<Reference<XInteractionContinuation> > aSeq( + const Sequence<Reference<XInteractionContinuation> > aSeq( Request->getContinuations()); for(const auto& rContinuation : aSeq) { Reference<XInteractionAbort> aRef(rContinuation,UNO_QUERY); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits