From 70fe9f329114d76ce59bad440d4a05e637dce977 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Mon, 28 Aug 2017 18:49:50 +0200 Subject: [PATCH] Remove inappropriate assertion New line is not always marked by 2-character (\r\n) sequence. It can be also 1-character (\r) for RichText controls or even no mark at all (for wrapped line). --- src/msw/textctrl.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/msw/textctrl.cpp b/src/msw/textctrl.cpp index 34daff6cce..4c471dde28 100644 --- a/src/msw/textctrl.cpp +++ b/src/msw/textctrl.cpp @@ -1557,7 +1557,8 @@ bool wxTextCtrl::PositionToXY(long pos, long *x, long *y) const // so we need to take into account new line characters which were // not counted by EM_LINELENGTH. long lineLengthFull = charIndexNextLn - charIndex; - wxASSERT(lineLengthFull - lineLength == 2); // In case. + // (lineLengthFull - lineLength) can be 0 (for wrapped line), + // 1 (for \r new line mark) or 2 (for \r\n new line mark). if ( pos > lineLengthFull ) { return false;