From 79f262711c053608c7b0d775a8c7031368ddd17f Mon Sep 17 00:00:00 2001 From: Andy Shaw <andy.shaw@digia.com> Date: Tue, 24 Jun 2014 14:05:43 +0200 Subject: [PATCH] Clear the visibleImgTags list when setting up the text layout Since the text layout is being redone then the visibleImgTags will be repopulated, therefore it should be cleared first so that it doesn't have duplicated entries. Change-Id: I415f94326e156ae265bc044544f2bb0d7146ce4c Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com> --- src/quick/items/qquicktext.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/quick/items/qquicktext.cpp b/src/quick/items/qquicktext.cpp index e26ad2769a..71265689e9 100644 --- a/src/quick/items/qquicktext.cpp +++ b/src/quick/items/qquicktext.cpp @@ -711,7 +711,8 @@ QRectF QQuickTextPrivate::setupTextLayout(qreal *const baseline) } bool shouldUseDesignMetrics = renderType != QQuickText::NativeRendering; - + if (!visibleImgTags.isEmpty()) + visibleImgTags.clear(); layout.setCacheEnabled(true); QTextOption textOption = layout.textOption(); if (textOption.alignment() != q->effectiveHAlign() -- GitLab