From d8f4d4452d4a4435e647ffa7c3fce63b25fdb5d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tony=20Saraj=C3=A4rvi?= Date: Thu, 18 Feb 2016 11:26:38 +0200 Subject: Adjust tst_qabstracttextdocumentlayout for border cases OpenSUSE 42.1 failed this case for some reason. With this change the test tests the anchor from the middle of the string instead of looking for it from the end. Task-number: QTBUG-51345 Change-Id: I2fc7496399f46926f261c7a1f48756bfaf782f7b Reviewed-by: Pekka Vuorela Reviewed-by: Simon Hausmann --- .../qabstracttextdocumentlayout/tst_qabstracttextdocumentlayout.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/auto/gui/text/qabstracttextdocumentlayout/tst_qabstracttextdocumentlayout.cpp') diff --git a/tests/auto/gui/text/qabstracttextdocumentlayout/tst_qabstracttextdocumentlayout.cpp b/tests/auto/gui/text/qabstracttextdocumentlayout/tst_qabstracttextdocumentlayout.cpp index d3404e335a..15fb392b18 100644 --- a/tests/auto/gui/text/qabstracttextdocumentlayout/tst_qabstracttextdocumentlayout.cpp +++ b/tests/auto/gui/text/qabstracttextdocumentlayout/tst_qabstracttextdocumentlayout.cpp @@ -156,7 +156,7 @@ void tst_QAbstractTextDocumentLayout::anchorAt() // anchorAt on start returns link QRect linkBr = metrics.boundingRect("foo"); - QPointF linkPoint(linkBr.width() + blockStart.x(), (linkBr.height() / 2) + blockStart.y()); + QPointF linkPoint((linkBr.width() / 2) + blockStart.x(), (linkBr.height() / 2) + blockStart.y()); QCOMPARE(documentLayout->anchorAt(linkPoint), QString("link")); // anchorAt() on top of preedit at end should not assert -- cgit v1.2.3