From 543489fed29e021112d61a1775134a64d78190c3 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Tue, 1 Feb 2022 08:19:36 +0100 Subject: [PATCH] QTextTable: fix signed/unsigned warning Even disregarding the warning, we're instantiating QList::removeAll(), which is wasteful, so cast the fragment to int, like in the indexOf() call a line above. Detected by a rewrite of, essentially, QList::removeAll() as removeIf() + lambda, which brought the comparison from an -isystem header (std::remove()) into Qt code (the lambda), and apparently un-suppressed the warning. Qt 5.15 has the same code, but is unaffected, because removeAll() is no template there. Pick-to: 6.3 6.2 Change-Id: Id9fe33be647fc3dc958e316f0fbe03009b2a7adc Reviewed-by: Fabian Kosmale --- src/gui/text/qtexttable.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/text/qtexttable.cpp b/src/gui/text/qtexttable.cpp index 951408052da..1db6ff897fe 100644 --- a/src/gui/text/qtexttable.cpp +++ b/src/gui/text/qtexttable.cpp @@ -415,7 +415,7 @@ void QTextTablePrivate::fragmentRemoved(QChar type, uint fragment) return; if (type == QTextBeginningOfFrame) { Q_ASSERT(cells.indexOf(int(fragment)) != -1); - cells.removeAll(fragment); + cells.removeAll(int(fragment)); if (fragment_start == fragment && cells.size()) { fragment_start = cells.at(0); }