You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pivot.apache.org by gb...@apache.org on 2010/05/10 20:30:34 UTC

svn commit: r942839 - in /pivot/trunk/wtk/src/org/apache/pivot/wtk: skin/TextAreaSkin.java text/TextNode.java

Author: gbrown
Date: Mon May 10 18:30:34 2010
New Revision: 942839

URL: http://svn.apache.org/viewvc?rev=942839&view=rev
Log:
Minor update to PIVOT-485 fix.

Modified:
    pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkin.java
    pivot/trunk/wtk/src/org/apache/pivot/wtk/text/TextNode.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=942839&r1=942838&r2=942839&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 May 10 18:30:34 2010
@@ -999,16 +999,20 @@ public class TextAreaSkin extends Compon
                 }
 
                 int end;
-                if (lineWidth < breakWidth) {
-                    end = ci.getEndIndex();
+                if (textNode.getCharacterCount() == 0) {
+                    end = start;
                 } else {
-                    if (lastWhitespaceIndex == -1) {
-                        end = ci.getIndex() - 1;
-                        if (end <= start) {
-                            end = start + 1;
-                        }
+                    if (lineWidth < breakWidth) {
+                        end = ci.getEndIndex();
                     } else {
-                        end = lastWhitespaceIndex + 1;
+                        if (lastWhitespaceIndex == -1) {
+                            end = ci.getIndex() - 1;
+                            if (end <= start) {
+                                end = start + 1;
+                            }
+                        } else {
+                            end = lastWhitespaceIndex + 1;
+                        }
                     }
                 }
 

Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/text/TextNode.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/text/TextNode.java?rev=942839&r1=942838&r2=942839&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/text/TextNode.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/text/TextNode.java Mon May 10 18:30:34 2010
@@ -58,8 +58,7 @@ public final class TextNode extends Node
 
         @Override
         public char next() {
-            return setIndex(getCharacterCount() > 0
-                && index < endIndex ? index + 1 : DONE);
+            return setIndex(index < endIndex ? index + 1 : DONE);
         }
 
         @Override
@@ -69,8 +68,7 @@ public final class TextNode extends Node
 
         @Override
         public char current() {
-            return (getCharacterCount() > 0
-                && index < endIndex) ? getCharacterAt(index) : DONE;
+            return (index < endIndex) ? getCharacterAt(index) : DONE;
         }
 
         @Override