diff options
author | Robert Schuster <theBohemian@gmx.net> | 2006-05-13 11:48:16 +0000 |
---|---|---|
committer | Robert Schuster <theBohemian@gmx.net> | 2006-05-13 11:48:16 +0000 |
commit | 09d93ce4e542709e1b4a8f7a7bf97e3cc7166126 (patch) | |
tree | 29f1a1f3484d6ad0f53c11245724b7f9a0f08731 /examples/gnu | |
parent | 872889a06a4113ac6c36f30235f7bfb2a315d2fa (diff) | |
download | classpath-09d93ce4e542709e1b4a8f7a7bf97e3cc7166126.tar.gz |
2006-05-13 Robert Schuster <robertschuster@fsfe.org>
* examples/gnu/classpath/examples/swing/NavigationFilterDemo.java:
(WordFilter.getNextVisualPositionFrom): Added statement to check
for variable pt not being null.
Diffstat (limited to 'examples/gnu')
-rw-r--r-- | examples/gnu/classpath/examples/swing/NavigationFilterDemo.java | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/examples/gnu/classpath/examples/swing/NavigationFilterDemo.java b/examples/gnu/classpath/examples/swing/NavigationFilterDemo.java index 6c1be74cc..5184e5ba0 100644 --- a/examples/gnu/classpath/examples/swing/NavigationFilterDemo.java +++ b/examples/gnu/classpath/examples/swing/NavigationFilterDemo.java @@ -160,7 +160,7 @@ public class NavigationFilterDemo pt = text.getCaret().getMagicCaretPosition(); // Calculate its position above. - newpos = Utilities.getPositionAbove(text, pos, pt.x); + newpos = Utilities.getPositionAbove(text, pos, (pt != null) ? pt.x : 0); // If we have a valid position, then calculate the next word start // from there. @@ -173,7 +173,7 @@ public class NavigationFilterDemo pt = text.getCaret().getMagicCaretPosition(); // Calculate its position below. - newpos = Utilities.getPositionBelow(text, pos, pt.x); + newpos = Utilities.getPositionBelow(text, pos, (pt != null) ? pt.x : 0); // If we have a valid position, then calculate the next word start // from there. @@ -192,7 +192,6 @@ public class NavigationFilterDemo else return Utilities.getPreviousWord(text, newpos); case SwingConstants.EAST: - // Simply calculate the next word's start offset. return Utilities.getNextWord(text, newpos); default: // Do whatever the super implementation did. |