diff options
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/forms/elementexport.cxx | 15 | ||||
-rw-r--r-- | xmloff/source/forms/formcellbinding.cxx | 4 | ||||
-rw-r--r-- | xmloff/source/forms/gridcolumnproptranslator.cxx | 8 | ||||
-rw-r--r-- | xmloff/source/xforms/xformsexport.cxx | 9 | ||||
-rw-r--r-- | xmloff/source/xforms/xformsimport.cxx | 20 |
5 files changed, 21 insertions, 35 deletions
diff --git a/xmloff/source/forms/elementexport.cxx b/xmloff/source/forms/elementexport.cxx index b8787f4cedac..8e8b7aaa559f 100644 --- a/xmloff/source/forms/elementexport.cxx +++ b/xmloff/source/forms/elementexport.cxx @@ -440,16 +440,13 @@ namespace xmloff void OControlExport::exportGenericHandlerAttributes() { const Sequence< Property > aProperties = m_xPropertyInfo->getProperties(); - for ( const Property* prop = aProperties.getConstArray(); - prop != aProperties.getConstArray() + aProperties.getLength(); - ++prop - ) + for ( auto const & prop : aProperties ) { try { // see if this property can already be handled with an IPropertyHandler (which, on the long // term, should be the case for most, if not all, properties) - const PropertyDescription* propDescription = metadata::getPropertyDescription( prop->Name ); + const PropertyDescription* propDescription = metadata::getPropertyDescription( prop.Name ); if ( propDescription == nullptr ) continue; @@ -466,15 +463,15 @@ namespace xmloff if ( propDescription->propertyGroup == NO_GROUP ) { // that's a property which has a direct mapping to an attribute - if ( !shouldExportProperty( prop->Name ) ) + if ( !shouldExportProperty( prop.Name ) ) // TODO: in the future, we surely need a more sophisticated approach to this, involving the property // handler, or the property description { - exportedProperty( prop->Name ); + exportedProperty( prop.Name ); continue; } - const Any propValue = m_xProps->getPropertyValue( prop->Name ); + const Any propValue = m_xProps->getPropertyValue( prop.Name ); attributeValue = handler->getAttributeValue( propValue ); } else @@ -508,7 +505,7 @@ namespace xmloff attributeValue ); - exportedProperty( prop->Name ); + exportedProperty( prop.Name ); } catch( const Exception& ) { diff --git a/xmloff/source/forms/formcellbinding.cxx b/xmloff/source/forms/formcellbinding.cxx index cd673bc58965..1340901ea420 100644 --- a/xmloff/source/forms/formcellbinding.cxx +++ b/xmloff/source/forms/formcellbinding.cxx @@ -252,8 +252,8 @@ bool FormCellBindingHelper::isSpreadsheetDocumentWhichSupplies( const Reference< aAvailableServices = xDocumentFactory->getAvailableServiceNames( ); const OUString* pFound = ::std::find_if( - aAvailableServices.getConstArray(), - aAvailableServices.getConstArray() + aAvailableServices.getLength(), + aAvailableServices.begin(), + aAvailableServices.end(), StringCompare( _rService ) ); if ( pFound - aAvailableServices.getConstArray() < aAvailableServices.getLength() ) diff --git a/xmloff/source/forms/gridcolumnproptranslator.cxx b/xmloff/source/forms/gridcolumnproptranslator.cxx index e1241a1e600b..db8970a07e23 100644 --- a/xmloff/source/forms/gridcolumnproptranslator.cxx +++ b/xmloff/source/forms/gridcolumnproptranslator.cxx @@ -51,11 +51,9 @@ namespace xmloff sal_Int32 findStringElement( const Sequence< OUString >& _rNames, const OUString& _rName ) { - const OUString* pStart = _rNames.getConstArray(); - const OUString* pEnd = _rNames.getConstArray() + _rNames.getLength(); - const OUString* pPos = ::std::find( pStart, pEnd, _rName ); - if ( pPos != pEnd ) - return pPos - pStart; + const OUString* pPos = ::std::find( _rNames.begin(), _rNames.end(), _rName ); + if ( pPos != _rNames.end() ) + return pPos - _rNames.begin(); return -1; } 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 ); } } } |