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
This commit is contained in:
Vadim Zeitlin
2013-02-05 20:46:03 +00:00
parent 8f9e2a5558
commit 7c99eaa1f8

View File

@@ -692,7 +692,10 @@ public:
{ return grid->GetColPos(line); } { return grid->GetColPos(line); }
virtual int GetLineBefore(const wxGrid* grid, int line) const 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 virtual wxWindow *GetHeaderWindow(wxGrid *grid) const
{ return grid->GetGridColLabelWindow(); } { return grid->GetGridColLabelWindow(); }