X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f6bcfd974ef26faf6f91a62cac09827e09463fd1..53e46b61bbe4ce72b92c8898907f0a879d5f012b:/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 );