Minor SELECTION_TOOL fixes.

This commit is contained in:
Maciej Suminski 2015-06-16 14:51:39 +02:00
parent c007e308f8
commit dd5275f6c6
3 changed files with 4 additions and 12 deletions

View File

@ -120,7 +120,7 @@ bool ACTION_MANAGER::RunHotKey( int aHotKey ) const
// different combination
if( it == m_actionHotKeys.end() )
{
it = m_actionHotKeys.find( key | (mod & ~MD_SHIFT) );
it = m_actionHotKeys.find( key | ( mod & ~MD_SHIFT ) );
if( it == m_actionHotKeys.end() )
return false; // no appropriate action found for the hotkey

View File

@ -220,7 +220,7 @@ private:
{
const SELECTION& selection = m_selectionTool->GetSelection();
if( selection.items.GetCount() > 1 )
if( selection.items.GetCount() != 1 )
return NULL;
BOARD_ITEM* item = selection.Item<BOARD_ITEM>( 0 );

View File

@ -1325,16 +1325,8 @@ bool SELECTION_TOOL::SanitizeSelection()
}
}
while( !rejected.empty () )
{
BOARD_ITEM* item = *rejected.begin();
int itemIdx = m_selection.items.FindItem( item );
if( itemIdx >= 0 )
m_selection.items.RemovePicker( itemIdx );
rejected.erase( item );
}
BOOST_FOREACH( BOARD_ITEM* item, rejected )
unselect( item );
return true;
}