diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2020-06-28 13:46:41 +0200 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2020-06-29 14:36:16 +0200 |
commit | 4e9b03d04f740a0cbafa22a4f3cedfae7f37a994 (patch) | |
tree | 52e23b903d350255937d817fa13f8de15f279119 /sd | |
parent | b5b8da80439419a2daa6a80c9d3979173fe2887a (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 'sd')
-rw-r--r-- | sd/qa/unit/SdrPdfImportTest.cxx | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sd/qa/unit/SdrPdfImportTest.cxx b/sd/qa/unit/SdrPdfImportTest.cxx index e8dd60b0a806..07f90ba26e24 100644 --- a/sd/qa/unit/SdrPdfImportTest.cxx +++ b/sd/qa/unit/SdrPdfImportTest.cxx @@ -88,6 +88,9 @@ CPPUNIT_TEST_FIXTURE(SdrPdfImportTest, testImportSimpleText) SdPage* pPage = pViewShell->GetActualPage(); CPPUNIT_ASSERT(pPage); + // Check there is one object on the page only + CPPUNIT_ASSERT_EQUAL(size_t(1), pPage->GetObjCount()); + // Get the first object - there should be only one. SdrObject* pObject = pPage->GetObj(0); CPPUNIT_ASSERT(pObject); @@ -109,11 +112,17 @@ CPPUNIT_TEST_FIXTURE(SdrPdfImportTest, testImportSimpleText) // Execute the break operation - to turn the PDF into shapes/objects pViewShell->GetDrawView()->DoImportMarkedMtf(); - // Check Objects after import + // Check there is one object on the page only + CPPUNIT_ASSERT_EQUAL(size_t(1), pPage->GetObjCount()); + // Get the object SdrObject* pImportedObject = pPage->GetObj(0); CPPUNIT_ASSERT(pImportedObject); + // Check the object position + CPPUNIT_ASSERT_EQUAL(tools::Rectangle(Point(2011, 2098), Size(2106 + 1, 302 + 1)), + pImportedObject->GetLogicRect()); + // Object should be a text object containing one paragraph with // content "This is PDF!" |