You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pivot.apache.org by rw...@apache.org on 2014/02/10 23:52:30 UTC

svn commit: r1566795 - /pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextPaneSkinParagraphView.java

Author: rwhitcomb
Date: Mon Feb 10 22:52:29 2014
New Revision: 1566795

URL: http://svn.apache.org/r1566795
Log:
Avoid potential IllegalArgumentException from trying to get the selection bounds
at the end of the text.  Often the selection start is equal to the character count
(meaning after the last character) and, though potentially a valid position, the
bounds is returned null and then we get an IllegalArgumentException from TextPaneSkin.
updateSelection.

This is potentially NOT the right solution to the problem, but doing it now to avoid
the exceptions until I can figure out a better solution (or what the REAL root
problem is).

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

Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextPaneSkinParagraphView.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextPaneSkinParagraphView.java?rev=1566795&r1=1566794&r2=1566795&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextPaneSkinParagraphView.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextPaneSkinParagraphView.java Mon Feb 10 22:52:29 2014
@@ -496,7 +496,7 @@ class TextPaneSkinParagraphView extends 
     public Bounds getCharacterBounds(int offset) {
         Bounds characterBounds = null;
 
-        if (offset == getCharacterCount() - 1) {
+        if (offset >= getCharacterCount() - 1) {
             characterBounds = terminatorBounds;
         } else {
             if (rows != null) {