X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/12c1b46a2f848ce995590997d5a28559ee6e3ae9..80a58c9968cc740b50fb92cd95d6a014a1c6e9bf:/src/generic/listctrl.cpp diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp index 6421ecff52..cb0696824c 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -952,11 +952,11 @@ void wxListHeaderWindow::OnMouse( wxMouseEvent &event ) m_minX = 0; bool hit_border = FALSE; int xpos = 0; - for (int j = 0; j < m_owner->GetColumnCount()-1; j++) + for (int j = 0; j < m_owner->GetColumnCount(); j++) { xpos += m_owner->GetColumnWidth( j ); m_column = j; - if ((abs(x-xpos) < 3) && (y < 22)) + if ((abs(x-xpos) < 3) && (y < 22) && (m_column < m_owner->GetColumnCount()-1)) { hit_border = TRUE; break;