| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006 Lars Knoll <lars@trolltech.com> | 2 * Copyright (C) 2006 Lars Knoll <lars@trolltech.com> |
| 3 * Copyright (C) 2007, 2011, 2012 Apple Inc. All rights reserved. | 3 * Copyright (C) 2007, 2011, 2012 Apple Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
| 6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
| 7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
| 8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
| 9 * | 9 * |
| 10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 static const size_t capacity = 4; | 100 static const size_t capacity = 4; |
| 101 | 101 |
| 102 typedef pair<AtomicString, icu::BreakIterator*> Entry; | 102 typedef pair<AtomicString, icu::BreakIterator*> Entry; |
| 103 typedef Vector<Entry, capacity> Pool; | 103 typedef Vector<Entry, capacity> Pool; |
| 104 Pool m_pool; | 104 Pool m_pool; |
| 105 HashMap<icu::BreakIterator*, AtomicString> m_vendedIterators; | 105 HashMap<icu::BreakIterator*, AtomicString> m_vendedIterators; |
| 106 | 106 |
| 107 friend WTF::ThreadSpecific<LineBreakIteratorPool>::operator LineBreakIterato
rPool*(); | 107 friend WTF::ThreadSpecific<LineBreakIteratorPool>::operator LineBreakIterato
rPool*(); |
| 108 }; | 108 }; |
| 109 | 109 |
| 110 static TextBreakIterator* ensureIterator(bool& createdIterator, TextBreakIterato
r*& iterator, UBreakIteratorType type) | |
| 111 { | |
| 112 if (!createdIterator) { | |
| 113 UErrorCode openStatus = U_ZERO_ERROR; | |
| 114 iterator = reinterpret_cast<TextBreakIterator*>(ubrk_open(type, currentT
extBreakLocaleID(), 0, 0, &openStatus)); | |
| 115 createdIterator = true; | |
| 116 ASSERT_WITH_MESSAGE(U_SUCCESS(openStatus), "ICU could not open a break i
terator: %s (%d)", u_errorName(openStatus), openStatus); | |
| 117 } | |
| 118 return iterator; | |
| 119 } | |
| 120 | |
| 121 enum TextContext { NoContext, PriorContext, PrimaryContext }; | 110 enum TextContext { NoContext, PriorContext, PrimaryContext }; |
| 122 | 111 |
| 123 const int textBufferCapacity = 16; | 112 const int textBufferCapacity = 16; |
| 124 | 113 |
| 125 typedef struct { | 114 typedef struct { |
| 126 UText text; | 115 UText text; |
| 127 UChar buffer[textBufferCapacity]; | 116 UChar buffer[textBufferCapacity]; |
| 128 } UTextWithBuffer; | 117 } UTextWithBuffer; |
| 129 | 118 |
| 130 static inline int64_t textPinIndex(int64_t& index, int64_t limit) | 119 static inline int64_t textPinIndex(int64_t& index, int64_t limit) |
| (...skipping 722 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 853 "$Tel1 $TelV $Tel0;" // Telugu Virama (backward) | 842 "$Tel1 $TelV $Tel0;" // Telugu Virama (backward) |
| 854 "$Kan1 $KanV $Kan0;" // Kannada Virama (backward) | 843 "$Kan1 $KanV $Kan0;" // Kannada Virama (backward) |
| 855 "$Mal1 $MalV $Mal0;" // Malayalam Virama (backward) | 844 "$Mal1 $MalV $Mal0;" // Malayalam Virama (backward) |
| 856 "!!safe_reverse;" | 845 "!!safe_reverse;" |
| 857 "!!safe_forward;"; | 846 "!!safe_forward;"; |
| 858 | 847 |
| 859 return setUpIteratorWithRules(kRules, string, length); | 848 return setUpIteratorWithRules(kRules, string, length); |
| 860 } | 849 } |
| 861 | 850 |
| 862 } | 851 } |
| OLD | NEW |