summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Faure <david.faure@kdab.com>2020-11-06 20:26:44 +0100
committerDavid Faure <david.faure@kdab.com>2020-11-07 11:13:23 +0100
commit3a7d6159fbb85e872ab746d30bdbf3329ed43e17 (patch)
treef4316c9d97f8040daeb93a913c37087fa13d4814
parent7c4f3df7ba750fc6d5e6e1068fc87fe787b53089 (diff)
downloadqtsvg-3a7d6159fbb85e872ab746d30bdbf3329ed43e17.tar.gz
QtSvg: build with explicit QChar(int) constructor
Change-Id: I4d2a336b63f65ae6235b9a4b5c899e4d624492cd Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
-rw-r--r--src/svg/qsvgfont.cpp4
-rw-r--r--src/svg/qsvghandler.cpp4
-rw-r--r--tests/auto/qsvggenerator/tst_qsvggenerator.cpp2
3 files changed, 5 insertions, 5 deletions
diff --git a/src/svg/qsvgfont.cpp b/src/svg/qsvgfont.cpp
index 6487de4..eb6c9cf 100644
--- a/src/svg/qsvgfont.cpp
+++ b/src/svg/qsvgfont.cpp
@@ -84,7 +84,7 @@ void QSvgFont::draw(QPainter *p, const QPointF &point, const QString &str, qreal
for ( ; itr != str.constEnd(); ++itr) {
QChar unicode = *itr;
if (!m_glyphs.contains(*itr)) {
- unicode = 0;
+ unicode = u'\0';
if (!m_glyphs.contains(unicode))
continue;
}
@@ -112,7 +112,7 @@ void QSvgFont::draw(QPainter *p, const QPointF &point, const QString &str, qreal
for ( ; itr != str.constEnd(); ++itr) {
QChar unicode = *itr;
if (!m_glyphs.contains(*itr)) {
- unicode = 0;
+ unicode = u'\0';
if (!m_glyphs.contains(unicode))
continue;
}
diff --git a/src/svg/qsvghandler.cpp b/src/svg/qsvghandler.cpp
index 9fe892d..5e7607a 100644
--- a/src/svg/qsvghandler.cpp
+++ b/src/svg/qsvghandler.cpp
@@ -938,7 +938,7 @@ static bool createSvgGlyph(QSvgFont *font, const QXmlStreamAttributes &attribute
QStringView havStr = attributes.value(QLatin1String("horiz-adv-x"));
QStringView pathStr = attributes.value(QLatin1String("d"));
- QChar unicode = (uncStr.isEmpty()) ? 0 : uncStr.at(0);
+ QChar unicode = (uncStr.isEmpty()) ? u'\0' : uncStr.at(0);
qreal havx = (havStr.isEmpty()) ? -1 : toDouble(havStr);
QPainterPath path;
path.setFillRule(Qt::WindingFill);
@@ -1594,7 +1594,7 @@ static bool parsePathDataFast(QStringView dataStr, QPainterPath &path)
QChar pathElem = *str;
++str;
QChar endc = *end;
- *const_cast<QChar *>(end) = 0; // parseNumbersArray requires 0-termination that QStringView cannot guarantee
+ *const_cast<QChar *>(end) = u'\0'; // parseNumbersArray requires 0-termination that QStringView cannot guarantee
QVarLengthArray<qreal, 8> arg;
parseNumbersArray(str, arg);
*const_cast<QChar *>(end) = endc;
diff --git a/tests/auto/qsvggenerator/tst_qsvggenerator.cpp b/tests/auto/qsvggenerator/tst_qsvggenerator.cpp
index 4f626c3..22657f0 100644
--- a/tests/auto/qsvggenerator/tst_qsvggenerator.cpp
+++ b/tests/auto/qsvggenerator/tst_qsvggenerator.cpp
@@ -298,7 +298,7 @@ void tst_QSvgGenerator::fileEncoding()
generator.setOutputDevice(&buffer);
static const QChar unicode[] = { 'f', 'o', 'o',
- 0x00F8, 'b', 'a', 'r'};
+ u'\u00F8', 'b', 'a', 'r'};
int size = sizeof(unicode) / sizeof(QChar);
QString unicodeString = QString::fromRawData(unicode, size);