You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pivot.apache.org by no...@apache.org on 2011/03/14 14:58:35 UTC

svn commit: r1081381 - /pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkin.java

Author: noelgrandin
Date: Mon Mar 14 13:58:35 2011
New Revision: 1081381

URL: http://svn.apache.org/viewvc?rev=1081381&view=rev
Log:
PIVOT-683 TextAreaSkin throws IndexOutOfBoundsException when the END key is pressed on the final line of a TextArea

Modified:
    pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkin.java

Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkin.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkin.java?rev=1081381&r1=1081380&r2=1081381&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkin.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkin.java Mon Mar 14 13:58:35 2011
@@ -932,7 +932,8 @@ public class TextAreaSkin extends Compon
                     selectionLength += (rowOffset + rowLength) - index;
                 } else {
                     selectionStart = rowOffset + rowLength;
-                    if (textArea.getCharacterAt(selectionStart) != '\n') {
+                    if (selectionStart < textArea.getCharacterCount()
+                            && textArea.getCharacterAt(selectionStart) != '\n') {
                         selectionStart--;
                     }