OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r
ights reserved. | 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r
ights reserved. |
3 * Copyright (C) 2005 Alexey Proskuryakov. | 3 * Copyright (C) 2005 Alexey Proskuryakov. |
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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 void foldQuoteMarksAndSoftHyphens(String& s) | 70 void foldQuoteMarksAndSoftHyphens(String& s) |
71 { | 71 { |
72 s.replace(hebrewPunctuationGereshCharacter, '\''); | 72 s.replace(hebrewPunctuationGereshCharacter, '\''); |
73 s.replace(hebrewPunctuationGershayimCharacter, '"'); | 73 s.replace(hebrewPunctuationGershayimCharacter, '"'); |
74 s.replace(leftDoubleQuotationMarkCharacter, '"'); | 74 s.replace(leftDoubleQuotationMarkCharacter, '"'); |
75 s.replace(leftSingleQuotationMarkCharacter, '\''); | 75 s.replace(leftSingleQuotationMarkCharacter, '\''); |
76 s.replace(rightDoubleQuotationMarkCharacter, '"'); | 76 s.replace(rightDoubleQuotationMarkCharacter, '"'); |
77 s.replace(rightSingleQuotationMarkCharacter, '\''); | 77 s.replace(rightSingleQuotationMarkCharacter, '\''); |
78 // Replace soft hyphen with an ignorable character so that their presence or
absence will | 78 // Replace soft hyphen with an ignorable character so that their presence or
absence will |
79 // not affect string comparison. | 79 // not affect string comparison. |
80 s.replace(softHyphenCharacter, 0); | 80 s.replace(softHyphenCharacter, static_cast<UChar>('\0')); |
81 } | 81 } |
82 | 82 |
83 static bool isNonLatin1Separator(UChar32 character) | 83 static bool isNonLatin1Separator(UChar32 character) |
84 { | 84 { |
85 DCHECK_GE(character, 256); | 85 DCHECK_GE(character, 256); |
86 return U_GET_GC_MASK(character) & (U_GC_S_MASK | U_GC_P_MASK | U_GC_Z_MASK |
U_GC_CF_MASK); | 86 return U_GET_GC_MASK(character) & (U_GC_S_MASK | U_GC_P_MASK | U_GC_Z_MASK |
U_GC_CF_MASK); |
87 } | 87 } |
88 | 88 |
89 bool isSeparator(UChar32 character) | 89 bool isSeparator(UChar32 character) |
90 { | 90 { |
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 if (offset == kNotFound) | 404 if (offset == kNotFound) |
405 return false; | 405 return false; |
406 | 406 |
407 // Update values of |a| and |b| after comparing. | 407 // Update values of |a| and |b| after comparing. |
408 a += offset; | 408 a += offset; |
409 b += offset; | 409 b += offset; |
410 } | 410 } |
411 } | 411 } |
412 | 412 |
413 } // namespace blink | 413 } // namespace blink |
OLD | NEW |