From 8de4ca1e187a36b4aa67a6817a2e05440a900e10 Mon Sep 17 00:00:00 2001 From: Rmys Date: Thu, 6 Jan 2022 16:41:16 +0300 Subject: [PATCH] qt5-svg qt5-wayland rebuild --- .../toolkit/qt5/qt5-svg/files/qt_kde.patch | 220 +++++++++++++++++- desktop/toolkit/qt5/qt5-svg/pspec.xml | 7 + .../qt5/qt5-wayland/files/qt_kde.patch | 13 ++ desktop/toolkit/qt5/qt5-wayland/pspec.xml | 7 + 4 files changed, 237 insertions(+), 10 deletions(-) diff --git a/desktop/toolkit/qt5/qt5-svg/files/qt_kde.patch b/desktop/toolkit/qt5/qt5-svg/files/qt_kde.patch index b3f6c3dd37..d461231a3a 100644 --- a/desktop/toolkit/qt5/qt5-svg/files/qt_kde.patch +++ b/desktop/toolkit/qt5/qt5-svg/files/qt_kde.patch @@ -51,7 +51,7 @@ index 0000000..b8f8f69 + Notice and Disclaimer - sell variant" + diff --git a/src/plugins/imageformats/svg/qsvgiohandler.cpp b/src/plugins/imageformats/svg/qsvgiohandler.cpp -index bd39b2a..4136aaf 100644 +index bd39b2a..fd3529a 100644 --- a/src/plugins/imageformats/svg/qsvgiohandler.cpp +++ b/src/plugins/imageformats/svg/qsvgiohandler.cpp @@ -118,6 +118,24 @@ QSvgIOHandler::~QSvgIOHandler() @@ -98,7 +98,16 @@ index bd39b2a..4136aaf 100644 return true; } return false; -@@ -260,12 +272,7 @@ bool QSvgIOHandler::supportsOption(ImageOption option) const +@@ -177,6 +189,8 @@ bool QSvgIOHandler::read(QImage *image) + } + } + if (!finalSize.isEmpty()) { ++ if (qMax(finalSize.width(), finalSize.height()) > 0xffff) ++ return false; // Assume corrupted file + image->fill(d->backColor.rgba()); + QPainter p(image); + d->r.render(&p, bounds); +@@ -260,12 +274,7 @@ bool QSvgIOHandler::supportsOption(ImageOption option) const bool QSvgIOHandler::canRead(QIODevice *device) { @@ -113,7 +122,7 @@ index bd39b2a..4136aaf 100644 QT_END_NAMESPACE diff --git a/src/svg/qsvghandler.cpp b/src/svg/qsvghandler.cpp -index c937254..b542089 100644 +index c937254..2ea80ed 100644 --- a/src/svg/qsvghandler.cpp +++ b/src/svg/qsvghandler.cpp @@ -65,6 +65,7 @@ @@ -175,7 +184,24 @@ index c937254..b542089 100644 } break; default: -@@ -1625,8 +1641,11 @@ static bool parsePathDataFast(const QStringRef &dataStr, QPainterPath &path) +@@ -1611,6 +1627,7 @@ static void pathArc(QPainterPath &path, + + static bool parsePathDataFast(const QStringRef &dataStr, QPainterPath &path) + { ++ const int maxElementCount = 0x7fff; // Assume file corruption if more path elements than this + qreal x0 = 0, y0 = 0; // starting point + qreal x = 0, y = 0; // current point + char lastMode = 0; +@@ -1618,28 +1635,31 @@ static bool parsePathDataFast(const QStringRef &dataStr, QPainterPath &path) + const QChar *str = dataStr.constData(); + const QChar *end = str + dataStr.size(); + +- while (str != end) { ++ bool ok = true; ++ while (ok && str != end) { + while (str->isSpace() && (str + 1) != end) + ++str; + QChar pathElem = *str; ++str; QChar endc = *end; *const_cast(end) = 0; // parseNumbersArray requires 0-termination that QStringRef cannot guarantee @@ -188,7 +214,170 @@ index c937254..b542089 100644 *const_cast(end) = endc; if (pathElem == QLatin1Char('z') || pathElem == QLatin1Char('Z')) arg.append(0);//dummy -@@ -2354,6 +2373,27 @@ static bool parseAnimateNode(QSvgNode *parent, + const qreal *num = arg.constData(); + int count = arg.count(); +- while (count > 0) { ++ while (ok && count > 0) { + qreal offsetX = x; // correction offsets + qreal offsetY = y; // for relative commands + switch (pathElem.unicode()) { + case 'm': { + if (count < 2) { +- num++; +- count--; ++ ok = false; + break; + } + x = x0 = num[0] + offsetX; +@@ -1656,8 +1676,7 @@ static bool parsePathDataFast(const QStringRef &dataStr, QPainterPath &path) + break; + case 'M': { + if (count < 2) { +- num++; +- count--; ++ ok = false; + break; + } + x = x0 = num[0]; +@@ -1683,8 +1702,7 @@ static bool parsePathDataFast(const QStringRef &dataStr, QPainterPath &path) + break; + case 'l': { + if (count < 2) { +- num++; +- count--; ++ ok = false; + break; + } + x = num[0] + offsetX; +@@ -1697,8 +1715,7 @@ static bool parsePathDataFast(const QStringRef &dataStr, QPainterPath &path) + break; + case 'L': { + if (count < 2) { +- num++; +- count--; ++ ok = false; + break; + } + x = num[0]; +@@ -1738,8 +1755,7 @@ static bool parsePathDataFast(const QStringRef &dataStr, QPainterPath &path) + break; + case 'c': { + if (count < 6) { +- num += count; +- count = 0; ++ ok = false; + break; + } + QPointF c1(num[0] + offsetX, num[1] + offsetY); +@@ -1755,8 +1771,7 @@ static bool parsePathDataFast(const QStringRef &dataStr, QPainterPath &path) + } + case 'C': { + if (count < 6) { +- num += count; +- count = 0; ++ ok = false; + break; + } + QPointF c1(num[0], num[1]); +@@ -1772,8 +1787,7 @@ static bool parsePathDataFast(const QStringRef &dataStr, QPainterPath &path) + } + case 's': { + if (count < 4) { +- num += count; +- count = 0; ++ ok = false; + break; + } + QPointF c1; +@@ -1794,8 +1808,7 @@ static bool parsePathDataFast(const QStringRef &dataStr, QPainterPath &path) + } + case 'S': { + if (count < 4) { +- num += count; +- count = 0; ++ ok = false; + break; + } + QPointF c1; +@@ -1816,8 +1829,7 @@ static bool parsePathDataFast(const QStringRef &dataStr, QPainterPath &path) + } + case 'q': { + if (count < 4) { +- num += count; +- count = 0; ++ ok = false; + break; + } + QPointF c(num[0] + offsetX, num[1] + offsetY); +@@ -1832,8 +1844,7 @@ static bool parsePathDataFast(const QStringRef &dataStr, QPainterPath &path) + } + case 'Q': { + if (count < 4) { +- num += count; +- count = 0; ++ ok = false; + break; + } + QPointF c(num[0], num[1]); +@@ -1848,8 +1859,7 @@ static bool parsePathDataFast(const QStringRef &dataStr, QPainterPath &path) + } + case 't': { + if (count < 2) { +- num += count; +- count = 0; ++ ok = false; + break; + } + QPointF e(num[0] + offsetX, num[1] + offsetY); +@@ -1869,8 +1879,7 @@ static bool parsePathDataFast(const QStringRef &dataStr, QPainterPath &path) + } + case 'T': { + if (count < 2) { +- num += count; +- count = 0; ++ ok = false; + break; + } + QPointF e(num[0], num[1]); +@@ -1890,8 +1899,7 @@ static bool parsePathDataFast(const QStringRef &dataStr, QPainterPath &path) + } + case 'a': { + if (count < 7) { +- num += count; +- count = 0; ++ ok = false; + break; + } + qreal rx = (*num++); +@@ -1913,8 +1921,7 @@ static bool parsePathDataFast(const QStringRef &dataStr, QPainterPath &path) + break; + case 'A': { + if (count < 7) { +- num += count; +- count = 0; ++ ok = false; + break; + } + qreal rx = (*num++); +@@ -1935,12 +1942,15 @@ static bool parsePathDataFast(const QStringRef &dataStr, QPainterPath &path) + } + break; + default: +- return false; ++ ok = false; ++ break; + } + lastMode = pathElem.toLatin1(); ++ if (path.elementCount() > maxElementCount) ++ ok = false; + } + } +- return true; ++ return ok; + } + + static bool parseStyle(QSvgNode *node, +@@ -2354,6 +2364,27 @@ static bool parseAnimateNode(QSvgNode *parent, return true; } @@ -216,7 +405,7 @@ index c937254..b542089 100644 static bool parseAnimateColorNode(QSvgNode *parent, const QXmlStreamAttributes &attributes, QSvgHandler *handler) -@@ -2387,23 +2427,13 @@ static bool parseAnimateColorNode(QSvgNode *parent, +@@ -2387,23 +2418,13 @@ static bool parseAnimateColorNode(QSvgNode *parent, } } @@ -247,7 +436,7 @@ index c937254..b542089 100644 QSvgAnimateColor *anim = new QSvgAnimateColor(begin, end, 0); anim->setArgs((targetStr == QLatin1String("fill")), colors); -@@ -2493,24 +2523,13 @@ static bool parseAnimateTransformNode(QSvgNode *parent, +@@ -2493,24 +2514,13 @@ static bool parseAnimateTransformNode(QSvgNode *parent, } } @@ -279,7 +468,7 @@ index c937254..b542089 100644 QSvgAnimateTransform::TransformType type = QSvgAnimateTransform::Empty; if (typeStr == QLatin1String("translate")) { -@@ -2566,6 +2585,8 @@ static QSvgNode *createCircleNode(QSvgNode *parent, +@@ -2566,6 +2576,8 @@ static QSvgNode *createCircleNode(QSvgNode *parent, qreal ncx = toDouble(cx); qreal ncy = toDouble(cy); qreal nr = toDouble(r); @@ -288,7 +477,18 @@ index c937254..b542089 100644 QRectF rect(ncx-nr, ncy-nr, nr*2, nr*2); QSvgNode *circle = new QSvgCircle(parent, rect); -@@ -3036,13 +3057,16 @@ static QSvgStyleProperty *createRadialGradientNode(QSvgNode *node, +@@ -2976,8 +2988,8 @@ static QSvgNode *createPathNode(QSvgNode *parent, + + QPainterPath qpath; + qpath.setFillRule(Qt::WindingFill); +- //XXX do error handling +- parsePathDataFast(data, qpath); ++ if (!parsePathDataFast(data, qpath)) ++ qCWarning(lcSvgHandler, "Invalid path data; path truncated."); + + QSvgNode *path = new QSvgPath(parent, qpath); + return path; +@@ -3036,13 +3048,16 @@ static QSvgStyleProperty *createRadialGradientNode(QSvgNode *node, qreal ncx = 0.5; qreal ncy = 0.5; @@ -306,7 +506,7 @@ index c937254..b542089 100644 qreal nfx = ncx; if (!fx.isEmpty()) -@@ -3338,7 +3362,9 @@ static QSvgNode *createTextNode(QSvgNode *parent, +@@ -3338,7 +3353,9 @@ static QSvgNode *createTextNode(QSvgNode *parent, //### editable and rotate not handled QSvgHandler::LengthType type; qreal nx = parseLength(x, type, handler); diff --git a/desktop/toolkit/qt5/qt5-svg/pspec.xml b/desktop/toolkit/qt5/qt5-svg/pspec.xml index ccea5226a4..e4421df19d 100755 --- a/desktop/toolkit/qt5/qt5-svg/pspec.xml +++ b/desktop/toolkit/qt5/qt5-svg/pspec.xml @@ -60,6 +60,13 @@ + + 2022-01-06 + 5.15.2 + Rebuild kde patch. + Mustafa Cinasal + muscnsl@gmail.com + 2021-11-10 5.15.2 diff --git a/desktop/toolkit/qt5/qt5-wayland/files/qt_kde.patch b/desktop/toolkit/qt5/qt5-wayland/files/qt_kde.patch index 7430333dd3..1c6ff69b34 100644 --- a/desktop/toolkit/qt5/qt5-wayland/files/qt_kde.patch +++ b/desktop/toolkit/qt5/qt5-wayland/files/qt_kde.patch @@ -1116,6 +1116,19 @@ index 1d635f06..e2f87bbd 100644 printf(" that->m_resource = nullptr;\n"); printf(" }\n"); printf(" delete resource;\n"); +diff --git a/src/shared/qwaylandinputmethodeventbuilder.cpp b/src/shared/qwaylandinputmethodeventbuilder.cpp +index 526d0ef4..25be2509 100644 +--- a/src/shared/qwaylandinputmethodeventbuilder.cpp ++++ b/src/shared/qwaylandinputmethodeventbuilder.cpp +@@ -151,7 +151,7 @@ QInputMethodEvent QWaylandInputMethodEventBuilder::buildPreedit(const QString &t + { + QList attributes; + +- if (m_preeditCursor < 0) { ++ if (m_preeditCursor <= 0) { + attributes.append(QInputMethodEvent::Attribute(QInputMethodEvent::Cursor, 0, 0, QVariant())); + } else if (m_preeditCursor > 0) { + attributes.append(QInputMethodEvent::Attribute(QInputMethodEvent::Cursor, indexFromWayland(text, m_preeditCursor), 1, QVariant())); diff --git a/src/shared/qwaylandmimehelper.cpp b/src/shared/qwaylandmimehelper.cpp index a5fdd34d..051a91dc 100644 --- a/src/shared/qwaylandmimehelper.cpp diff --git a/desktop/toolkit/qt5/qt5-wayland/pspec.xml b/desktop/toolkit/qt5/qt5-wayland/pspec.xml index 6339feaa63..d0a16aad84 100755 --- a/desktop/toolkit/qt5/qt5-wayland/pspec.xml +++ b/desktop/toolkit/qt5/qt5-wayland/pspec.xml @@ -85,6 +85,13 @@ + + 2022-01-06 + 5.15.2 + Rebuild kde patch + Mustafa Cinasal + muscnsl@gmail.com + 2021-12-11 5.15.2