| 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 15 matching lines...) Expand all Loading... |
| 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 | 32 |
| 33 using namespace WTF; | 33 using namespace WTF; |
| 34 using namespace Unicode; | 34 using namespace Unicode; |
| 35 | 35 |
| 36 namespace WebCore { | 36 namespace blink { |
| 37 | 37 |
| 38 int endOfFirstWordBoundaryContext(const UChar* characters, int length) | 38 int endOfFirstWordBoundaryContext(const UChar* characters, int length) |
| 39 { | 39 { |
| 40 for (int i = 0; i < length; ) { | 40 for (int i = 0; i < length; ) { |
| 41 int first = i; | 41 int first = i; |
| 42 UChar32 ch; | 42 UChar32 ch; |
| 43 U16_NEXT(characters, i, length, ch); | 43 U16_NEXT(characters, i, length, ch); |
| 44 if (!requiresContextForWordBoundary(ch)) | 44 if (!requiresContextForWordBoundary(ch)) |
| 45 return first; | 45 return first; |
| 46 } | 46 } |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 | 102 |
| 103 } // namespace WebCore | 103 } // namespace blink |
| OLD | NEW |