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 11 matching lines...) Expand all Loading... |
22 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 22 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
25 */ | 25 */ |
26 | 26 |
27 #include "config.h" | 27 #include "config.h" |
28 #include "platform/text/TextBoundaries.h" | 28 #include "platform/text/TextBoundaries.h" |
29 | 29 |
30 #include "platform/text/TextBreakIterator.h" | 30 #include "platform/text/TextBreakIterator.h" |
31 #include "wtf/text/StringImpl.h" | 31 #include "wtf/text/StringImpl.h" |
32 #include "wtf/unicode/Unicode.h" | |
33 | 32 |
34 using namespace WTF; | 33 using namespace WTF; |
35 using namespace Unicode; | 34 using namespace Unicode; |
36 | 35 |
37 namespace WebCore { | 36 namespace WebCore { |
38 | 37 |
39 int endOfFirstWordBoundaryContext(const UChar* characters, int length) | 38 int endOfFirstWordBoundaryContext(const UChar* characters, int length) |
40 { | 39 { |
41 for (int i = 0; i < length; ) { | 40 for (int i = 0; i < length; ) { |
42 int first = i; | 41 int first = i; |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 { | 94 { |
96 TextBreakIterator* it = wordBreakIterator(chars, len); | 95 TextBreakIterator* it = wordBreakIterator(chars, len); |
97 *end = it->following(position); | 96 *end = it->following(position); |
98 if (*end < 0) | 97 if (*end < 0) |
99 *end = it->last(); | 98 *end = it->last(); |
100 *start = it->previous(); | 99 *start = it->previous(); |
101 } | 100 } |
102 | 101 |
103 | 102 |
104 } // namespace WebCore | 103 } // namespace WebCore |
OLD | NEW |