From e4d7f45103e28e31afbacd084b9da35be691373b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20T=C5=AFma?= Date: Sat, 17 Oct 2020 20:59:58 +0200 Subject: [PATCH] Remove the right item from the list --- src/map/IMG/rastertile.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/map/IMG/rastertile.cpp b/src/map/IMG/rastertile.cpp index 70b57e5b..6b43f917 100644 --- a/src/map/IMG/rastertile.cpp +++ b/src/map/IMG/rastertile.cpp @@ -240,10 +240,10 @@ void RasterTile::drawTextItems(QPainter *painter, static void removeDuplicitLabel(QList &labels, const QString &text, const QRectF &tileRect) { - for (int j = 0; j < labels.size(); j++) { - TextItem *item = labels.at(j); + for (int i = 0; i < labels.size(); i++) { + TextItem *item = labels.at(i); if (tileRect.contains(item->boundingRect()) && *(item->text()) == text) { - labels.removeOne(item); + labels.removeAt(i); delete item; return; }