From: Vadim Zeitlin Date: Tue, 10 Aug 2010 22:39:04 +0000 (+0000) Subject: Fix line indices translation in wxGrid::DoEndDragResizeLine(). X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/133506215101bd8cffbf81e6c36944f7d5e2f8db Fix line indices translation in wxGrid::DoEndDragResizeLine(). We used the translation in wrong direction, i.e. interpreted x coordinates as rows and y coordinates as columns. This could result in passing invalid cell indices to GetCellSize() and was generally completely wrong. Closes #12311. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65242 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp index 0968444786..34f232f3bd 100644 --- a/src/generic/grid.cpp +++ b/src/generic/grid.cpp @@ -4132,13 +4132,13 @@ bool wxGrid::DoEndDragResizeLine(const wxGridOperations& oper) oper.SelectSize(rect) = oper.Select(size); int subtractLines = 0; - const int lineStart = oper.PosToLine(this, posLineStart); + const int lineStart = doper.PosToLine(this, posLineStart); if ( lineStart >= 0 ) { // ensure that if we have a multi-cell block we redraw all of // it by increasing the refresh area to cover it entirely if a // part of it is affected - const int lineEnd = oper.PosToLine(this, posLineEnd, true); + const int lineEnd = doper.PosToLine(this, posLineEnd, true); for ( int line = lineStart; line < lineEnd; line++ ) { int cellLines = oper.Select(