From: bdash Date: Mon, 9 Oct 2006 22:36:46 +0000 (+0000) Subject: 2006-10-09 Nikolas Zimmermann X-Git-Url: https://git.webkit.org/?p=WebKit-https.git;a=commitdiff_plain;h=e9571cbaa379bcc4ee9e6c8475ae8e1dd48a5b33 2006-10-09 Nikolas Zimmermann Reviewed by Beth. Fix LayoutTests/fast/css/case-transform.html with Qt - the last crashing layout test. * platform/qt/GlyphMapQt.cpp: Handle UTF-16 characters properly (WebCore::GlyphMap::fillPage): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@16944 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog index 15379666cd4c..ba0abbba88d6 100644 --- a/WebCore/ChangeLog +++ b/WebCore/ChangeLog @@ -1,3 +1,12 @@ +2006-10-09 Nikolas Zimmermann + + Reviewed by Beth. + + Fix LayoutTests/fast/css/case-transform.html with Qt - the last crashing layout test. + + * platform/qt/GlyphMapQt.cpp: Handle UTF-16 characters properly + (WebCore::GlyphMap::fillPage): + 2006-10-09 Nikolas Zimmermann Unreviewed build fix. diff --git a/WebCore/platform/qt/GlyphMapQt.cpp b/WebCore/platform/qt/GlyphMapQt.cpp index 85420925ed73..9523f1f7d06a 100644 --- a/WebCore/platform/qt/GlyphMapQt.cpp +++ b/WebCore/platform/qt/GlyphMapQt.cpp @@ -31,13 +31,28 @@ #include "GlyphMap.h" #include "FontData.h" +#include +#include namespace WebCore { bool GlyphMap::fillPage(GlyphPage* page, UChar* buffer, unsigned bufferLength, const FontData* fontData) { - for (unsigned i = 0; i < bufferLength; i++) - page->setGlyphDataForIndex(i, buffer[i], fontData); + bool isUtf16 = bufferLength != GlyphPage::size; + + for (unsigned i = 0; i < GlyphPage::size; i++) { + UChar32 character; + + if(isUtf16) { + UChar lead = buffer[i * 2]; + UChar trail = buffer[i * 2 + 1]; + character = U16_GET_SUPPLEMENTARY(lead, trail); + } else { + character = buffer[i]; + } + + page->setGlyphDataForIndex(i, character, fontData); + } return true; }