fix index checking in GetRange()

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54777 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2008-07-24 00:05:14 +00:00
parent 5166d04e4f
commit 2b42a87073

View File

@@ -42,9 +42,9 @@ wxString wxTextEntryBase::GetRange(long from, long to) const
wxString sel; wxString sel;
wxString value = GetValue(); wxString value = GetValue();
if ((from < to) && ((long)value.length() >= to + from)) if ( from < to && (long)value.length() >= to )
{ {
sel = GetValue().substr(from, to - from); sel = value.substr(from, to - from);
} }
return sel; return sel;