Return -1 from GetLineLength() if line number is out of range
Make wxTextCtrl behaviour in all ports consistent with the documentation and also update wxStyledTextCtrl to behave accordingly. Closes #18431.
This commit is contained in:
committed by
Vadim Zeitlin
parent
6e556d4a71
commit
c3ce5244e3
@@ -1684,8 +1684,8 @@ int wxTextCtrl::GetLineLength(wxTextCoord line) const
|
||||
}
|
||||
else // multiline
|
||||
{
|
||||
wxCHECK_MSG( (size_t)line < GetLineCount(), -1,
|
||||
wxT("line index out of range") );
|
||||
if ( line < 0 || line >= GetLineCount() )
|
||||
return -1;
|
||||
|
||||
return GetLines()[line].length();
|
||||
}
|
||||
|
Reference in New Issue
Block a user