Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(150)

Side by Side Diff: Source/platform/text/TextBreakIterator.cpp

Issue 1119663002: Making Unicode character names consistent (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase patch Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/platform/text/StringTruncator.cpp ('k') | Source/platform/text/UnicodeUtilities.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * (C) 1999 Lars Knoll (knoll@kde.org) 2 * (C) 1999 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010 Apple Inc. All rights reserv ed. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010 Apple Inc. All rights reserv ed.
4 * Copyright (C) 2007-2009 Torch Mobile, Inc. 4 * Copyright (C) 2007-2009 Torch Mobile, Inc.
5 * Copyright (C) 2011 Google Inc. All rights reserved. 5 * Copyright (C) 2011 Google Inc. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 const unsigned char* tableRow = asciiLineBreakTable[ch - asciiLineBreakT ableFirstChar]; 144 const unsigned char* tableRow = asciiLineBreakTable[ch - asciiLineBreakT ableFirstChar];
145 int nextChIndex = nextCh - asciiLineBreakTableFirstChar; 145 int nextChIndex = nextCh - asciiLineBreakTableFirstChar;
146 return tableRow[nextChIndex / 8] & (1 << (nextChIndex % 8)); 146 return tableRow[nextChIndex / 8] & (1 << (nextChIndex % 8));
147 } 147 }
148 // Otherwise defer to the Unicode algorithm by returning false. 148 // Otherwise defer to the Unicode algorithm by returning false.
149 return false; 149 return false;
150 } 150 }
151 151
152 inline bool needsLineBreakIterator(UChar ch) 152 inline bool needsLineBreakIterator(UChar ch)
153 { 153 {
154 return ch > asciiLineBreakTableLastChar && ch != noBreakSpace; 154 return ch > asciiLineBreakTableLastChar && ch != noBreakSpaceCharacter;
155 } 155 }
156 156
157 template<typename CharacterType> 157 template<typename CharacterType>
158 static inline int nextBreakablePosition(LazyLineBreakIterator& lazyBreakIterator , const CharacterType* str, unsigned length, int pos) 158 static inline int nextBreakablePosition(LazyLineBreakIterator& lazyBreakIterator , const CharacterType* str, unsigned length, int pos)
159 { 159 {
160 int len = static_cast<int>(length); 160 int len = static_cast<int>(length);
161 int nextBreak = -1; 161 int nextBreak = -1;
162 162
163 CharacterType lastLastCh = pos > 1 ? str[pos - 2] : static_cast<CharacterTyp e>(lazyBreakIterator.secondToLastCharacter()); 163 CharacterType lastLastCh = pos > 1 ? str[pos - 2] : static_cast<CharacterTyp e>(lazyBreakIterator.secondToLastCharacter());
164 CharacterType lastCh = pos > 0 ? str[pos - 1] : static_cast<CharacterType>(l azyBreakIterator.lastCharacter()); 164 CharacterType lastCh = pos > 0 ? str[pos - 1] : static_cast<CharacterType>(l azyBreakIterator.lastCharacter());
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 } 287 }
288 288
289 int LazyLineBreakIterator::nextBreakablePositionKeepAll(int pos) 289 int LazyLineBreakIterator::nextBreakablePositionKeepAll(int pos)
290 { 290 {
291 if (m_string.is8Bit()) 291 if (m_string.is8Bit())
292 return nextBreakablePosition<LChar>(*this, m_string.characters8(), m_str ing.length(), pos); 292 return nextBreakablePosition<LChar>(*this, m_string.characters8(), m_str ing.length(), pos);
293 return nextBreakablePositionKeepAllInternal(*this, m_string.characters16(), m_string.length(), pos); 293 return nextBreakablePositionKeepAllInternal(*this, m_string.characters16(), m_string.length(), pos);
294 } 294 }
295 295
296 } // namespace blink 296 } // namespace blink
OLDNEW
« no previous file with comments | « Source/platform/text/StringTruncator.cpp ('k') | Source/platform/text/UnicodeUtilities.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698