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/02/27 21:45:07 UTC

svn commit: r917041 - in /pivot/trunk/wtk/src/org/apache/pivot/wtk: TextArea.java TextInput.java

Author: gbrown
Date: Sat Feb 27 20:45:06 2010
New Revision: 917041

URL: http://svn.apache.org/viewvc?rev=917041&view=rev
Log:
Return 0 from getCharacterCount() when text node/document is null.

Modified:
    pivot/trunk/wtk/src/org/apache/pivot/wtk/TextArea.java
    pivot/trunk/wtk/src/org/apache/pivot/wtk/TextInput.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=917041&r1=917040&r2=917041&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/TextArea.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/TextArea.java Sat Feb 27 20:45:06 2010
@@ -418,10 +418,10 @@
      * Returns character count of the document.
      *
      * @return
-     * The document's character count, or <tt>-1</tt> if the document is <tt>null</tt>.
+     * The document's character count, or <tt>0</tt> if the document is <tt>null</tt>.
      */
     public int getCharacterCount() {
-        return (document == null) ? -1 : document.getCharacterCount();
+        return (document == null) ? 0 : document.getCharacterCount();
     }
 
     public void delete(Direction direction) {

Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/TextInput.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/TextInput.java?rev=917041&r1=917040&r2=917041&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/TextInput.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/TextInput.java Sat Feb 27 20:45:06 2010
@@ -369,10 +369,10 @@
      * Returns the character count of the text node.
      *
      * @return
-     * The text node's length, or <tt>-1</tt> if the text node is <tt>null</tt>.
+     * The text node's length, or <tt>0</tt> if the text node is <tt>null</tt>.
      */
     public int getCharacterCount() {
-        return (textNode == null) ? -1 : textNode.getCharacterCount();
+        return (textNode == null) ? 0 : textNode.getCharacterCount();
     }
 
     public void delete(Direction direction) {