summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qfontengine_qpf.cpp
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2011-09-08 16:27:12 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2011-09-08 16:27:12 (GMT)
commit3b4400e9a8a4cc1851344b057d4c4f0bcfcc0400 (patch)
tree05c11c5636d44b7e8afaa5982cc48fe2eb45726d /src/gui/text/qfontengine_qpf.cpp
parent260005374b9b930aa583cd117aba96f8f4b34131 (diff)
parent2a1e82452a192c88bcf0250f5976492f6dc3b65f (diff)
downloadQt-3b4400e9a8a4cc1851344b057d4c4f0bcfcc0400.zip
Qt-3b4400e9a8a4cc1851344b057d4c4f0bcfcc0400.tar.gz
Qt-3b4400e9a8a4cc1851344b057d4c4f0bcfcc0400.tar.bz2
Merge branch 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-1: Split CFLAGS from pkg-config properly Ensure that the proxystyle is used over the style's own functions runonphone: Add a missing space between a message and the file name Perl check for windows configure. QSettings: don't assume XDG_CONFIG_HOME is latin1-encoded QSettings: use the common appdata dir when bootstrapping qmake on win Replace explicit surrogate handlers by inline methods of QChar class
Diffstat (limited to 'src/gui/text/qfontengine_qpf.cpp')
-rw-r--r--src/gui/text/qfontengine_qpf.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/gui/text/qfontengine_qpf.cpp b/src/gui/text/qfontengine_qpf.cpp
index 30a1623..3db5ce1 100644
--- a/src/gui/text/qfontengine_qpf.cpp
+++ b/src/gui/text/qfontengine_qpf.cpp
@@ -278,15 +278,12 @@ QList<QByteArray> QFontEngineQPF::cleanUpAfterClientCrash(const QList<int> &cras
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;
}
#ifdef QT_FONTS_ARE_RESOURCES
QFontEngineQPF::QFontEngineQPF(const QFontDef &def, const uchar *bytes, int size)