Fixed segfault in selection tool. (fixes lp:1542856)
This commit is contained in:
parent
e9bfcc28c3
commit
5c3a56bdcc
|
@ -313,9 +313,14 @@ const SELECTION& SELECTION_TOOL::GetSelection()
|
||||||
BOARD_ITEM* item = m_selection.Item<BOARD_ITEM>( i );
|
BOARD_ITEM* item = m_selection.Item<BOARD_ITEM>( i );
|
||||||
|
|
||||||
if( !modifiable( item ) )
|
if( !modifiable( item ) )
|
||||||
|
{
|
||||||
m_selection.items.RemovePicker( i );
|
m_selection.items.RemovePicker( i );
|
||||||
|
m_selection.group->Remove( item );
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
++i;
|
++i;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return m_selection;
|
return m_selection;
|
||||||
|
@ -746,6 +751,9 @@ int SELECTION_TOOL::findMove( const TOOL_EVENT& aEvent )
|
||||||
|
|
||||||
void SELECTION_TOOL::clearSelection()
|
void SELECTION_TOOL::clearSelection()
|
||||||
{
|
{
|
||||||
|
if( m_selection.Empty() )
|
||||||
|
return;
|
||||||
|
|
||||||
KIGFX::VIEW_GROUP::const_iter it, it_end;
|
KIGFX::VIEW_GROUP::const_iter it, it_end;
|
||||||
|
|
||||||
// Restore the initial properties
|
// Restore the initial properties
|
||||||
|
|
Loading…
Reference in New Issue