diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-08-15 14:19:08 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-08-15 20:23:20 +0200 |
commit | 7b4f643f4feb28fdc92b3da7a95d0f1c7286d01a (patch) | |
tree | 1c203e78d9b634df39ce312b1daa411616d4bc49 /svtools/source | |
parent | c504780e7883e911916689c12709d64d78125422 (diff) |
loplugin:sequenceloop in svtools..svx
Change-Id: I81b54f6db69491492b2bc16f48b2296ad96e137d
Reviewed-on: https://gerrit.libreoffice.org/77529
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svtools/source')
-rw-r--r-- | svtools/source/config/extcolorcfg.cxx | 4 | ||||
-rw-r--r-- | svtools/source/config/fontsubstconfig.cxx | 2 | ||||
-rw-r--r-- | svtools/source/contnr/DocumentInfoPreview.cxx | 2 | ||||
-rw-r--r-- | svtools/source/control/inettbc.cxx | 4 | ||||
-rw-r--r-- | svtools/source/dialogs/addresstemplate.cxx | 11 | ||||
-rw-r--r-- | svtools/source/dialogs/colrdlg.cxx | 2 | ||||
-rw-r--r-- | svtools/source/dialogs/insdlg.cxx | 2 | ||||
-rw-r--r-- | svtools/source/filter/DocumentToGraphicRenderer.cxx | 2 | ||||
-rw-r--r-- | svtools/source/filter/SvFilterOptionsDialog.cxx | 4 | ||||
-rw-r--r-- | svtools/source/java/javainteractionhandler.cxx | 2 | ||||
-rw-r--r-- | svtools/source/misc/embedhlp.cxx | 4 | ||||
-rw-r--r-- | svtools/source/misc/imagemgr.cxx | 2 | ||||
-rw-r--r-- | svtools/source/misc/langtab.cxx | 2 | ||||
-rw-r--r-- | svtools/source/uno/unoevent.cxx | 2 |
14 files changed, 22 insertions, 23 deletions
diff --git a/svtools/source/config/extcolorcfg.cxx b/svtools/source/config/extcolorcfg.cxx index 634344521d77..5ff453f2a903 100644 --- a/svtools/source/config/extcolorcfg.cxx +++ b/svtools/source/config/extcolorcfg.cxx @@ -77,7 +77,7 @@ class ExtendedColorConfig_Impl : public utl::ConfigItem, public SfxBroadcaster static bool m_bBroadcastWhenUnlocked; uno::Sequence< OUString> GetPropertyNames(const OUString& rScheme); - void FillComponentColors(uno::Sequence < OUString >& _rComponents,const TDisplayNames& _rDisplayNames); + void FillComponentColors(const uno::Sequence < OUString >& _rComponents,const TDisplayNames& _rDisplayNames); virtual void ImplCommit() override; @@ -307,7 +307,7 @@ void ExtendedColorConfig_Impl::Load(const OUString& rScheme) } } -void ExtendedColorConfig_Impl::FillComponentColors(uno::Sequence < OUString >& _rComponents,const TDisplayNames& _rDisplayNames) +void ExtendedColorConfig_Impl::FillComponentColors(const uno::Sequence < OUString >& _rComponents,const TDisplayNames& _rDisplayNames) { const OUString sColorEntries("/Entries"); for(OUString const & component : _rComponents) diff --git a/svtools/source/config/fontsubstconfig.cxx b/svtools/source/config/fontsubstconfig.cxx index ffcc6399002d..34a11f6147b7 100644 --- a/svtools/source/config/fontsubstconfig.cxx +++ b/svtools/source/config/fontsubstconfig.cxx @@ -59,7 +59,7 @@ SvtFontSubstConfig::SvtFontSubstConfig() : bIsEnabled = *o3tl::doAccess<bool>(aValues.getConstArray()[0]); OUString sPropPrefix(cFontPairs); - Sequence<OUString> aNodeNames = GetNodeNames(sPropPrefix, ConfigNameFormat::LocalPath); + const Sequence<OUString> aNodeNames = GetNodeNames(sPropPrefix, ConfigNameFormat::LocalPath); Sequence<OUString> aPropNames(aNodeNames.getLength() * 4); OUString* pNames = aPropNames.getArray(); sal_Int32 nName = 0; diff --git a/svtools/source/contnr/DocumentInfoPreview.cxx b/svtools/source/contnr/DocumentInfoPreview.cxx index 22d29b2a65ce..59bb509117c2 100644 --- a/svtools/source/contnr/DocumentInfoPreview.cxx +++ b/svtools/source/contnr/DocumentInfoPreview.cxx @@ -103,7 +103,7 @@ void ODocumentInfoPreview::fill( xDocProps->getUserDefinedProperties(), css::uno::UNO_QUERY_THROW); css::uno::Reference< css::beans::XPropertySetInfo > info( user->getPropertySetInfo()); - css::uno::Sequence< css::beans::Property > props(info->getProperties()); + const css::uno::Sequence< css::beans::Property > props(info->getProperties()); for (const auto& rProp : props) { OUString name(rProp.Name); css::uno::Any aAny(user->getPropertyValue(name)); diff --git a/svtools/source/control/inettbc.cxx b/svtools/source/control/inettbc.cxx index 8373d346fd8d..1787f280fdad 100644 --- a/svtools/source/control/inettbc.cxx +++ b/svtools/source/control/inettbc.cxx @@ -1479,7 +1479,7 @@ void SvtURLBox::UpdatePicklistForSmartProtocol_Impl() return; // read history pick list - Sequence< Sequence< PropertyValue > > seqPicklist = SvtHistoryOptions().GetList( ePICKLIST ); + const Sequence< Sequence< PropertyValue > > seqPicklist = SvtHistoryOptions().GetList( ePICKLIST ); INetURLObject aCurObj; for( const Sequence< PropertyValue >& rPropertySet : seqPicklist ) @@ -2045,7 +2045,7 @@ void URLBox::UpdatePicklistForSmartProtocol_Impl() return; // read history pick list - Sequence< Sequence< PropertyValue > > seqPicklist = SvtHistoryOptions().GetList( ePICKLIST ); + const Sequence< Sequence< PropertyValue > > seqPicklist = SvtHistoryOptions().GetList( ePICKLIST ); INetURLObject aCurObj; for( const Sequence< PropertyValue >& rPropertySet : seqPicklist ) diff --git a/svtools/source/dialogs/addresstemplate.cxx b/svtools/source/dialogs/addresstemplate.cxx index d1cc5caa6f5b..708a4efbea4c 100644 --- a/svtools/source/dialogs/addresstemplate.cxx +++ b/svtools/source/dialogs/addresstemplate.cxx @@ -700,17 +700,16 @@ void AssignmentPersistentData::ImplCommit() m_xDatasource->clear(); // fill the datasources listbox - Sequence< OUString > aDatasourceNames; try { - aDatasourceNames = m_xDatabaseContext->getElementNames(); + const css::uno::Sequence<OUString> aElementNames = m_xDatabaseContext->getElementNames(); + for (const OUString& rDatasourceName : aElementNames) + m_xDatasource->append_text(rDatasourceName); } catch(Exception&) { OSL_FAIL("AddressBookSourceDialog::initializeDatasources: caught an exception while asking for the data source names!"); } - for (const OUString& rDatasourceName : aDatasourceNames) - m_xDatasource->append_text(rDatasourceName); } IMPL_LINK(AddressBookSourceDialog, OnFieldScroll, weld::ScrolledWindow&, rScrollBar, void) @@ -806,7 +805,7 @@ void AssignmentPersistentData::ImplCommit() bool bKnowOldTable = false; // fill the table list - for (const OUString& rTableName : aTableNames) + for (const OUString& rTableName : std::as_const(aTableNames)) { m_xTable->append_text(rTableName); if (rTableName == sOldTable) @@ -873,7 +872,7 @@ void AssignmentPersistentData::ImplCommit() pListbox->set_id(0, OUString::number(i)); // the field names - for (const OUString& rColumnName : aColumnNames) + for (const OUString& rColumnName : std::as_const(aColumnNames)) pListbox->append_text(rColumnName); if (!aInitialSelection->isEmpty() && (aColumnNameSet.end() != aColumnNameSet.find(*aInitialSelection))) diff --git a/svtools/source/dialogs/colrdlg.cxx b/svtools/source/dialogs/colrdlg.cxx index 1000e0dc5c1d..2608690b413e 100644 --- a/svtools/source/dialogs/colrdlg.cxx +++ b/svtools/source/dialogs/colrdlg.cxx @@ -84,7 +84,7 @@ short SvColorDialog::Execute(weld::Window* pParent) if( ret ) { props = xPropertyAccess->getPropertyValues(); - for( const auto& rProp : props ) + for( const auto& rProp : std::as_const(props) ) { if( rProp.Name == sColor ) { diff --git a/svtools/source/dialogs/insdlg.cxx b/svtools/source/dialogs/insdlg.cxx index 28fcc05b3685..291d3cd92fd9 100644 --- a/svtools/source/dialogs/insdlg.cxx +++ b/svtools/source/dialogs/insdlg.cxx @@ -106,7 +106,7 @@ void SvObjectServerList::FillInsertObjects() if( xNameAccess.is()) { - uno::Sequence< OUString > seqNames= xNameAccess->getElementNames(); + const uno::Sequence< OUString > seqNames= xNameAccess->getElementNames(); OUString aStringProductName( "%PRODUCTNAME" ); sal_Int32 nStringProductNameLength = aStringProductName.getLength(); diff --git a/svtools/source/filter/DocumentToGraphicRenderer.cxx b/svtools/source/filter/DocumentToGraphicRenderer.cxx index 39b8e40426d4..bec55b93fbe3 100644 --- a/svtools/source/filter/DocumentToGraphicRenderer.cxx +++ b/svtools/source/filter/DocumentToGraphicRenderer.cxx @@ -151,7 +151,7 @@ Size DocumentToGraphicRenderer::getDocumentSizeIn100mm(sal_Int32 nCurrentPage, sal_Int32 nPages = mxRenderable->getRendererCount( selection, renderProperties ); if (nPages >= nCurrentPage) { - Sequence< beans::PropertyValue > aResult = mxRenderable->getRenderer(nCurrentPage - 1, selection, renderProperties ); + const Sequence< beans::PropertyValue > aResult = mxRenderable->getRenderer(nCurrentPage - 1, selection, renderProperties ); for( const auto& rProperty : aResult ) { if ( rProperty.Name == "PageSize" ) diff --git a/svtools/source/filter/SvFilterOptionsDialog.cxx b/svtools/source/filter/SvFilterOptionsDialog.cxx index 7651eeecbede..55501fb8a77f 100644 --- a/svtools/source/filter/SvFilterOptionsDialog.cxx +++ b/svtools/source/filter/SvFilterOptionsDialog.cxx @@ -175,7 +175,7 @@ void SvFilterOptionsDialog::setPropertyValues( const uno::Sequence< beans::Prope { maMediaDescriptor = aProps; - for ( const auto& rProp : maMediaDescriptor ) + for ( const auto& rProp : std::as_const(maMediaDescriptor) ) { if ( rProp.Name == "FilterData" ) { @@ -199,7 +199,7 @@ sal_Int16 SvFilterOptionsDialog::execute() OUString aInternalFilterName; uno::Reference<graphic::XGraphic> xGraphic; - for ( const auto& rProp : maMediaDescriptor ) + for ( const auto& rProp : std::as_const(maMediaDescriptor) ) { const OUString& rName = rProp.Name; if ( rName == "FilterName" ) diff --git a/svtools/source/java/javainteractionhandler.cxx b/svtools/source/java/javainteractionhandler.cxx index f20433c28878..5d287b508988 100644 --- a/svtools/source/java/javainteractionhandler.cxx +++ b/svtools/source/java/javainteractionhandler.cxx @@ -93,7 +93,7 @@ void SAL_CALL JavaInteractionHandler::release( ) throw () void SAL_CALL JavaInteractionHandler::handle( const Reference< XInteractionRequest >& Request ) { Any anyExc = Request->getRequest(); - Sequence< Reference< XInteractionContinuation > > aSeqCont = Request->getContinuations(); + const Sequence< Reference< XInteractionContinuation > > aSeqCont = Request->getContinuations(); Reference< XInteractionAbort > abort; Reference< XInteractionRetry > retry; diff --git a/svtools/source/misc/embedhlp.cxx b/svtools/source/misc/embedhlp.cxx index f9a131acc37e..f6dd90343726 100644 --- a/svtools/source/misc/embedhlp.cxx +++ b/svtools/source/misc/embedhlp.cxx @@ -854,13 +854,13 @@ OUString EmbeddedObjectRef::GetChartType() if( ! xDiagram.is()) return OUString(); 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()); // IA2 CWS. Unused: int nCoordinateCount = aCooSysSeq.getLength(); bool bGetChartType = false; for( const auto& rCooSys : aCooSysSeq ) { uno::Reference< chart2::XChartTypeContainer > xCTCnt( rCooSys, uno::UNO_QUERY_THROW ); - uno::Sequence< uno::Reference< chart2::XChartType > > aChartTypes( xCTCnt->getChartTypes()); + const uno::Sequence< uno::Reference< chart2::XChartType > > aChartTypes( xCTCnt->getChartTypes()); int nDimesionCount = rCooSys->getDimension(); if( nDimesionCount == 3 ) Style += "3D "; diff --git a/svtools/source/misc/imagemgr.cxx b/svtools/source/misc/imagemgr.cxx index 9026b65e62d8..9941c5051db6 100644 --- a/svtools/source/misc/imagemgr.cxx +++ b/svtools/source/misc/imagemgr.cxx @@ -232,7 +232,7 @@ static OUString GetImageExtensionByFactory_Impl( const OUString& rURL ) if ( !aInternalType.isEmpty() && xAccess->hasByName( aInternalType ) ) { xAccess->getByName( aInternalType ) >>= aTypeProps; - for ( const css::beans::PropertyValue& rProp : aTypeProps ) + for ( const css::beans::PropertyValue& rProp : std::as_const(aTypeProps) ) { if (rProp.Name == "Extensions") { diff --git a/svtools/source/misc/langtab.cxx b/svtools/source/misc/langtab.cxx index 62d31910da7d..c10561f8f87c 100644 --- a/svtools/source/misc/langtab.cxx +++ b/svtools/source/misc/langtab.cxx @@ -172,7 +172,7 @@ SvtLanguageTableImpl::SvtLanguageTableImpl() } auto xNA = officecfg::VCL::ExtraLanguages::get(); - uno::Sequence <OUString> rElementNames = xNA->getElementNames(); + const uno::Sequence <OUString> rElementNames = xNA->getElementNames(); for (const OUString& rBcp47 : rElementNames) { OUString aName; diff --git a/svtools/source/uno/unoevent.cxx b/svtools/source/uno/unoevent.cxx index 91e1a880f613..13c8d482d07a 100644 --- a/svtools/source/uno/unoevent.cxx +++ b/svtools/source/uno/unoevent.cxx @@ -151,7 +151,7 @@ void getMacroFromAny( OUString sScriptVal; OUString sMacroVal; OUString sLibVal; - for (const PropertyValue& aValue : aSequence) + for (const PropertyValue& aValue : std::as_const(aSequence)) { if (aValue.Name == sEventType) { |