changeset 6906:26306d581529

[Accessibility] Fix hanging when traversing out of textfield/area (infinity loop in MoveEndpointByUnit).
author Felipe Heidrich <felipe.heidrich@oracle.com>
date Tue, 29 Apr 2014 17:09:17 -0700
parents f1da54afa580
children 822a99443a4e
files modules/graphics/src/main/java/com/sun/glass/ui/win/WinTextRangeProvider.java
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/modules/graphics/src/main/java/com/sun/glass/ui/win/WinTextRangeProvider.java	Tue Apr 29 16:10:15 2014 -0700
+++ b/modules/graphics/src/main/java/com/sun/glass/ui/win/WinTextRangeProvider.java	Tue Apr 29 17:09:17 2014 -0700
@@ -458,7 +458,7 @@
                     while (next != BreakIterator.DONE && requestedCount != actualCount) {
                         /* Always keep start offset at a word start, and end offset at a word end */
                         if (endpoint == TextPatternRangeEndpoint_Start) {
-                            while (isWordStart(bi, text, next)) next = bi.next();
+                            while (next == BreakIterator.DONE && isWordStart(bi, text, next)) next = bi.next();
                         } else {
                             while (!isWordStart(bi, text, next)) next = bi.next();
                         }
@@ -471,7 +471,7 @@
                     while (prev != BreakIterator.DONE && requestedCount != actualCount) {
                         /* Always keep start offset at a word start, and end offset at a word end */
                         if (endpoint == TextPatternRangeEndpoint_Start) {
-                            while (isWordStart(bi, text, prev)) prev = bi.previous();
+                            while (prev == BreakIterator.DONE && isWordStart(bi, text, prev)) prev = bi.previous();
                         } else {
                             while (!isWordStart(bi, text, prev)) prev = bi.previous();
                         }