X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f6bcfd974ef26faf6f91a62cac09827e09463fd1..98ec9dbebc5584ba1b903d314b25e8c562891483:/src/generic/gridsel.cpp diff --git a/src/generic/gridsel.cpp b/src/generic/gridsel.cpp index f6e4b2ba71..2781694fb5 100644 --- a/src/generic/gridsel.cpp +++ b/src/generic/gridsel.cpp @@ -402,7 +402,11 @@ void wxGridSelection::SelectBlock( int topRow, int leftCol, } // Handle single cell selection in SelectCell. - if ( topRow == bottomRow && leftCol == rightCol ) + // (MB: added check for selection mode here to prevent + // crashes if, for example, we are select rows and the + // grid only has 1 col) + if ( m_selectionMode == wxGrid::wxGridSelectCells && + topRow == bottomRow && leftCol == rightCol ) SelectCell( topRow, leftCol, ControlDown, ShiftDown, AltDown, MetaDown, sendEvent );