diff options
author | Sergio Ahumada <sergio.ahumada@nokia.com> | 2012-04-17 10:38:24 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-04-17 10:38:24 +0200 |
commit | 16b53b2f0e3f8f64a59c465493a6209eb7f9ab47 (patch) | |
tree | bbb63401eb3c56c32ad9bd9be66bae8d3590de6b /src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp | |
parent | 2c13dc7482690756280cfefe8515eb809b069721 (diff) | |
parent | 9bd032355163d92cda5e7e59ecd21214b131f187 (diff) |
Merge "Merge remote-tracking branch 'origin/master' into api_changes" into refs/staging/api_changes
Diffstat (limited to 'src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp')
-rw-r--r-- | src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp b/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp index c8906bd3c9..4dbb2cf65b 100644 --- a/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp +++ b/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp @@ -295,13 +295,14 @@ QFixed QWindowsFontEngineDirectWrite::emSquareSize() const return QFontEngine::emSquareSize(); } +// ### Qt 5.1: replace with QStringIterator inline unsigned int getChar(const QChar *str, int &i, const int len) { - unsigned int uc = str[i].unicode(); - if (uc >= 0xd800 && uc < 0xdc00 && i < len-1) { + uint uc = str[i].unicode(); + if (QChar::isHighSurrogate(uc) && i < len-1) { uint low = str[i+1].unicode(); - if (low >= 0xdc00 && low < 0xe000) { - uc = (uc - 0xd800)*0x400 + (low - 0xdc00) + 0x10000; + if (QChar::isLowSurrogate(low)) { + uc = QChar::surrogateToUcs4(uc, low); ++i; } } |