Kaydet (Commit) 21aee98e authored tarafından Michael Meeks's avatar Michael Meeks Kaydeden (comit) Andras Timar

tdf#92434 - fix iteration, and remember to disposeAndClear.

Change-Id: Id9c7b33689ea51a18394a96acbb9c08d67992942
Reviewed-on: https://gerrit.libreoffice.org/16671Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarMichael Meeks <michael.meeks@collabora.com>
Tested-by: 's avatarMichael Meeks <michael.meeks@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/16685Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst ee70923a
...@@ -246,7 +246,7 @@ sal_uLong OJoinTableView::GetTabWinCount() ...@@ -246,7 +246,7 @@ sal_uLong OJoinTableView::GetTabWinCount()
return m_aTableMap.size(); return m_aTableMap.size();
} }
bool OJoinTableView::RemoveConnection( OTableConnection* _pConn,bool _bDelete ) bool OJoinTableView::RemoveConnection( OTableConnection* _pConn, bool _bDelete )
{ {
DeselectConn(_pConn); DeselectConn(_pConn);
...@@ -255,8 +255,12 @@ bool OJoinTableView::RemoveConnection( OTableConnection* _pConn,bool _bDelete ) ...@@ -255,8 +255,12 @@ bool OJoinTableView::RemoveConnection( OTableConnection* _pConn,bool _bDelete )
m_pView->getController().removeConnectionData( _pConn->GetData() ); m_pView->getController().removeConnectionData( _pConn->GetData() );
m_vTableConnection.erase( auto it = ::std::find(m_vTableConnection.begin(),m_vTableConnection.end(),_pConn);
::std::find(m_vTableConnection.begin(),m_vTableConnection.end(),_pConn) ); if (it != m_vTableConnection.end())
{
it->disposeAndClear();
m_vTableConnection.erase( it );
}
modified(); modified();
if ( m_pAccessible ) if ( m_pAccessible )
...@@ -983,10 +987,13 @@ void OJoinTableView::ClearAll() ...@@ -983,10 +987,13 @@ void OJoinTableView::ClearAll()
HideTabWins(); HideTabWins();
// and the same with the Connections // and the same with the Connections
auto aIter = m_vTableConnection.begin(); while(true)
auto aEnd = m_vTableConnection.end(); {
for(;aIter != aEnd;++aIter) auto aIter = m_vTableConnection.begin();
RemoveConnection( *aIter ,true); if (aIter == m_vTableConnection.end())
break;
RemoveConnection(*aIter, true);
}
m_vTableConnection.clear(); m_vTableConnection.clear();
m_pLastFocusTabWin = NULL; m_pLastFocusTabWin = NULL;
......
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