Kaydet (Commit) 345303a6 authored tarafından Herbert Dürr's avatar Herbert Dürr

#i123418# prevent iterator decrement when it is at begin()

also prevent derefencing of an iterator after it has been erased
üst 67a5b7b9
...@@ -1408,23 +1408,26 @@ void SAL_CALL SbaTableQueryBrowser::disposing( const EventObject& _rSource ) thr ...@@ -1408,23 +1408,26 @@ void SAL_CALL SbaTableQueryBrowser::disposing( const EventObject& _rSource ) thr
{ {
for ( ExternalFeaturesMap::iterator aLoop = m_aExternalFeatures.begin(); for ( ExternalFeaturesMap::iterator aLoop = m_aExternalFeatures.begin();
aLoop != m_aExternalFeatures.end(); aLoop != m_aExternalFeatures.end();
++aLoop
) )
{ {
if ( aLoop->second.xDispatcher.get() == xSource.get() ) if ( aLoop->second.xDispatcher.get() != xSource.get() ) {
{ ++aLoop;
ExternalFeaturesMap::iterator aPrevious = aLoop; continue;
--aPrevious; }
// remove it // prepare to erase the aLoop iterator
m_aExternalFeatures.erase( aLoop ); const sal_uInt16 nSlotId = aLoop->first;
ExternalFeaturesMap::iterator aNext = aLoop;
++aNext;
// maybe update the UI // remove it
implCheckExternalSlot(aLoop->first); m_aExternalFeatures.erase( aLoop );
// continue, the same XDispatch may be resposible for more than one URL // maybe update the UI
aLoop = aPrevious; implCheckExternalSlot( nSlotId );
}
// continue, the same XDispatch may be resposible for more than one URL
aLoop = aNext;
} }
} }
else else
......
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