diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-07-05 13:27:30 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-07-06 08:35:23 +0200 |
commit | ab9b38a4064141705aa3a3de9a5d73b465ad3af3 (patch) | |
tree | 888fcc6b517c44d77e2d297c13ee84fb487dd7a7 /xmloff/source/xforms | |
parent | 13341ffa49d58f313a05edae4f4f04c215658e9f (diff) |
use more begin()/end() for Sequence
Change-Id: I399be6b6ef7a6ce01e883569a177c0969bc29c69
Diffstat (limited to 'xmloff/source/xforms')
-rw-r--r-- | xmloff/source/xforms/xformsexport.cxx | 9 | ||||
-rw-r--r-- | xmloff/source/xforms/xformsimport.cxx | 20 |
2 files changed, 10 insertions, 19 deletions
diff --git a/xmloff/source/xforms/xformsexport.cxx b/xmloff/source/xforms/xformsexport.cxx index 262424495bd4..1f0b099507e3 100644 --- a/xmloff/source/xforms/xformsexport.cxx +++ b/xmloff/source/xforms/xformsexport.cxx @@ -775,18 +775,15 @@ void getXFormsSettings( const Reference< XNameAccess >& _rXForms, Sequence< Prop Reference< XNameContainer > xModelSettings = document::NamedPropertyValues::create( comphelper::getProcessComponentContext() ); - for ( const OUString* pModelName = aModelNames.getConstArray(); - pModelName != aModelNames.getConstArray() + aModelNames.getLength(); - ++pModelName - ) + for ( auto const & modelName : aModelNames ) { - Reference< XPropertySet > xModelProps( _rXForms->getByName( *pModelName ), UNO_QUERY_THROW ); + Reference< XPropertySet > xModelProps( _rXForms->getByName( modelName ), UNO_QUERY_THROW ); Sequence< PropertyValue > aModelSettings( 1 ); aModelSettings[0].Name = "ExternalData"; aModelSettings[0].Value = xModelProps->getPropertyValue( aModelSettings[0].Name ); - xModelSettings->insertByName( *pModelName, makeAny( aModelSettings ) ); + xModelSettings->insertByName( modelName, makeAny( aModelSettings ) ); } if ( xModelSettings->hasElements() ) diff --git a/xmloff/source/xforms/xformsimport.cxx b/xmloff/source/xforms/xformsimport.cxx index 12741083741f..160ad26099c1 100644 --- a/xmloff/source/xforms/xformsimport.cxx +++ b/xmloff/source/xforms/xformsimport.cxx @@ -153,38 +153,32 @@ void applyXFormsSettings( const Reference< XNameAccess >& _rXForms, const Sequen try { Sequence< OUString > aSettingsForModels( xModelSettings->getElementNames() ); - for ( const OUString* pModelName = aSettingsForModels.getConstArray(); - pModelName != aSettingsForModels.getConstArray() + aSettingsForModels.getLength(); - ++pModelName - ) + for ( auto const & modelName : aSettingsForModels ) { // the settings for this particular model Sequence< PropertyValue > aModelSettings; - OSL_VERIFY( xModelSettings->getByName( *pModelName ) >>= aModelSettings ); + OSL_VERIFY( xModelSettings->getByName( modelName ) >>= aModelSettings ); // the model itself - if ( !_rXForms->hasByName( *pModelName ) ) + if ( !_rXForms->hasByName( modelName ) ) { OSL_FAIL( "applyXFormsSettings: have settings for a non-existent XForms model!" ); continue; } // propagate the settings, being tolerant by omitting properties which are not supported - Reference< XPropertySet > xModelProps( _rXForms->getByName( *pModelName ), UNO_QUERY_THROW ); + Reference< XPropertySet > xModelProps( _rXForms->getByName( modelName ), UNO_QUERY_THROW ); Reference< XPropertySetInfo > xModelPSI( xModelProps->getPropertySetInfo(), UNO_SET_THROW ); - for ( const PropertyValue* pSetting = aModelSettings.getConstArray(); - pSetting != aModelSettings.getConstArray() + aModelSettings.getLength(); - ++pSetting - ) + for ( auto const & setting : aModelSettings ) { - if ( !xModelPSI->hasPropertyByName( pSetting->Name ) ) + if ( !xModelPSI->hasPropertyByName( setting.Name ) ) { OSL_FAIL( "applyXFormsSettings: non-existent model property!" ); continue; } - xModelProps->setPropertyValue( pSetting->Name, pSetting->Value ); + xModelProps->setPropertyValue( setting.Name, setting.Value ); } } } |