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()
OSL_ENSURE(m_pImpl.get(),"Illegal CTor call, use the other one!");
if( m_pImpl.get() )
{
std::vector<sal_Int32>::const_iterator aIter = m_pImpl->aChangedColumns.begin();
for(;aIter != m_pImpl->aChangedColumns.end();++aIter)
for (auto const& changedColumn : m_pImpl->aChangedColumns)
{
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() )
m_pRowSet->fireProperty(PROPERTY_ID_ISMODIFIED,true,false, ORowSetBase::GrantNotifierAccess());
......
......@@ -1723,19 +1723,14 @@ void ORowSetCache::impl_updateRowFromCache_throw(ORowSetValueVector::Vector& io_
{
if ( o_ChangedColumns.size() > 1 )
{
ORowSetMatrix::const_iterator aIter = m_pMatrix->begin();
for(;aIter != m_pMatrix->end();++aIter)
for (auto const& elem : *m_pMatrix)
{
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;
}
}
if ( aIter == m_pMatrix->end() )
{
m_xCacheSet->fillMissingValues(io_aRow);
}
m_xCacheSet->fillMissingValues(io_aRow);
}
}
......
......@@ -1087,20 +1087,17 @@ void SAL_CALL SbaXFormAdapter::dispose()
m_aContainerListeners.disposeAndClear(aEvt);
// dispose all children
for ( std::vector< Reference< css::form::XFormComponent > >::const_iterator aIter = m_aChildren.begin();
aIter != m_aChildren.end();
++aIter
)
for (auto const& child : m_aChildren)
{
Reference< css::beans::XPropertySet > xSet(*aIter, UNO_QUERY);
Reference< css::beans::XPropertySet > xSet(child, UNO_QUERY);
if (xSet.is())
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())
xChild->setParent(Reference< XInterface > ());
Reference< css::lang::XComponent > xComp(*aIter, UNO_QUERY);
Reference< css::lang::XComponent > xComp(child, UNO_QUERY);
if (xComp.is())
xComp->dispose();
}
......
......@@ -1643,8 +1643,8 @@ static OUString concatComment( const OUString& rQuery, const std::vector< Commen
// Obtaining the needed size once should be faster than reallocating.
// Also add a blank or linefeed for each comment.
sal_Int32 nBufSize = nLen + nComments;
for (std::vector< CommentStrip >::const_iterator it( rComments.begin()); it != rComments.end(); ++it)
nBufSize += (*it).maComment.getLength();
for (auto const& comment : rComments)
nBufSize += comment.maComment.getLength();
OUStringBuffer aBuf( nBufSize );
sal_Int32 nIndBeg = 0;
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