summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2016-11-24 09:36:06 +0000
committerThe Qt Project <gerrit-noreply@qt-project.org>2016-11-24 11:18:22 +0000
commit3966ab51ff140f173f1f0c23fa3a9ef985c73d27 (patch)
treef30302c2c40e8d1b30e3ab589917eca5883aa3a2 /src/gui
parent0861c2176c6dc1c69b733c1a843c2db5ec8ea786 (diff)
parent4783de0473a288fdff7e5354c12315ba025ec7e0 (diff)
Merge "Merge remote-tracking branch 'origin/5.7' into 5.8" into refs/staging/5.8
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/image/qxbmhandler.cpp13
-rw-r--r--src/gui/kernel/qkeysequence.cpp4
-rw-r--r--src/gui/text/qcssparser.cpp1
-rw-r--r--src/gui/text/qfontdatabase.cpp3
-rw-r--r--src/gui/text/qfontengine.cpp1
-rw-r--r--src/gui/text/qfontengine_p.h1
6 files changed, 15 insertions, 8 deletions
diff --git a/src/gui/image/qxbmhandler.cpp b/src/gui/image/qxbmhandler.cpp
index eda816f0f2..19015c5dcd 100644
--- a/src/gui/image/qxbmhandler.cpp
+++ b/src/gui/image/qxbmhandler.cpp
@@ -124,17 +124,18 @@ static bool read_xbm_body(QIODevice *device, int w, int h, QImage *outImage)
qint64 readBytes = 0;
+ char *p;
+
// scan for database
- for (;;) {
+ do {
if ((readBytes = device->readLine(buf, buflen)) <= 0) {
// end of file
return false;
}
buf[readBytes] = '\0';
- if (QByteArray::fromRawData(buf, readBytes).contains("0x"))
- break;
- }
+ p = strstr(buf, "0x");
+ } while (!p);
if (outImage->size() != QSize(w, h) || outImage->format() != QImage::Format_MonoLSB) {
*outImage = QImage(w, h, QImage::Format_MonoLSB);
@@ -148,7 +149,6 @@ static bool read_xbm_body(QIODevice *device, int w, int h, QImage *outImage)
int x = 0, y = 0;
uchar *b = outImage->scanLine(0);
- char *p = buf + QByteArray::fromRawData(buf, readBytes).indexOf("0x");
w = (w+7)/8; // byte width
while (y < h) { // for all encoded bytes...
@@ -163,7 +163,8 @@ static bool read_xbm_body(QIODevice *device, int w, int h, QImage *outImage)
} else { // read another line
if ((readBytes = device->readLine(buf,buflen)) <= 0) // EOF ==> truncated image
break;
- p = buf + QByteArray::fromRawData(buf, readBytes).indexOf("0x");
+ buf[readBytes] = '\0';
+ p = strstr(buf, "0x");
}
}
diff --git a/src/gui/kernel/qkeysequence.cpp b/src/gui/kernel/qkeysequence.cpp
index d59bd63caf..a6bc7d4d9c 100644
--- a/src/gui/kernel/qkeysequence.cpp
+++ b/src/gui/kernel/qkeysequence.cpp
@@ -1528,7 +1528,9 @@ bool QKeySequence::isDetached() const
If the key sequence has no keys, an empty string is returned.
On \macos, the string returned resembles the sequence that is
- shown in the menu bar.
+ shown in the menu bar if \a format is
+ QKeySequence::NativeText; otherwise, the string uses the
+ "portable" format, suitable for writing to a file.
\sa fromString()
*/
diff --git a/src/gui/text/qcssparser.cpp b/src/gui/text/qcssparser.cpp
index 31d832a9ce..a0438bd458 100644
--- a/src/gui/text/qcssparser.cpp
+++ b/src/gui/text/qcssparser.cpp
@@ -2211,6 +2211,7 @@ void Parser::init(const QString &css, bool isFile)
bool Parser::parse(StyleSheet *styleSheet, Qt::CaseSensitivity nameCaseSensitivity)
{
if (testTokenAndEndsWith(ATKEYWORD_SYM, QLatin1String("charset"))) {
+ while (test(S) || test(CDO) || test(CDC)) {}
if (!next(STRING)) return false;
if (!next(SEMICOLON)) return false;
}
diff --git a/src/gui/text/qfontdatabase.cpp b/src/gui/text/qfontdatabase.cpp
index 5145385fdc..43648d0f7f 100644
--- a/src/gui/text/qfontdatabase.cpp
+++ b/src/gui/text/qfontdatabase.cpp
@@ -952,8 +952,8 @@ QFontEngine *loadSingleEngine(int script,
return 0;
}
+ engine->isSmoothlyScalable = style->smoothScalable;
fontCache->insertEngine(key, engine);
-
return engine;
}
}
@@ -978,6 +978,7 @@ QFontEngine *loadSingleEngine(int script,
return 0;
}
+ engine->isSmoothlyScalable = style->smoothScalable;
fontCache->insertEngine(key, engine);
if (Q_LIKELY(cacheForCommonScript && !engine->symbol)) {
diff --git a/src/gui/text/qfontengine.cpp b/src/gui/text/qfontengine.cpp
index a7d7185a7e..0b2972f189 100644
--- a/src/gui/text/qfontengine.cpp
+++ b/src/gui/text/qfontengine.cpp
@@ -257,6 +257,7 @@ QFontEngine::QFontEngine(Type type)
cache_cost = 0;
fsType = 0;
symbol = false;
+ isSmoothlyScalable = false;
glyphFormat = Format_None;
m_subPixelPositionCount = 0;
diff --git a/src/gui/text/qfontengine_p.h b/src/gui/text/qfontengine_p.h
index 42610e9b70..c0e350f755 100644
--- a/src/gui/text/qfontengine_p.h
+++ b/src/gui/text/qfontengine_p.h
@@ -325,6 +325,7 @@ public:
uint cache_cost; // amount of mem used in bytes by the font
uint fsType : 16;
bool symbol;
+ bool isSmoothlyScalable;
struct KernPair {
uint left_right;
QFixed adjust;