summaryrefslogtreecommitdiff
path: root/vcl/qa/cppunit/PDFiumLibraryTest.cxx
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2020-06-28 13:46:41 +0200
committerTomaž Vajngerl <quikee@gmail.com>2020-06-29 14:36:16 +0200
commit4e9b03d04f740a0cbafa22a4f3cedfae7f37a994 (patch)
tree52e23b903d350255937d817fa13f8de15f279119 /vcl/qa/cppunit/PDFiumLibraryTest.cxx
parentb5b8da80439419a2daa6a80c9d3979173fe2887a (diff)
pdf: add text page object attribs, refactor ImpSdrPdfImport, tests
This refactors ImpSdrPdfImport to push more functions into the PDFium wrapper. The focus is on text page object attributes. Change-Id: Ie1faf5e3743eec7c77050835651533f9e227c2a7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97366 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'vcl/qa/cppunit/PDFiumLibraryTest.cxx')
-rw-r--r--vcl/qa/cppunit/PDFiumLibraryTest.cxx16
1 files changed, 15 insertions, 1 deletions
diff --git a/vcl/qa/cppunit/PDFiumLibraryTest.cxx b/vcl/qa/cppunit/PDFiumLibraryTest.cxx
index 9c0c92607b14..43d6b92bae27 100644
--- a/vcl/qa/cppunit/PDFiumLibraryTest.cxx
+++ b/vcl/qa/cppunit/PDFiumLibraryTest.cxx
@@ -134,10 +134,24 @@ void PDFiumLibraryTest::testPageObjects()
auto pPageObject = pPage->getObject(0);
auto pTextPage = pPage->getTextPage();
- CPPUNIT_ASSERT_EQUAL(1, pPageObject->getType());
+ CPPUNIT_ASSERT_EQUAL(1, pPageObject->getType()); // FPDF_PAGEOBJ_TEXT
+
CPPUNIT_ASSERT_EQUAL(OUString("The quick, brown fox jumps over a lazy dog. DJs flock by when "
"MTV ax quiz prog. Junk MTV quiz "),
pPageObject->getText(pTextPage));
+
+ CPPUNIT_ASSERT_EQUAL(12.0, pPageObject->getFontSize());
+ CPPUNIT_ASSERT_EQUAL(OUString("Liberation Serif"), pPageObject->getFontName());
+ CPPUNIT_ASSERT_EQUAL(0, pPageObject->getTextRenderMode()); // FPDF_TEXTRENDERMODE_FILL
+ CPPUNIT_ASSERT_EQUAL(COL_BLACK, pPageObject->getFillColor());
+ CPPUNIT_ASSERT_EQUAL(COL_BLACK, pPageObject->getStrokeColor());
+
+ CPPUNIT_ASSERT_EQUAL(true, pPageObject->getMatrix().isIdentity());
+
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(057.01, pPageObject->getBounds().getMinX(), 1E-2);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(721.51, pPageObject->getBounds().getMinY(), 1E-2);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(539.48, pPageObject->getBounds().getMaxX(), 1E-2);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(732.54, pPageObject->getBounds().getMaxY(), 1E-2);
}
void PDFiumLibraryTest::testAnnotationsMadeInEvince()