summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2020-12-28 10:03:18 +0900
committerTomaž Vajngerl <quikee@gmail.com>2021-01-13 07:22:31 +0100
commitdcfac443c608aec2ce4e5fa30a3dd021b5a8bfd3 (patch)
treef1bd5d83427625eadb91d9e3685616efe43e7ada /sd
parent68b1ae7b493eea4d77f36a0c8566ca0224f04798 (diff)
vcl: use BinaryDataContianer in VectorGraphicData
This change is needed so we can use the same data in GfxLink and in VectorGraphicData. Currently the data needed to be duplicated, which is less than ideal. Change-Id: I79419921d09681fa8f0b1ac4bf8ea84199d4aae6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108440 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'sd')
-rw-r--r--sd/qa/unit/SdrPdfImportTest.cxx11
-rw-r--r--sd/qa/unit/import-tests.cxx4
2 files changed, 8 insertions, 7 deletions
diff --git a/sd/qa/unit/SdrPdfImportTest.cxx b/sd/qa/unit/SdrPdfImportTest.cxx
index afbb02594e21..ea5f2aee477f 100644
--- a/sd/qa/unit/SdrPdfImportTest.cxx
+++ b/sd/qa/unit/SdrPdfImportTest.cxx
@@ -175,8 +175,7 @@ CPPUNIT_TEST_FIXTURE(SdrPdfImportTest, testAnnotationsImportExport)
sd::ViewShell* pViewShell = pImpressDocument->GetDocShell()->GetViewShell();
CPPUNIT_ASSERT(pViewShell);
- const void* pData = nullptr;
- int nLength = 0;
+ BinaryDataContainer aContainer;
{
// Get the first page - there should be only one.
@@ -202,13 +201,15 @@ CPPUNIT_TEST_FIXTURE(SdrPdfImportTest, testAnnotationsImportExport)
pVectorGraphicData->getVectorGraphicDataType());
// Write the PDF
- pData = pVectorGraphicData->getVectorGraphicDataArray().getConstArray();
- nLength = pVectorGraphicData->getVectorGraphicDataArrayLength();
+ aContainer = pVectorGraphicData->getBinaryDataContainer();
}
{ // check graphic PDF has annotations
- auto pPDFDocument = pPdfiumLibrary->openDocument(pData, nLength);
+ CPPUNIT_ASSERT_EQUAL(false, aContainer.isEmpty());
+
+ auto pPDFDocument
+ = pPdfiumLibrary->openDocument(aContainer.getData(), aContainer.getSize());
auto pPDFPage = pPDFDocument->openPage(0);
CPPUNIT_ASSERT_EQUAL(2, pPDFPage->getAnnotationCount());
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index eefda64a9cd9..b5c1c5ca03c3 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -1380,8 +1380,8 @@ void SdImportTest::testPDFImportShared()
{
Graphic const & rGraphic = aGraphics[i];
CPPUNIT_ASSERT_EQUAL_MESSAGE("Expected all PDF streams to be identical.",
- rFirstGraphic.getVectorGraphicData()->getVectorGraphicDataArray().getConstArray(),
- rGraphic.getVectorGraphicData()->getVectorGraphicDataArray().getConstArray());
+ rFirstGraphic.getVectorGraphicData()->getBinaryDataContainer().getData(),
+ rGraphic.getVectorGraphicData()->getBinaryDataContainer().getData());
CPPUNIT_ASSERT_EQUAL_MESSAGE("Expected all GfxLinks to be identical.",
rFirstGraphic.GetSharedGfxLink().get(),