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:
Andreas Falkenhahn
2019-07-07 03:35:21 +02:00
committed by Vadim Zeitlin
parent 6e556d4a71
commit c3ce5244e3
6 changed files with 24 additions and 7 deletions

View File

@@ -1803,6 +1803,9 @@ int wxTextCtrl::GetLineLength(long lineNo) const
{
long pos = XYToPosition(0, lineNo);
if ( pos == -1 )
return -1;
return GetLengthOfLineContainingPos(pos);
}