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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 if (m_pool[i].first == locale) { | 56 if (m_pool[i].first == locale) { |
57 iterator = m_pool[i].second; | 57 iterator = m_pool[i].second; |
58 m_pool.remove(i); | 58 m_pool.remove(i); |
59 break; | 59 break; |
60 } | 60 } |
61 } | 61 } |
62 | 62 |
63 if (!iterator) { | 63 if (!iterator) { |
64 UErrorCode openStatus = U_ZERO_ERROR; | 64 UErrorCode openStatus = U_ZERO_ERROR; |
65 bool localeIsEmpty = locale.isEmpty(); | 65 bool localeIsEmpty = locale.isEmpty(); |
66 iterator = icu::BreakIterator::createLineInstance(localeIsEmpty ? ic
u::Locale(currentTextBreakLocaleID()) : icu::Locale(locale.string().utf8().data(
)), openStatus); | 66 iterator = icu::BreakIterator::createLineInstance(localeIsEmpty ? ic
u::Locale(currentTextBreakLocaleID()) : icu::Locale(locale.utf8().data()), openS
tatus); |
67 // locale comes from a web page and it can be invalid, leading ICU | 67 // locale comes from a web page and it can be invalid, leading ICU |
68 // to fail, in which case we fall back to the default locale. | 68 // to fail, in which case we fall back to the default locale. |
69 if (!localeIsEmpty && U_FAILURE(openStatus)) { | 69 if (!localeIsEmpty && U_FAILURE(openStatus)) { |
70 openStatus = U_ZERO_ERROR; | 70 openStatus = U_ZERO_ERROR; |
71 iterator = icu::BreakIterator::createLineInstance(icu::Locale(cu
rrentTextBreakLocaleID()), openStatus); | 71 iterator = icu::BreakIterator::createLineInstance(icu::Locale(cu
rrentTextBreakLocaleID()), openStatus); |
72 } | 72 } |
73 | 73 |
74 if (U_FAILURE(openStatus)) { | 74 if (U_FAILURE(openStatus)) { |
75 WTF_LOG_ERROR("icu::BreakIterator construction failed with statu
s %d", openStatus); | 75 WTF_LOG_ERROR("icu::BreakIterator construction failed with statu
s %d", openStatus); |
76 return 0; | 76 return 0; |
(...skipping 760 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
837 "$Tel1 $TelV $Tel0;" // Telugu Virama (backward) | 837 "$Tel1 $TelV $Tel0;" // Telugu Virama (backward) |
838 "$Kan1 $KanV $Kan0;" // Kannada Virama (backward) | 838 "$Kan1 $KanV $Kan0;" // Kannada Virama (backward) |
839 "$Mal1 $MalV $Mal0;" // Malayalam Virama (backward) | 839 "$Mal1 $MalV $Mal0;" // Malayalam Virama (backward) |
840 "!!safe_reverse;" | 840 "!!safe_reverse;" |
841 "!!safe_forward;"; | 841 "!!safe_forward;"; |
842 | 842 |
843 return setUpIteratorWithRules(kRules, string, length); | 843 return setUpIteratorWithRules(kRules, string, length); |
844 } | 844 } |
845 | 845 |
846 } | 846 } |
OLD | NEW |