summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qfontengine_qws.cpp
diff options
context:
space:
mode:
authorSami Lempinen <sami.lempinen@nokia.com>2011-09-20 09:59:45 (GMT)
committerSami Lempinen <sami.lempinen@nokia.com>2011-09-20 09:59:45 (GMT)
commit03645fccea8f2bf997ed4191d7a67a0e93a977d6 (patch)
treeb9f1490bacd05aea265783bfb5d9e40fe6b2b0dc /src/gui/text/qfontengine_qws.cpp
parenta0ad54acd33873316908080f432768fdf3e3bfc2 (diff)
parent367a89cf5cb1282d2e966c83869a56fd22745779 (diff)
downloadQt-03645fccea8f2bf997ed4191d7a67a0e93a977d6.zip
Qt-03645fccea8f2bf997ed4191d7a67a0e93a977d6.tar.gz
Qt-03645fccea8f2bf997ed4191d7a67a0e93a977d6.tar.bz2
Merge remote-tracking branch 'qt/4.8'
Diffstat (limited to 'src/gui/text/qfontengine_qws.cpp')
-rw-r--r--src/gui/text/qfontengine_qws.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/gui/text/qfontengine_qws.cpp b/src/gui/text/qfontengine_qws.cpp
index 237842b..ade283f 100644
--- a/src/gui/text/qfontengine_qws.cpp
+++ b/src/gui/text/qfontengine_qws.cpp
@@ -83,15 +83,12 @@ QT_BEGIN_NAMESPACE
static 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;
}
#define FM_SMOOTH 1