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/07/25 11:25:43 UTC

svn commit: r1150603 - in /pivot/trunk/wtk/src/org/apache/pivot/wtk: TextArea.java skin/TextAreaSkinParagraphView.java

Author: noelgrandin
Date: Mon Jul 25 09:25:42 2011
New Revision: 1150603

URL: http://svn.apache.org/viewvc?rev=1150603&view=rev
Log:
PIVOT-772 Exceptions thrown when calling getCharacterBounds of TextArea when incomplete lines exist

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

Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/TextArea.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/TextArea.java?rev=1150603&r1=1150602&r2=1150603&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/TextArea.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/TextArea.java Mon Jul 25 09:25:42 2011
@@ -1239,6 +1239,9 @@ public class TextArea extends Component 
     }
 
     public Bounds getCharacterBounds(int index) {
+        // We need to validate in case we get called from user-code after
+        // a user-code initiated modification, but before another layout has run.
+        validate();
         TextArea.Skin textAreaSkin = (TextArea.Skin)getSkin();
         return textAreaSkin.getCharacterBounds(index);
     }

Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkinParagraphView.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkinParagraphView.java?rev=1150603&r1=1150602&r2=1150603&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkinParagraphView.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkinParagraphView.java Mon Jul 25 09:25:42 2011
@@ -371,8 +371,6 @@ class TextAreaSkinParagraphView implemen
     }
 
     public Bounds getCharacterBounds(int index) {
-        // need to validate in case we get called from user-code after a modification
-        validate();
         Bounds characterBounds = null;
 
         CharSequence characters = paragraph.getCharacters();