diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-05-20 08:48:56 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-05-20 21:31:13 +0200 |
commit | b33ff1a083d95388997cf301d8a1538a41c08255 (patch) | |
tree | 35c773fc0be7c6e4c4b479c9594fb1e8843ef183 /extensions | |
parent | fb149c68db909e6ec17520e277583ed759a0d49a (diff) |
use for-range on Sequence in e*
Change-Id: I77dc12356ee45b1dee9acaf8a73dea81588822d3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94554
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'extensions')
-rw-r--r-- | extensions/source/bibliography/bibconfig.cxx | 14 | ||||
-rw-r--r-- | extensions/source/ole/oleobjw.cxx | 8 | ||||
-rw-r--r-- | extensions/source/update/check/updatecheckconfig.hxx | 8 | ||||
-rw-r--r-- | extensions/source/update/check/updatehdl.cxx | 8 |
4 files changed, 18 insertions, 20 deletions
diff --git a/extensions/source/bibliography/bibconfig.cxx b/extensions/source/bibliography/bibconfig.cxx index a06bc2a6c74d..a9c2d74f2b4a 100644 --- a/extensions/source/bibliography/bibconfig.cxx +++ b/extensions/source/bibliography/bibconfig.cxx @@ -117,14 +117,13 @@ BibConfig::BibConfig() } } } - Sequence< OUString > aNodeNames = GetNodeNames(cDataSourceHistory); - const OUString* pNodeNames = aNodeNames.getConstArray(); - for(sal_Int32 nNode = 0; nNode < aNodeNames.getLength(); nNode++) + const Sequence< OUString > aNodeNames = GetNodeNames(cDataSourceHistory); + for(OUString const & nodeName : aNodeNames) { Sequence<OUString> aHistoryNames(3); OUString* pHistoryNames = aHistoryNames.getArray(); - OUString sPrefix = OUStringLiteral(cDataSourceHistory) + "/" + pNodeNames[nNode] + "/"; + OUString sPrefix = OUStringLiteral(cDataSourceHistory) + "/" + nodeName + "/"; pHistoryNames[0] = sPrefix + "DataSourceName"; pHistoryNames[1] = sPrefix + "Command"; pHistoryNames[2] = sPrefix + "CommandType"; @@ -140,14 +139,13 @@ BibConfig::BibConfig() pHistoryValues[2] >>= pMapping->nCommandType; //field assignment is contained in another set sPrefix += "Fields"; - Sequence< OUString > aAssignmentNodeNames = GetNodeNames(sPrefix); - const OUString* pAssignmentNodeNames = aAssignmentNodeNames.getConstArray(); + const Sequence< OUString > aAssignmentNodeNames = GetNodeNames(sPrefix); Sequence<OUString> aAssignmentPropertyNames(aAssignmentNodeNames.getLength() * 2); OUString* pAssignmentPropertyNames = aAssignmentPropertyNames.getArray(); sal_Int16 nFieldIdx = 0; - for(sal_Int32 nField = 0; nField < aAssignmentNodeNames.getLength(); nField++) + for(OUString const & assignName : aAssignmentNodeNames) { - OUString sSubPrefix = sPrefix + "/" + pAssignmentNodeNames[nField]; + OUString sSubPrefix = sPrefix + "/" + assignName; pAssignmentPropertyNames[nFieldIdx] = sSubPrefix; pAssignmentPropertyNames[nFieldIdx++] += "/ProgrammaticFieldName"; pAssignmentPropertyNames[nFieldIdx] = sSubPrefix; diff --git a/extensions/source/ole/oleobjw.cxx b/extensions/source/ole/oleobjw.cxx index 8c98290b2125..c0a830eece91 100644 --- a/extensions/source/ole/oleobjw.cxx +++ b/extensions/source/ole/oleobjw.cxx @@ -1275,8 +1275,8 @@ uno::Any SAL_CALL IUnknownWrapper::directInvoke( const OUString& aName, const un dispparams.cArgs = aParams.getLength(); // Determine the number of named arguments - for ( sal_Int32 nInd = 0; nInd < aParams.getLength(); nInd++ ) - if ( aParams[nInd].getValueType() == cppu::UnoType<NamedArgument>::get() ) + for ( uno::Any const & any : aParams ) + if ( any.getValueType() == cppu::UnoType<NamedArgument>::get() ) dispparams.cNamedArgs ++; // fill the named arguments @@ -1548,9 +1548,9 @@ TypeDescription IUnknownWrapper::getInterfaceMemberDescOfCurrentCall(const OUStr { TypeDescription ret; - for( sal_Int32 i=0; i < m_seqTypes.getLength(); i++) + for( auto const & rType : std::as_const(m_seqTypes) ) { - TypeDescription _curDesc( m_seqTypes[i]); + TypeDescription _curDesc( rType ); _curDesc.makeComplete(); typelib_InterfaceTypeDescription * pInterface= reinterpret_cast<typelib_InterfaceTypeDescription*>(_curDesc.get()); if( pInterface) diff --git a/extensions/source/update/check/updatecheckconfig.hxx b/extensions/source/update/check/updatecheckconfig.hxx index 2ee5f3ebaead..6215161d0b0b 100644 --- a/extensions/source/update/check/updatecheckconfig.hxx +++ b/extensions/source/update/check/updatecheckconfig.hxx @@ -186,17 +186,17 @@ private: template <typename T> T getValue( const css::uno::Sequence< css::beans::NamedValue >& rNamedValues, const char * pszName ) { - for( sal_Int32 n=0; n < rNamedValues.getLength(); n++ ) + for( css::beans::NamedValue const & nv : rNamedValues ) { // Unfortunately gcc-3.3 does not like Any.get<T>(); - if( rNamedValues[n].Name.equalsAscii( pszName ) ) + if( nv.Name.equalsAscii( pszName ) ) { T value = T(); - if( ! (rNamedValues[n].Value >>= value) ) + if( ! (nv.Value >>= value) ) throw css::uno::RuntimeException( OUString( cppu_Any_extraction_failure_msg( - &rNamedValues[n].Value, + &nv.Value, ::cppu::getTypeFavourUnsigned(&value).getTypeLibType() ), SAL_NO_ACQUIRE ), css::uno::Reference< css::uno::XInterface >() ); diff --git a/extensions/source/update/check/updatehdl.cxx b/extensions/source/update/check/updatehdl.cxx index a857ea8af76c..60a9b441ec91 100644 --- a/extensions/source/update/check/updatehdl.cxx +++ b/extensions/source/update/check/updatehdl.cxx @@ -755,9 +755,9 @@ void UpdateHandler::insertControlModel( uno::Reference< awt::XControlModel > con uno::Reference< awt::XControlModel > xModel (xFactory->createInstance (rServiceName), uno::UNO_QUERY_THROW); uno::Reference< beans::XPropertySet > xPropSet (xModel, uno::UNO_QUERY_THROW); - for (sal_Int32 i = 0, n = rProps.getLength(); i < n; i++) + for (beans::NamedValue const & prop : rProps) { - xPropSet->setPropertyValue (rProps[i].Name, rProps[i].Value); + xPropSet->setPropertyValue (prop.Name, prop.Value); } // @see awt/UnoControlDialogElement.idl @@ -881,9 +881,9 @@ bool UpdateHandler::showWarning( const OUString &rWarningText, { uno::Sequence< uno::Reference< awt::XWindow > > xChildren = xMsgBoxCtrls->getWindows(); - for ( long i=0; i < xChildren.getLength(); i++ ) + for ( uno::Reference< awt::XWindow > const & child : xChildren ) { - uno::Reference< awt::XVclWindowPeer > xMsgBoxCtrl( xChildren[i], uno::UNO_QUERY ); + uno::Reference< awt::XVclWindowPeer > xMsgBoxCtrl( child, uno::UNO_QUERY ); if ( xMsgBoxCtrl.is() ) { bool bIsDefault = true; |