From: Vadim Zeitlin Date: Tue, 5 Feb 2013 20:46:03 +0000 (+0000) Subject: Fix wxGridColumnOperations::GetLineBefore() for the first column. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/7c99eaa1f887bbde4e8cd45d9e8f34c62240f629 Fix wxGridColumnOperations::GetLineBefore() for the first column. We should return -1 from here as there is no column before the first one and wxGridRowOperations::GetLineBefore() already does this. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73459 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/generic/private/grid.h b/include/wx/generic/private/grid.h index 39ca13794a..921aea39d4 100644 --- a/include/wx/generic/private/grid.h +++ b/include/wx/generic/private/grid.h @@ -692,7 +692,10 @@ public: { return grid->GetColPos(line); } virtual int GetLineBefore(const wxGrid* grid, int line) const - { return grid->GetColAt(wxMax(0, grid->GetColPos(line) - 1)); } + { + int posBefore = grid->GetColPos(line) - 1; + return posBefore >= 0 ? grid->GetColAt(posBefore) : wxNOT_FOUND; + } virtual wxWindow *GetHeaderWindow(wxGrid *grid) const { return grid->GetGridColLabelWindow(); }