summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qfontengine_qws.cpp
diff options
context:
space:
mode:
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