OLD | NEW |
1 /** | 1 /** |
2 * Copyright (C) 2011 Nokia Inc. All rights reserved. | 2 * Copyright (C) 2011 Nokia Inc. All rights reserved. |
3 * Copyright (C) 2012 Google Inc. All rights reserved. | 3 * Copyright (C) 2012 Google 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 14 matching lines...) Expand all Loading... |
25 #include "core/layout/LayoutTextFragment.h" | 25 #include "core/layout/LayoutTextFragment.h" |
26 #include "core/layout/LayoutView.h" | 26 #include "core/layout/LayoutView.h" |
27 #include "wtf/StdLibExtras.h" | 27 #include "wtf/StdLibExtras.h" |
28 #include "wtf/text/AtomicString.h" | 28 #include "wtf/text/AtomicString.h" |
29 | 29 |
30 #include <algorithm> | 30 #include <algorithm> |
31 | 31 |
32 namespace blink { | 32 namespace blink { |
33 | 33 |
34 LayoutQuote::LayoutQuote(Document* node, QuoteType quote) | 34 LayoutQuote::LayoutQuote(Document* node, QuoteType quote) |
35 : LayoutInline(0) | 35 : LayoutInline(nullptr) |
36 , m_type(quote) | 36 , m_type(quote) |
37 , m_depth(0) | 37 , m_depth(0) |
38 , m_next(nullptr) | 38 , m_next(nullptr) |
39 , m_previous(nullptr) | 39 , m_previous(nullptr) |
40 , m_attached(false) | 40 , m_attached(false) |
41 { | 41 { |
42 setDocumentForAnonymous(node); | 42 setDocumentForAnonymous(node); |
43 } | 43 } |
44 | 44 |
45 LayoutQuote::~LayoutQuote() | 45 LayoutQuote::~LayoutQuote() |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 { "yav", 0x00ab, 0x00bb, 0x00ab, 0x00bb, 0 }, | 225 { "yav", 0x00ab, 0x00bb, 0x00ab, 0x00bb, 0 }, |
226 { "yo", 0x201c, 0x201d, 0x2018, 0x2019, 0 }, | 226 { "yo", 0x201c, 0x201d, 0x2018, 0x2019, 0 }, |
227 { "zh", 0x201c, 0x201d, 0x2018, 0x2019, 0 }, | 227 { "zh", 0x201c, 0x201d, 0x2018, 0x2019, 0 }, |
228 { "zh-hant", 0x300c, 0x300d, 0x300e, 0x300f, 0 }, | 228 { "zh-hant", 0x300c, 0x300d, 0x300e, 0x300f, 0 }, |
229 { "zu", 0x201c, 0x201d, 0x2018, 0x2019, 0 }, | 229 { "zu", 0x201c, 0x201d, 0x2018, 0x2019, 0 }, |
230 }; | 230 }; |
231 | 231 |
232 const QuotesData* quotesDataForLanguage(const AtomicString& lang) | 232 const QuotesData* quotesDataForLanguage(const AtomicString& lang) |
233 { | 233 { |
234 if (lang.isNull()) | 234 if (lang.isNull()) |
235 return 0; | 235 return nullptr; |
236 | 236 |
237 // This could be just a hash table, but doing that adds 200k to LayoutQuote.
o | 237 // This could be just a hash table, but doing that adds 200k to LayoutQuote.
o |
238 Language* languagesEnd = languages + WTF_ARRAY_LENGTH(languages); | 238 Language* languagesEnd = languages + WTF_ARRAY_LENGTH(languages); |
239 CString lowercaseLang = lang.lower().utf8(); | 239 CString lowercaseLang = lang.lower().utf8(); |
240 Language key = { lowercaseLang.data(), 0, 0, 0, 0, 0 }; | 240 Language key = { lowercaseLang.data(), 0, 0, 0, 0, 0 }; |
241 Language* match = std::lower_bound(languages, languagesEnd, key); | 241 Language* match = std::lower_bound(languages, languagesEnd, key); |
242 if (match == languagesEnd || strcmp(match->lang, key.lang)) | 242 if (match == languagesEnd || strcmp(match->lang, key.lang)) |
243 return 0; | 243 return nullptr; |
244 | 244 |
245 if (!match->data) | 245 if (!match->data) |
246 match->data = QuotesData::create(match->open1, match->close1, match->ope
n2, match->close2).leakRef(); | 246 match->data = QuotesData::create(match->open1, match->close1, match->ope
n2, match->close2).leakRef(); |
247 | 247 |
248 return match->data; | 248 return match->data; |
249 } | 249 } |
250 | 250 |
251 static const QuotesData* basicQuotesData() | 251 static const QuotesData* basicQuotesData() |
252 { | 252 { |
253 // FIXME: The default quotes should be the fancy quotes for "en". | 253 // FIXME: The default quotes should be the fancy quotes for "en". |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 if (m_depth) | 399 if (m_depth) |
400 m_depth--; | 400 m_depth--; |
401 break; | 401 break; |
402 } | 402 } |
403 } | 403 } |
404 if (oldDepth != m_depth) | 404 if (oldDepth != m_depth) |
405 updateText(); | 405 updateText(); |
406 } | 406 } |
407 | 407 |
408 } // namespace blink | 408 } // namespace blink |
OLD | NEW |