Resolves: tdf#97854 crash on deleting inner join relationship
seems to be a regression from...
commit 356bc0f697
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
This commit is contained in:
@@ -244,27 +244,24 @@ sal_uLong OJoinTableView::GetTabWinCount()
|
|||||||
|
|
||||||
bool OJoinTableView::RemoveConnection( OTableConnection* _pConn, bool _bDelete )
|
bool OJoinTableView::RemoveConnection( OTableConnection* _pConn, bool _bDelete )
|
||||||
{
|
{
|
||||||
DeselectConn(_pConn);
|
VclPtr<OTableConnection> xConn(_pConn);
|
||||||
|
|
||||||
|
DeselectConn(xConn);
|
||||||
|
|
||||||
// to force a redraw
|
// 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);
|
m_vTableConnection.erase(std::find(m_vTableConnection.begin(), m_vTableConnection.end(), xConn));
|
||||||
if (it != m_vTableConnection.end())
|
|
||||||
{
|
|
||||||
it->disposeAndClear();
|
|
||||||
m_vTableConnection.erase( it );
|
|
||||||
}
|
|
||||||
|
|
||||||
modified();
|
modified();
|
||||||
if ( m_pAccessible )
|
if ( m_pAccessible )
|
||||||
m_pAccessible->notifyAccessibleEvent( AccessibleEventId::CHILD,
|
m_pAccessible->notifyAccessibleEvent( AccessibleEventId::CHILD,
|
||||||
makeAny(_pConn->GetAccessible()),
|
makeAny(xConn->GetAccessible()),
|
||||||
Any());
|
Any());
|
||||||
if ( _bDelete )
|
if (_bDelete)
|
||||||
_pConn->disposeOnce();
|
xConn->disposeOnce();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user