Kaydet (Commit) e55f83e1 authored tarafından Caolán McNamara's avatar Caolán McNamara

Resolves: tdf#97854 crash on deleting inner join relationship

seems to be a regression from...

commit 356bc0f6
Author: Michael Meeks <michael.meeks@collabora.com>
Date:   Wed Jul 1 19:03:55 2015 +0100

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

which is part of the VclPtr stuff

so hold the connection by VclPtr when removing it from m_vTableConnection
and only call dispose on it when _bDelete is true, not always.

Change-Id: I38e65c6928499dc1e8bbf6b71e9901a4eaa5d913
üst 77829f92
......@@ -244,27 +244,24 @@ sal_uLong OJoinTableView::GetTabWinCount()
bool OJoinTableView::RemoveConnection( OTableConnection* _pConn, bool _bDelete )
{
DeselectConn(_pConn);
VclPtr<OTableConnection> xConn(_pConn);
DeselectConn(xConn);
// to force a redraw
_pConn->InvalidateConnection();
xConn->InvalidateConnection();
m_pView->getController().removeConnectionData( _pConn->GetData() );
m_pView->getController().removeConnectionData(xConn->GetData());
auto it = ::std::find(m_vTableConnection.begin(),m_vTableConnection.end(),_pConn);
if (it != m_vTableConnection.end())
{
it->disposeAndClear();
m_vTableConnection.erase( it );
}
m_vTableConnection.erase(std::find(m_vTableConnection.begin(), m_vTableConnection.end(), xConn));
modified();
if ( m_pAccessible )
m_pAccessible->notifyAccessibleEvent( AccessibleEventId::CHILD,
makeAny(_pConn->GetAccessible()),
makeAny(xConn->GetAccessible()),
Any());
if ( _bDelete )
_pConn->disposeOnce();
if (_bDelete)
xConn->disposeOnce();
return true;
}
......
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