Kaydet (Commit) f2dafc6e authored tarafından Julien Nabet's avatar Julien Nabet

Use for-range loops in dbaccess

Change-Id: I0be3aba4f03dcaba188670548901e4aef59c5ec0
Reviewed-on: https://gerrit.libreoffice.org/47148Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarJulien Nabet <serval2412@yahoo.fr>
üst 271a663d
...@@ -1427,10 +1427,9 @@ void ORowSetNotifier::firePropertyChange() ...@@ -1427,10 +1427,9 @@ void ORowSetNotifier::firePropertyChange()
OSL_ENSURE(m_pImpl.get(),"Illegal CTor call, use the other one!"); OSL_ENSURE(m_pImpl.get(),"Illegal CTor call, use the other one!");
if( m_pImpl.get() ) if( m_pImpl.get() )
{ {
std::vector<sal_Int32>::const_iterator aIter = m_pImpl->aChangedColumns.begin(); for (auto const& changedColumn : m_pImpl->aChangedColumns)
for(;aIter != m_pImpl->aChangedColumns.end();++aIter)
{ {
m_pRowSet->firePropertyChange((*aIter)-1 ,m_pImpl->aRow[(*aIter)-1], ORowSetBase::GrantNotifierAccess()); m_pRowSet->firePropertyChange(changedColumn-1 ,m_pImpl->aRow[changedColumn-1], ORowSetBase::GrantNotifierAccess());
} }
if ( !m_pImpl->aChangedColumns.empty() ) if ( !m_pImpl->aChangedColumns.empty() )
m_pRowSet->fireProperty(PROPERTY_ID_ISMODIFIED,true,false, ORowSetBase::GrantNotifierAccess()); m_pRowSet->fireProperty(PROPERTY_ID_ISMODIFIED,true,false, ORowSetBase::GrantNotifierAccess());
......
...@@ -1723,19 +1723,14 @@ void ORowSetCache::impl_updateRowFromCache_throw(ORowSetValueVector::Vector& io_ ...@@ -1723,19 +1723,14 @@ void ORowSetCache::impl_updateRowFromCache_throw(ORowSetValueVector::Vector& io_
{ {
if ( o_ChangedColumns.size() > 1 ) if ( o_ChangedColumns.size() > 1 )
{ {
ORowSetMatrix::const_iterator aIter = m_pMatrix->begin(); for (auto const& elem : *m_pMatrix)
for(;aIter != m_pMatrix->end();++aIter)
{ {
if ( aIter->is() && m_xCacheSet->updateColumnValues((*aIter)->get(),io_aRow,o_ChangedColumns)) if ( elem.is() && m_xCacheSet->updateColumnValues(elem->get(),io_aRow,o_ChangedColumns))
{ {
break; return;
} }
} }
m_xCacheSet->fillMissingValues(io_aRow);
if ( aIter == m_pMatrix->end() )
{
m_xCacheSet->fillMissingValues(io_aRow);
}
} }
} }
......
...@@ -1087,20 +1087,17 @@ void SAL_CALL SbaXFormAdapter::dispose() ...@@ -1087,20 +1087,17 @@ void SAL_CALL SbaXFormAdapter::dispose()
m_aContainerListeners.disposeAndClear(aEvt); m_aContainerListeners.disposeAndClear(aEvt);
// dispose all children // dispose all children
for ( std::vector< Reference< css::form::XFormComponent > >::const_iterator aIter = m_aChildren.begin(); for (auto const& child : m_aChildren)
aIter != m_aChildren.end();
++aIter
)
{ {
Reference< css::beans::XPropertySet > xSet(*aIter, UNO_QUERY); Reference< css::beans::XPropertySet > xSet(child, UNO_QUERY);
if (xSet.is()) if (xSet.is())
xSet->removePropertyChangeListener(PROPERTY_NAME, static_cast<css::beans::XPropertyChangeListener*>(this)); xSet->removePropertyChangeListener(PROPERTY_NAME, static_cast<css::beans::XPropertyChangeListener*>(this));
Reference< css::container::XChild > xChild(*aIter, UNO_QUERY); Reference< css::container::XChild > xChild(child, UNO_QUERY);
if (xChild.is()) if (xChild.is())
xChild->setParent(Reference< XInterface > ()); xChild->setParent(Reference< XInterface > ());
Reference< css::lang::XComponent > xComp(*aIter, UNO_QUERY); Reference< css::lang::XComponent > xComp(child, UNO_QUERY);
if (xComp.is()) if (xComp.is())
xComp->dispose(); xComp->dispose();
} }
......
...@@ -1643,8 +1643,8 @@ static OUString concatComment( const OUString& rQuery, const std::vector< Commen ...@@ -1643,8 +1643,8 @@ static OUString concatComment( const OUString& rQuery, const std::vector< Commen
// Obtaining the needed size once should be faster than reallocating. // Obtaining the needed size once should be faster than reallocating.
// Also add a blank or linefeed for each comment. // Also add a blank or linefeed for each comment.
sal_Int32 nBufSize = nLen + nComments; sal_Int32 nBufSize = nLen + nComments;
for (std::vector< CommentStrip >::const_iterator it( rComments.begin()); it != rComments.end(); ++it) for (auto const& comment : rComments)
nBufSize += (*it).maComment.getLength(); nBufSize += comment.maComment.getLength();
OUStringBuffer aBuf( nBufSize ); OUStringBuffer aBuf( nBufSize );
sal_Int32 nIndBeg = 0; sal_Int32 nIndBeg = 0;
sal_Int32 nIndLF = rQuery.indexOf('\n'); sal_Int32 nIndLF = rQuery.indexOf('\n');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment