summaryrefslogtreecommitdiff
path: root/svx/qa/unit
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2022-11-09 14:22:09 +0100
committerXisco Fauli <xiscofauli@libreoffice.org>2022-11-09 19:08:32 +0100
commit87dce617eb1cbbb650dda3e5dc557fa0a058e505 (patch)
treeee252c285326858fab6cd076b2ddcc10b5e94616 /svx/qa/unit
parent7f8b79c21c3af20e443d487af0d40a36e611bda0 (diff)
UnoApiTest: factor out common code
Change-Id: I1d84d8c1e371016a4f4f068af1e9c76635f28cf4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142490 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'svx/qa/unit')
-rw-r--r--svx/qa/unit/core.cxx9
-rw-r--r--svx/qa/unit/svdraw.cxx11
2 files changed, 2 insertions, 18 deletions
diff --git a/svx/qa/unit/core.cxx b/svx/qa/unit/core.cxx
index e627215807d2..f834222ea009 100644
--- a/svx/qa/unit/core.cxx
+++ b/svx/qa/unit/core.cxx
@@ -47,16 +47,9 @@ CPPUNIT_TEST_FIXTURE(Test, testChartExportToPdf)
maTempFile.GetURL());
// Then make sure we get a valid, non-empty PDF:
- auto pPdfium = vcl::pdf::PDFiumLibrary::get();
- if (!pPdfium)
- return;
- SvMemoryStream aMemory;
- aMemory.WriteStream(*maTempFile.GetStream(StreamMode::READ));
- std::unique_ptr<vcl::pdf::PDFiumDocument> pPdfDocument
- = pPdfium->openDocument(aMemory.GetData(), aMemory.GetSize(), OString());
// Without the accompanying fix in place, this test would have failed, because the output was
// empty (0 bytes).
- CPPUNIT_ASSERT(pPdfDocument);
+ std::unique_ptr<vcl::pdf::PDFiumDocument> pPdfDocument = parsePDFExport();
int nPageCount = pPdfDocument->getPageCount();
CPPUNIT_ASSERT_GREATER(0, nPageCount);
}
diff --git a/svx/qa/unit/svdraw.cxx b/svx/qa/unit/svdraw.cxx
index 4373d2b5d608..c1c8bc435a9a 100644
--- a/svx/qa/unit/svdraw.cxx
+++ b/svx/qa/unit/svdraw.cxx
@@ -497,16 +497,7 @@ CPPUNIT_TEST_FIXTURE(SvdrawTest, testPageViewDrawLayerClip)
save("writer_pdf_Export");
// Then make sure that line shape gets clipped:
- SvFileStream aFile(maTempFile.GetURL(), StreamMode::READ);
- SvMemoryStream aMemory;
- aMemory.WriteStream(aFile);
- std::shared_ptr<vcl::pdf::PDFium> pPDFium = vcl::pdf::PDFiumLibrary::get();
- if (!pPDFium)
- {
- return;
- }
- std::unique_ptr<vcl::pdf::PDFiumDocument> pDoc
- = pPDFium->openDocument(aMemory.GetData(), aMemory.GetSize(), OString());
+ std::unique_ptr<vcl::pdf::PDFiumDocument> pDoc = parsePDFExport();
std::unique_ptr<vcl::pdf::PDFiumPage> pPage1 = pDoc->openPage(0);
CPPUNIT_ASSERT_EQUAL(3, pPage1->getObjectCount());
std::unique_ptr<vcl::pdf::PDFiumPage> pPage2 = pDoc->openPage(1);