summaryrefslogtreecommitdiff
path: root/sd/qa
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2020-03-13 20:04:45 +0100
committerTomaž Vajngerl <quikee@gmail.com>2020-03-18 09:23:15 +0100
commit27ee05f860e8225a41e15e0853fcef00a9d7a621 (patch)
tree277ae811da1551accde88468607d513d411be05e /sd/qa
parent9054c36d4ea3bee25fb9a47a96a0ea2cd07148c3 (diff)
pdfium: support for pages when using PDF import with pdfium
Moving PDF to use VectorGraphicData in Graphic has temporary removed the support for showing different PDF pages when opening the PDF using pdfium (LO_IMPORT_USE_PDFIUM=1). This adds the support for back by specifying whcih PDF page to render when creating the VectorGraphicData (and can't be changd afterwards), which is used to create a Graphic and contains the PDF source data array. Change-Id: Ib915216b8d4c0c063d0fead44ff156b1915a35d2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90562 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'sd/qa')
-rw-r--r--sd/qa/unit/import-tests.cxx15
1 files changed, 9 insertions, 6 deletions
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index addf393630a1..954ef5b187ba 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -1327,17 +1327,20 @@ void SdImportTest::testPDFImportShared()
CPPUNIT_ASSERT_EQUAL_MESSAGE("Expected more than one page.", size_t(3), aGraphics.size());
- Graphic aFirstGraphic = aGraphics[0];
+ Graphic const & rFirstGraphic = aGraphics[0];
- for (size_t i = 1; i < aGraphics.size(); ++i)
+ for (size_t i = 0; i < aGraphics.size(); ++i)
{
+ Graphic const & rGraphic = aGraphics[i];
CPPUNIT_ASSERT_EQUAL_MESSAGE("Expected all PDF streams to be identical.",
- aFirstGraphic.getVectorGraphicData()->getVectorGraphicDataArray().getConstArray(),
- aGraphics[i].getVectorGraphicData()->getVectorGraphicDataArray().getConstArray());
+ rFirstGraphic.getVectorGraphicData()->getVectorGraphicDataArray().getConstArray(),
+ rGraphic.getVectorGraphicData()->getVectorGraphicDataArray().getConstArray());
CPPUNIT_ASSERT_EQUAL_MESSAGE("Expected all GfxLinks to be identical.",
- aFirstGraphic.GetSharedGfxLink().get(),
- aGraphics[i].GetSharedGfxLink().get());
+ rFirstGraphic.GetSharedGfxLink().get(),
+ rGraphic.GetSharedGfxLink().get());
+
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Page number doesn't match expected", sal_Int32(i), rGraphic.getPageNumber());
}
xDocShRef->DoClose();