Changeset 79567 in webkit
- Timestamp:
- Feb 24, 2011 8:09:18 AM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r79566 r79567 1 2011-02-24 Andreas Kling <kling@webkit.org> 2 3 Reviewed by Kenneth Rohde Christiansen. 4 5 [Qt] Remove bogus optimizations in TextBreakIteratorQt 6 https://bugs.webkit.org/show_bug.cgi?id=55139 7 8 Let QTextBoundaryFinder hold a deep copy of the string data it's 9 operating on, and don't use the same working buffer for all iterators. 10 11 * platform/text/qt/TextBreakIteratorQt.cpp: 12 (WebCore::TextBreakIterator::TextBreakIterator): 13 (WebCore::setUpIterator): 14 1 15 2011-02-24 Andrey Adaikin <aandrey@google.com> 2 16 -
trunk/Source/WebCore/platform/text/qt/TextBreakIteratorQt.cpp
r79518 r79567 40 40 } 41 41 #else 42 static unsigned char buffer[1024];43 44 42 class TextBreakIterator : public QTextBoundaryFinder { 45 43 public: 46 TextBreakIterator(QTextBoundaryFinder::BoundaryType type, const UChar* string, int length) 47 : QTextBoundaryFinder(type, (const QChar*)string, length, buffer, sizeof(buffer)) 48 , length(length) 49 , string(string) {} 44 TextBreakIterator(QTextBoundaryFinder::BoundaryType type, const QString& string) 45 : QTextBoundaryFinder(type, string) 46 { } 50 47 TextBreakIterator() 51 48 : QTextBoundaryFinder() 52 , length(0) 53 , string(0) {} 54 55 int length; 56 const UChar* string; 49 { } 57 50 }; 58 51 59 TextBreakIterator* setUpIterator(TextBreakIterator& iterator, QTextBoundaryFinder::BoundaryType type, const UChar* string, int length)52 TextBreakIterator* setUpIterator(TextBreakIterator& iterator, QTextBoundaryFinder::BoundaryType type, const UChar* characters, int length) 60 53 { 61 if (! string|| !length)54 if (!characters || !length) 62 55 return 0; 63 56 64 if (iterator.isValid() && type == iterator.type() && length == iterator.length 65 && memcmp(string, iterator.string, length) == 0) { 57 if (iterator.isValid() && type == iterator.type() && iterator.string() == QString::fromRawData(reinterpret_cast<const QChar*>(characters), length)) { 66 58 iterator.toStart(); 67 59 return &iterator; 68 60 } 69 61 70 iterator = TextBreakIterator(type, string, length); 71 62 iterator = TextBreakIterator(type, QString(reinterpret_cast<const QChar*>(characters), length)); 72 63 return &iterator; 73 64 }
Note: See TracChangeset
for help on using the changeset viewer.