Index: chrome/browser/accessibility/browser_accessibility_win.cc |
=================================================================== |
--- chrome/browser/accessibility/browser_accessibility_win.cc (revision 75254) |
+++ chrome/browser/accessibility/browser_accessibility_win.cc (working copy) |
@@ -1223,9 +1223,15 @@ |
LONG start_offset, |
LONG direction) { |
LONG text_size = static_cast<LONG>(text.size()); |
- DCHECK(start_offset >= 0 && start_offset <= text_size); |
DCHECK(direction == 1 || direction == -1); |
Chris Guillory
2011/02/18 01:37:11
Nit: Can we keep these DCHECKs next to each other.
dmazzoni
2011/02/18 17:52:37
Sure. I moved the start_offset DCHECK back up to t
|
+ if (start_offset == IA2_TEXT_OFFSET_LENGTH) { |
+ start_offset = text_size; |
+ } else if (start_offset == IA2_TEXT_OFFSET_CARET) { |
+ get_caretOffset(&start_offset); |
+ } |
+ DCHECK(start_offset >= 0 && start_offset <= text_size); |
+ |
if (boundary == IA2_TEXT_BOUNDARY_CHAR) { |
if (direction == 1 && start_offset < text_size) |
return start_offset + 1; |