OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007 Apple Inc. All rights reserved. |
3 * Copyright (C) 2008 Tony Chang <idealisms@gmail.com> | 3 * Copyright (C) 2008 Tony Chang <idealisms@gmail.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 * | 8 * |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 12 matching lines...) Expand all Loading... |
23 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 23 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
24 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | 24 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
25 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 25 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
28 */ | 28 */ |
29 | 29 |
30 #include "core/editing/commands/SmartReplace.h" | 30 #include "core/editing/commands/SmartReplace.h" |
31 | 31 |
32 #if !OS(MACOSX) | 32 #if !OS(MACOSX) |
| 33 #include <unicode/uset.h> |
33 #include "wtf/Assertions.h" | 34 #include "wtf/Assertions.h" |
34 #include "wtf/text/WTFString.h" | 35 #include "wtf/text/WTFString.h" |
35 #include <unicode/uset.h> | |
36 | 36 |
37 namespace blink { | 37 namespace blink { |
38 | 38 |
39 static void addAllCodePoints(USet* smartSet, const String& string) { | 39 static void addAllCodePoints(USet* smartSet, const String& string) { |
40 for (size_t i = 0; i < string.length(); i++) | 40 for (size_t i = 0; i < string.length(); i++) |
41 uset_add(smartSet, string[i]); | 41 uset_add(smartSet, string[i]); |
42 } | 42 } |
43 | 43 |
44 // This is mostly a port of the code in WebCore/editing/SmartReplaceCF.cpp | 44 // This is mostly a port of the code in WebCore/editing/SmartReplaceCF.cpp |
45 // except we use icu in place of CoreFoundations character classes. | 45 // except we use icu in place of CoreFoundations character classes. |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 } | 104 } |
105 return smartSet; | 105 return smartSet; |
106 } | 106 } |
107 | 107 |
108 bool isCharacterSmartReplaceExempt(UChar32 c, bool isPreviousCharacter) { | 108 bool isCharacterSmartReplaceExempt(UChar32 c, bool isPreviousCharacter) { |
109 return uset_contains(getSmartSet(isPreviousCharacter), c); | 109 return uset_contains(getSmartSet(isPreviousCharacter), c); |
110 } | 110 } |
111 } | 111 } |
112 | 112 |
113 #endif // !OS(MACOSX) | 113 #endif // !OS(MACOSX) |
OLD | NEW |