diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-05-20 13:45:07 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-05-21 08:48:26 +0200 |
commit | 89340fcb6509afd1bffea7b6060d5ff5a444b3f1 (patch) | |
tree | d5ae1feaeed8b67afb89b71e642b6306dd4ebc37 /forms | |
parent | f94aae5cbab5b826ea8821e9ed3b456d65c03c70 (diff) |
use for-range on Sequence in f*
Change-Id: I820255001c1b96d1f4b76a203f3c0f76fa09fe66
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94567
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'forms')
-rw-r--r-- | forms/qa/org/openoffice/xforms/Instance.java | 2 | ||||
-rw-r--r-- | forms/source/xforms/model_helper.hxx | 10 | ||||
-rw-r--r-- | forms/source/xforms/xpathlib/extension.cxx | 4 |
3 files changed, 7 insertions, 9 deletions
diff --git a/forms/qa/org/openoffice/xforms/Instance.java b/forms/qa/org/openoffice/xforms/Instance.java index d98c647a959f..53e9452df72a 100644 --- a/forms/qa/org/openoffice/xforms/Instance.java +++ b/forms/qa/org/openoffice/xforms/Instance.java @@ -92,7 +92,7 @@ public class Instance private XNode removeNode( XNode _parentElement, String _elementName ) throws DOMException { XNodeList nodes = _parentElement.getChildNodes(); - for ( int i=0; i<nodes.getLength(); ++i ) + for ( int i=0; i<nodes.(); ++i ) { XNode node = nodes.item(i); if ( node.getLocalName().equals( _elementName ) ) diff --git a/forms/source/xforms/model_helper.hxx b/forms/source/xforms/model_helper.hxx index 592649f839de..59056bf26e62 100644 --- a/forms/source/xforms/model_helper.hxx +++ b/forms/source/xforms/model_helper.hxx @@ -109,14 +109,12 @@ class InstanceCollection : public Collection<css::uno::Sequence<css::beans::Prop public: virtual bool isValid( const T& t ) const override { - const css::beans::PropertyValue* pValues = t.getConstArray(); - OUString sInstance( "Instance" ); - bool bFound = false; - for( sal_Int32 i = 0; ( ! bFound ) && ( i < t.getLength() ); i++ ) + for( const css::beans::PropertyValue& rProp : t ) { - bFound |= ( pValues[i].Name == sInstance ); + if (rProp.Name == "Instance" ) + return true; } - return bFound; + return false; } }; diff --git a/forms/source/xforms/xpathlib/extension.cxx b/forms/source/xforms/xpathlib/extension.cxx index d5c26c1e63f6..0af6a3eb17db 100644 --- a/forms/source/xforms/xpathlib/extension.cxx +++ b/forms/source/xforms/xpathlib/extension.cxx @@ -53,9 +53,9 @@ void SAL_CALL CLibxml2XFormsExtension::initialize(const Sequence< Any >& aSequen } NamedValue aValue; - for (sal_Int32 i = 0; i < aSequence.getLength(); i++) + for (const Any& rArg : aSequence) { - if (! (aSequence[i] >>= aValue)) + if (! (rArg >>= aValue)) throw RuntimeException(); if ( aValue.Name == "Model" ) aValue.Value >>= m_aModel; |