Optimize test for the row/column selection
Use wxGridSelection::IsInSelection() instead of GetSelectedRows/Cols() which can be much slower as they need to produce an array containing indices of all the selected rows/columns.
This commit is contained in:
parent
ee0b70a3a9
commit
4cde93cc82
@ -3748,7 +3748,7 @@ void wxGrid::ProcessRowLabelMouseEvent( wxMouseEvent& event, wxGridRowLabelWindo
|
|||||||
}
|
}
|
||||||
else if ( event.CmdDown() && !event.ShiftDown() )
|
else if ( event.CmdDown() && !event.ShiftDown() )
|
||||||
{
|
{
|
||||||
if ( GetSelectedRows().Index(row) != wxNOT_FOUND )
|
if ( m_selection->IsInSelection(row, 0) )
|
||||||
{
|
{
|
||||||
DeselectRow(row);
|
DeselectRow(row);
|
||||||
makeRowCurrent = true;
|
makeRowCurrent = true;
|
||||||
@ -4159,7 +4159,7 @@ void wxGrid::ProcessColLabelMouseEvent( wxMouseEvent& event, wxGridColLabelWindo
|
|||||||
}
|
}
|
||||||
else if ( event.CmdDown() && !event.ShiftDown() )
|
else if ( event.CmdDown() && !event.ShiftDown() )
|
||||||
{
|
{
|
||||||
if ( GetSelectedCols().Index(col) != wxNOT_FOUND )
|
if ( m_selection->IsInSelection(0, col) )
|
||||||
{
|
{
|
||||||
DeselectCol(col);
|
DeselectCol(col);
|
||||||
makeColCurrent = true;
|
makeColCurrent = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user