wxString wxTextEntryBase::GetRange(long from, long to) const
{
wxString sel;
- if ( from < to )
+ wxString value = GetValue();
+
+ if ((from < to) && ((long)value.length() >= to + from))
{
sel = GetValue().substr(from, to - from);
}
return from < to;
}
+void wxTextEntryBase::RemoveSelection()
+{
+ long from, to;
+ GetSelection(& from, & to);
+ if (from != -1 && to != -1)
+ Remove(from, to);
+}
+
wxString wxTextEntryBase::GetStringSelection() const
{
long from, to;