From 2d5c15163a2e346c30fe3136e6668a20bab7d7d2 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 30 Jul 2011 21:54:08 +0000 Subject: [PATCH] Fix off by one error in wxTextCtrl::GetLineLength() in wxOSX. The trailing new line shouldn't be counted in the line length. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68464 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/osx/textctrl_osx.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/osx/textctrl_osx.cpp b/src/osx/textctrl_osx.cpp index 0af4f04bcc..8c2f1d83da 100644 --- a/src/osx/textctrl_osx.cpp +++ b/src/osx/textctrl_osx.cpp @@ -775,9 +775,10 @@ int wxTextWidgetImpl::GetLineLength(long lineNo) const count = 0; for (size_t j = i; j < content.length(); j++) { - count++; if (content[j] == '\n') return count; + + count++; } return count; -- 2.45.2