Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(147)

Side by Side Diff: ui/base/accessibility/accessible_text_utils.cc

Issue 101383002: Fix unintentional switch case fallthrough. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/base/accessibility/accessible_text_utils.h" 5 #include "ui/base/accessibility/accessible_text_utils.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 9
10 namespace ui { 10 namespace ui {
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 case LINE_BOUNDARY: 62 case LINE_BOUNDARY:
63 NOTREACHED(); // These are handled above. 63 NOTREACHED(); // These are handled above.
64 break; 64 break;
65 case WORD_BOUNDARY: 65 case WORD_BOUNDARY:
66 if (IsWhitespace(text[pos])) 66 if (IsWhitespace(text[pos]))
67 return result; 67 return result;
68 break; 68 break;
69 case PARAGRAPH_BOUNDARY: 69 case PARAGRAPH_BOUNDARY:
70 if (text[pos] == '\n') 70 if (text[pos] == '\n')
71 return result; 71 return result;
72 break;
72 case SENTENCE_BOUNDARY: 73 case SENTENCE_BOUNDARY:
73 if ((text[pos] == '.' || text[pos] == '!' || text[pos] == '?') && 74 if ((text[pos] == '.' || text[pos] == '!' || text[pos] == '?') &&
74 (pos == text_size - 1 || IsWhitespace(text[pos + 1]))) { 75 (pos == text_size - 1 || IsWhitespace(text[pos + 1]))) {
75 return result; 76 return result;
76 } 77 }
78 break;
77 case ALL_BOUNDARY: 79 case ALL_BOUNDARY:
78 default: 80 default:
79 break; 81 break;
80 } 82 }
81 83
82 if (direction == FORWARDS_DIRECTION) { 84 if (direction == FORWARDS_DIRECTION) {
83 result++; 85 result++;
84 } else { 86 } else {
85 result--; 87 result--;
86 } 88 }
87 } 89 }
88 } 90 }
89 91
90 } // Namespace ui 92 } // Namespace ui
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698