diff options
author | Rohan McGovern <rohan.mcgovern@nokia.com> | 2011-09-19 04:12:35 (GMT) |
---|---|---|
committer | Rohan McGovern <rohan.mcgovern@nokia.com> | 2011-09-19 04:12:35 (GMT) |
commit | 5055f13683dd0670d62a81e61bf097fd220f0d42 (patch) | |
tree | 1cf10d701b6d6ba5fffe9a2267ecf894d505e1bd /src/gui/text/qfontenginedirectwrite.cpp | |
parent | fc602cb1737e58b4b814c4a799fa2a68acb6dbcd (diff) | |
parent | 53d9e3620ede7492c141402d9365d5c0dd7c10fd (diff) | |
download | Qt-5055f13683dd0670d62a81e61bf097fd220f0d42.zip Qt-5055f13683dd0670d62a81e61bf097fd220f0d42.tar.gz Qt-5055f13683dd0670d62a81e61bf097fd220f0d42.tar.bz2 |
Merge remote branch 'origin/4.8' into doc-staging-master
Conflicts:
dist/changes-4.8.0
Diffstat (limited to 'src/gui/text/qfontenginedirectwrite.cpp')
-rw-r--r-- | src/gui/text/qfontenginedirectwrite.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/gui/text/qfontenginedirectwrite.cpp b/src/gui/text/qfontenginedirectwrite.cpp index d693273..5bac117 100644 --- a/src/gui/text/qfontenginedirectwrite.cpp +++ b/src/gui/text/qfontenginedirectwrite.cpp @@ -269,15 +269,12 @@ QFixed QFontEngineDirectWrite::emSquareSize() const 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 low = str[i+1].unicode(); - if (low >= 0xdc00 && low < 0xe000) { - uc = (uc - 0xd800)*0x400 + (low - 0xdc00) + 0x10000; - ++i; - } + uint ucs4 = str[i].unicode(); + if (str[i].isHighSurrogate() && i < len-1 && str[i+1].isLowSurrogate()) { + ++i; + ucs4 = QChar::surrogateToUcs4( ucs4, str[i].unicode()); } - return uc; + return ucs4; } bool QFontEngineDirectWrite::stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, |