wxTextCtrk::GetRange() shouldn't crash on out of range request

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53729 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
2008-05-23 19:41:32 +00:00
parent d1263a3992
commit e9863f4ea1

View File

@@ -40,7 +40,9 @@
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);
}