diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2018-03-16 23:17:38 +0100 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2018-03-17 08:23:33 +0100 |
commit | 070dbae6b4dc497d6ae898e60203d25b0e608d73 (patch) | |
tree | 3ef340c35b8a189558775e99293f7760cb0ffc41 /forms/source/misc/InterfaceContainer.cxx | |
parent | e673a47767cbd272d206ac50f2ac879d5ba71176 (diff) |
Use for-range loops in forms
Change-Id: I23f63f2a98ce64513f5cb4b06e373b5ec9509d62
Reviewed-on: https://gerrit.libreoffice.org/51445
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'forms/source/misc/InterfaceContainer.cxx')
-rw-r--r-- | forms/source/misc/InterfaceContainer.cxx | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/forms/source/misc/InterfaceContainer.cxx b/forms/source/misc/InterfaceContainer.cxx index 402e433363b7..22f0de5e6279 100644 --- a/forms/source/misc/InterfaceContainer.cxx +++ b/forms/source/misc/InterfaceContainer.cxx @@ -292,12 +292,12 @@ namespace if ( !_rxManager.is() ) return; - ::std::vector< Sequence< ScriptEventDescriptor > >::const_iterator aLoop = _rSave.begin(); - ::std::vector< Sequence< ScriptEventDescriptor > >::const_iterator aEnd = _rSave.end(); - for ( sal_Int32 i=0; aLoop != aEnd; ++aLoop, ++i ) + sal_Int32 i=0; + for (auto const& elem : _rSave) { _rxManager->revokeScriptEvents( i ); - _rxManager->registerScriptEvents( i, *aLoop ); + _rxManager->registerScriptEvents(i, elem); + ++i; } } } @@ -427,13 +427,12 @@ void SAL_CALL OInterfaceContainer::readEvents(const Reference<XObjectInputStream // Read Attachment if ( m_xEventAttacher.is() ) { - OInterfaceArray::const_iterator aAttach = m_aItems.begin(); - OInterfaceArray::const_iterator aAttachEnd = m_aItems.end(); - for ( sal_Int32 i=0; aAttach != aAttachEnd; ++aAttach, ++i ) + sal_Int32 i=0; + for (auto const& item : m_aItems) { - Reference< XInterface > xAsIFace( *aAttach, UNO_QUERY ); // important to normalize this .... + Reference< XInterface > xAsIFace( item, UNO_QUERY ); // important to normalize this .... Reference< XPropertySet > xAsSet( xAsIFace, UNO_QUERY ); - m_xEventAttacher->attach( i, xAsIFace, makeAny( xAsSet ) ); + m_xEventAttacher->attach( i++, xAsIFace, makeAny( xAsSet ) ); } } } |