OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. |
3 * Copyright (C) 2009 Dominik Röttsches <dominik.roettsches@access-company.com> | 3 * Copyright (C) 2009 Dominik Röttsches <dominik.roettsches@access-company.com> |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 | 92 |
93 void findWordBoundary(const UChar* chars, int len, int position, int* start, int
* end) | 93 void findWordBoundary(const UChar* chars, int len, int position, int* start, int
* end) |
94 { | 94 { |
95 TextBreakIterator* it = wordBreakIterator(chars, len); | 95 TextBreakIterator* it = wordBreakIterator(chars, len); |
96 *end = it->following(position); | 96 *end = it->following(position); |
97 if (*end < 0) | 97 if (*end < 0) |
98 *end = it->last(); | 98 *end = it->last(); |
99 *start = it->previous(); | 99 *start = it->previous(); |
100 } | 100 } |
101 | 101 |
| 102 int findWordEndBoundary(const UChar* chars, int len, int position) |
| 103 { |
| 104 TextBreakIterator* it = wordBreakIterator(chars, len); |
| 105 int end = it->following(position); |
| 106 return end < 0 ? it->last() : end; |
| 107 } |
102 | 108 |
103 } // namespace blink | 109 } // namespace blink |
OLD | NEW |