QTextTable: fix signed/unsigned warning

Even disregarding the warning, we're instantiating
QList<int>::removeAll<uint>(), 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 <fabian.kosmale@qt.io>
This commit is contained in:
Marc Mutz 2022-02-01 08:19:36 +01:00
parent 05e029619f
commit 543489fed2

View File

@ -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);
}