summaryrefslogtreecommitdiff
path: root/vcl/qa
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2020-05-16 19:45:41 +0200
committerTomaž Vajngerl <quikee@gmail.com>2020-06-01 12:21:20 +0200
commit4062b3f87689e48fd250d9cf0297a24b5427bf59 (patch)
treeacf2965ce607284032fc2d587ccf1109ca4000b8 /vcl/qa
parent115655a09868d5977f740995d88e36d958f30bb5 (diff)
vcl: VectorGraphicSearch - add search result selection rectangles
Change-Id: Ia0c5610f600719bcfb5de503f3876fc896cb630a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95256 Tested-by: Tomaž Vajngerl <quikee@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'vcl/qa')
-rw-r--r--vcl/qa/cppunit/VectorGraphicSearchTest.cxx23
1 files changed, 23 insertions, 0 deletions
diff --git a/vcl/qa/cppunit/VectorGraphicSearchTest.cxx b/vcl/qa/cppunit/VectorGraphicSearchTest.cxx
index 0ed21ccf9e26..112748d23bbe 100644
--- a/vcl/qa/cppunit/VectorGraphicSearchTest.cxx
+++ b/vcl/qa/cppunit/VectorGraphicSearchTest.cxx
@@ -9,6 +9,7 @@
#include <cppunit/TestAssert.h>
#include <cppunit/extensions/HelperMacros.h>
+
#include <unotest/bootstrapfixturebase.hxx>
#include <unotest/directories.hxx>
@@ -43,6 +44,28 @@ void VectorGraphicSearchTest::test()
CPPUNIT_ASSERT_EQUAL(true, aSearch.search("lazy"));
CPPUNIT_ASSERT_EQUAL(true, aSearch.next());
CPPUNIT_ASSERT_EQUAL(34, aSearch.index());
+ auto aRectangles = aSearch.getTextRectangles();
+ CPPUNIT_ASSERT_EQUAL(size_t(4), aRectangles.size());
+
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(229.00, aRectangles[0].getMinX(), 1E-2);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(231.85, aRectangles[0].getMaxX(), 1E-2);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(724.10, aRectangles[0].getMinY(), 1E-2);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(732.42, aRectangles[0].getMaxY(), 1E-2);
+
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(232.47, aRectangles[1].getMinX(), 1E-2);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(237.22, aRectangles[1].getMaxX(), 1E-2);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(723.99, aRectangles[1].getMinY(), 1E-2);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(729.72, aRectangles[1].getMaxY(), 1E-2);
+
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(237.68, aRectangles[2].getMinX(), 1E-2);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(242.35, aRectangles[2].getMaxX(), 1E-2);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(724.09, aRectangles[2].getMinY(), 1E-2);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(729.60, aRectangles[2].getMaxY(), 1E-2);
+
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(242.81, aRectangles[3].getMinX(), 1E-2);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(248.61, aRectangles[3].getMaxX(), 1E-2);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(721.51, aRectangles[3].getMinY(), 1E-2);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(729.60, aRectangles[3].getMaxY(), 1E-2);
}
CPPUNIT_TEST_SUITE_REGISTRATION(VectorGraphicSearchTest);