From feee51b300f70d9018720f4f7bfc53bea2c02e3f Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Fri, 14 Jun 2019 16:51:55 +0200 Subject: Fix endl usage to contain prefixes and bump version to 6.0.0 Change-Id: Ia10879666a87dc4db596b75cfbf654379e75041b (cherry picked from commit 5c298ef5bea0930b68263ba84194250dbb9d26a9) Reviewed-by: Friedemann Kleint --- src/svg/qsvggenerator.cpp | 52 +++++++++++++++++++++++------------------------ 1 file changed, 26 insertions(+), 26 deletions(-) (limited to 'src') diff --git a/src/svg/qsvggenerator.cpp b/src/svg/qsvggenerator.cpp index b671c44..360b02b 100644 --- a/src/svg/qsvggenerator.cpp +++ b/src/svg/qsvggenerator.cpp @@ -227,10 +227,10 @@ public: QString rct(QStringLiteral("")); QTextStream str(&d_func()->defs, QIODevice::Append); str << "" << endl; + << "stroke=\"none\" fill=\"#ffffff\" patternUnits=\"userSpaceOnUse\" >" << Qt::endl; for (QRect r : reg) - str << rct.arg(r.x()).arg(r.y()).arg(r.width()).arg(r.height()) << endl; - str << QStringLiteral("") << endl << endl; + str << rct.arg(r.x()).arg(r.y()).arg(r.width()).arg(r.height()) << Qt::endl; + str << QStringLiteral("") << Qt::endl << Qt::endl; d_func()->savedPatternMasks.append(maskId); } return maskId; @@ -243,9 +243,9 @@ public: QString maskId = savePatternMask(brush.style()); QString geo(QStringLiteral("x=\"0\" y=\"0\" width=\"8\" height=\"8\"")); QTextStream str(&d_func()->defs, QIODevice::Append); - str << QString(QStringLiteral("")).arg(patternId, geo) << endl; - str << QString(QStringLiteral("")).arg(geo, color, maskId) << endl; - str << QStringLiteral("") << endl << endl; + str << QString(QStringLiteral("")).arg(patternId, geo) << Qt::endl; + str << QString(QStringLiteral("")).arg(geo, color, maskId) << Qt::endl; + str << QStringLiteral("") << Qt::endl << Qt::endl; d_func()->savedPatternBrushes.append(patternId); } return patternId; @@ -266,7 +266,7 @@ public: str << QLatin1String("id=\"") << d_func()->generateGradientName() << QLatin1String("\">\n"); saveGradientStops(str, g); - str << QLatin1String("") <") <generateGradientName()<< QLatin1String("\">\n"); saveGradientStops(str, g); - str << QLatin1String("") << endl; + str << QLatin1String("") << Qt::endl; } void saveConicalGradientBrush(const QGradient *) { @@ -544,7 +544,7 @@ public: "font-size=\"" << d->attributes.font_size << "\" " "font-weight=\"" << d->attributes.font_weight << "\" " "font-style=\"" << d->attributes.font_style << "\" " - << endl; + << Qt::endl; } }; @@ -892,29 +892,29 @@ bool QSvgPaintEngine::begin(QPaintDevice *) d->stream = new QTextStream(&d->header); // stream out the header... - *d->stream << "" << endl << "stream << "" << Qt::endl << "size.isValid()) { qreal wmm = d->size.width() * 25.4 / d->resolution; qreal hmm = d->size.height() * 25.4 / d->resolution; - *d->stream << " width=\"" << wmm << "mm\" height=\"" << hmm << "mm\"" << endl; + *d->stream << " width=\"" << wmm << "mm\" height=\"" << hmm << "mm\"" << Qt::endl; } if (d->viewBox.isValid()) { *d->stream << " viewBox=\"" << d->viewBox.left() << ' ' << d->viewBox.top(); - *d->stream << ' ' << d->viewBox.width() << ' ' << d->viewBox.height() << '\"' << endl; + *d->stream << ' ' << d->viewBox.width() << ' ' << d->viewBox.height() << '\"' << Qt::endl; } *d->stream << " xmlns=\"http://www.w3.org/2000/svg\"" " xmlns:xlink=\"http://www.w3.org/1999/xlink\" " - " version=\"1.2\" baseProfile=\"tiny\">" << endl; + " version=\"1.2\" baseProfile=\"tiny\">" << Qt::endl; if (!d->attributes.document_title.isEmpty()) { - *d->stream << "" << d->attributes.document_title << "" << endl; + *d->stream << "" << d->attributes.document_title << "" << Qt::endl; } if (!d->attributes.document_description.isEmpty()) { - *d->stream << "" << d->attributes.document_description << "" << endl; + *d->stream << "" << d->attributes.document_description << "" << Qt::endl; } d->stream->setString(&d->defs); @@ -924,7 +924,7 @@ bool QSvgPaintEngine::begin(QPaintDevice *) // Start the initial graphics state... *d->stream << "stream << endl; + *d->stream << Qt::endl; return true; } @@ -945,10 +945,10 @@ bool QSvgPaintEngine::end() *d->stream << d->defs; *d->stream << d->body; if (d->afterFirstUpdate) - *d->stream << "" << endl; // close the updateState + *d->stream << "" << Qt::endl; // close the updateState - *d->stream << "" << endl // close the Qt defaults - << "" << endl; + *d->stream << "" << Qt::endl // close the Qt defaults + << "" << Qt::endl; delete d->stream; @@ -1015,7 +1015,7 @@ void QSvgPaintEngine::updateState(const QPaintEngineState &state) << d->matrix.m21() << ',' << d->matrix.m22() << ',' << d->matrix.dx() << ',' << d->matrix.dy() << ")\"" - << endl; + << Qt::endl; } if (flags & QPaintEngine::DirtyFont) { @@ -1027,7 +1027,7 @@ void QSvgPaintEngine::updateState(const QPaintEngineState &state) stream() << "opacity=\""<stream << '>' << endl; + *d->stream << '>' << Qt::endl; d->afterFirstUpdate = true; } @@ -1046,7 +1046,7 @@ void QSvgPaintEngine::drawEllipse(const QRectF &r) *d->stream << "\" r=\"" << r.width() / qreal(2.0); else *d->stream << "\" rx=\"" << r.width() / qreal(2.0) << "\" ry=\"" << r.height() / qreal(2.0); - *d->stream << "\"/>" << endl; + *d->stream << "\"/>" << Qt::endl; } void QSvgPaintEngine::drawPath(const QPainterPath &p) @@ -1090,7 +1090,7 @@ void QSvgPaintEngine::drawPath(const QPainterPath &p) } } - *d->stream << "\"/>" << endl; + *d->stream << "\"/>" << Qt::endl; } void QSvgPaintEngine::drawPolygon(const QPointF *points, int pointCount, @@ -1112,7 +1112,7 @@ void QSvgPaintEngine::drawPolygon(const QPointF *points, int pointCount, const QPointF &pt = points[i]; stream() << pt.x() << ',' << pt.y() << ' '; } - stream() << "\" />" <" <stream << " vector-effect=\"non-scaling-stroke\""; *d->stream << " x=\"" << rect.x() << "\" y=\"" << rect.y() << "\" width=\"" << rect.width() << "\" height=\"" << rect.height() - << "\"/>" << endl; + << "\"/>" << Qt::endl; } } @@ -1155,7 +1155,7 @@ void QSvgPaintEngine::drawTextItem(const QPointF &pt, const QTextItem &textItem) *d->stream << " >" << s.toHtmlEscaped() << "" - << endl; + << Qt::endl; } QT_END_NAMESPACE -- cgit v1.2.1