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:
@@ -41,10 +41,10 @@ wxString wxTextEntryBase::GetRange(long from, long to) const
|
||||
{
|
||||
wxString sel;
|
||||
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;
|
||||
|
Reference in New Issue
Block a user