]> git.saurik.com Git - wxWidgets.git/commitdiff
fix index checking in GetRange()
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 24 Jul 2008 00:05:14 +0000 (00:05 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 24 Jul 2008 00:05:14 +0000 (00:05 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54777 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/textentrycmn.cpp

index 5ec6850708fdb42077a14be4657664141676f8fb..4adca176b049568a93603b7ffe79127742fdf709 100644 (file)
@@ -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;