wxString wxTextEntryBase::GetRange(long from, long to) const
{
wxString sel;
- if ( from < to )
+ wxString value = GetValue();
+
+ if ( from < to && (long)value.length() >= to )
{
- sel = GetValue().substr(from, to - from);
+ sel = value.substr(from, to - from);
}
return sel;
SelectAll();
WriteText(value);
+
+ SetInsertionPoint(0);
}
void wxTextEntryBase::Replace(long from, long to, const wxString& value)
Remove(from, to);
}
+ SetInsertionPoint(from);
WriteText(value);
}