X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ce364c4ecd5e313e62eb7107dab59b52f267bccb..1af67319a7c54373c85a15477f59a72f3e929268:/src/stc/stc.h.in diff --git a/src/stc/stc.h.in b/src/stc/stc.h.in index abbfe19b2a..1c980ab3cc 100644 --- a/src/stc/stc.h.in +++ b/src/stc/stc.h.in @@ -370,8 +370,18 @@ public: // implement wxTextAreaBase pure virtual methods // --------------------------------------------- - virtual int GetLineLength(long n) const { return GetLine(n).length(); } - virtual wxString GetLineText(long n) const { return GetLine(n); } + virtual int GetLineLength(long lineNo) const { return static_cast(GetLineText(lineNo).length()); } + virtual wxString GetLineText(long lineNo) const + { + wxString text = GetLine(static_cast(lineNo)); + size_t lastNewLine = text.find_last_not_of(wxS("\r\n")); + + if ( lastNewLine != wxString::npos ) + text.erase(lastNewLine + 1); // remove trailing cr+lf + else + text.clear(); + return text; + } virtual int GetNumberOfLines() const { return GetLineCount(); } virtual bool IsModified() const { return GetModify(); }