summaryrefslogtreecommitdiff
path: root/vcl/qa
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2020-09-30 21:02:44 +0200
committerMiklos Vajna <vmiklos@collabora.com>2020-10-01 09:09:11 +0200
commit4722a7b376946a0540f7dd95cdbacf8a0507860d (patch)
tree94694c3e47bd60cc53528d9f51297e236fc85dff /vcl/qa
parente8aa9daffe628b401058b1e37d2a8839e9f7dd5d (diff)
CppunitTest_vcl_filter_ipdf: use vcl::pdf::PDFiumDocument
Instead of the upstream scopers, to standardize on a single set of pdfium wrappers. Change-Id: I50c0301629f8b09286d43063ad11b4d70a50c4c2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103732 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'vcl/qa')
-rw-r--r--vcl/qa/cppunit/filter/ipdf/ipdf.cxx16
1 files changed, 6 insertions, 10 deletions
diff --git a/vcl/qa/cppunit/filter/ipdf/ipdf.cxx b/vcl/qa/cppunit/filter/ipdf/ipdf.cxx
index 5d44cf9bbef2..96fd331ceb76 100644
--- a/vcl/qa/cppunit/filter/ipdf/ipdf.cxx
+++ b/vcl/qa/cppunit/filter/ipdf/ipdf.cxx
@@ -10,10 +10,6 @@
#include <test/bootstrapfixture.hxx>
#include <unotest/macros_test.hxx>
-#include <prewin.h>
-#include <cpp/fpdf_scopers.h>
-#include <postwin.h>
-
#include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
#include <com/sun/star/drawing/XDrawView.hpp>
#include <com/sun/star/frame/Desktop.hpp>
@@ -132,16 +128,16 @@ CPPUNIT_TEST_FIXTURE(VclFilterIpdfTest, testPDFAddVisibleSignatureLastPage)
SvMemoryStream aMemory;
aMemory.WriteStream(aFile);
// Last page.
- ScopedFPDFDocument pPdfDocument(
- FPDF_LoadMemDocument(aMemory.GetData(), aMemory.GetSize(), /*password=*/nullptr));
- ScopedFPDFPage pPdfPage(FPDF_LoadPage(pPdfDocument.get(), /*page_index=*/1));
+ std::unique_ptr<vcl::pdf::PDFiumDocument> pPdfDocument
+ = pPDFium->openDocument(aMemory.GetData(), aMemory.GetSize());
+ std::unique_ptr<vcl::pdf::PDFiumPage> pPdfPage = pPdfDocument->openPage(/*nIndex=*/1);
// Without the accompanying fix in place, this test would have failed with:
// - Expected: 1
// - Actual : 0
// i.e. the signature was there, but it was on the first page.
- CPPUNIT_ASSERT_EQUAL(1, FPDFPage_GetAnnotCount(pPdfPage.get()));
- ScopedFPDFAnnotation pAnnot(FPDFPage_GetAnnot(pPdfPage.get(), 0));
- CPPUNIT_ASSERT_EQUAL(4, FPDFAnnot_GetObjectCount(pAnnot.get()));
+ CPPUNIT_ASSERT_EQUAL(1, pPdfPage->getAnnotationCount());
+ std::unique_ptr<vcl::pdf::PDFiumAnnotation> pAnnot = pPdfPage->getAnnotation(0);
+ CPPUNIT_ASSERT_EQUAL(4, pAnnot->getObjectCount());
}
CPPUNIT_PLUGIN_IMPLEMENT();