summaryrefslogtreecommitdiff
path: root/sd
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 23:38:48 +0200
commitaf7b619f2752fcac3492c53444e836371efbd5fe (patch)
treedf5f559b45ce689a1a3740bc9b0d407a0b1b5205 /sd
parentf5124552d87e84b5b6d6707c30b5f8a5defed69e (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. Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97366 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> (cherry picked from commit 4e9b03d04f740a0cbafa22a4f3cedfae7f37a994) Change-Id: Ie1faf5e3743eec7c77050835651533f9e227c2a7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97451 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'sd')
-rw-r--r--sd/qa/unit/SdrPdfImportTest.cxx11
1 files changed, 10 insertions, 1 deletions
diff --git a/sd/qa/unit/SdrPdfImportTest.cxx b/sd/qa/unit/SdrPdfImportTest.cxx
index ca022d585c48..2ac548bb6c85 100644
--- a/sd/qa/unit/SdrPdfImportTest.cxx
+++ b/sd/qa/unit/SdrPdfImportTest.cxx
@@ -89,6 +89,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);
@@ -110,11 +113,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!"