Slightly optimize Shift/Control-clicking in wxTR_MULTIPLE case
Don't call GetSelections() unnecessarily if we're not going to use its result in any case because either Shift or Command/Control key was pressed when the mouse button was released. See #18680.
This commit is contained in:
@@ -3790,14 +3790,10 @@ void wxGenericTreeCtrl::OnMouse( wxMouseEvent &event )
|
||||
}
|
||||
|
||||
// this facilitates multiple-item drag-and-drop
|
||||
if ( HasFlag(wxTR_MULTIPLE))
|
||||
if ( HasFlag(wxTR_MULTIPLE) && !(event.CmdDown() || event.ShiftDown()) )
|
||||
{
|
||||
wxArrayTreeItemIds selections;
|
||||
size_t count = GetSelections(selections);
|
||||
|
||||
if (count > 1 &&
|
||||
!event.CmdDown() &&
|
||||
!event.ShiftDown())
|
||||
if ( GetSelections(selections) > 1 )
|
||||
{
|
||||
DoSelectItem(item, true, false);
|
||||
}
|
||||
|
Reference in New Issue
Block a user