You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
110 lines
3.9 KiB
110 lines
3.9 KiB
2 years ago
|
From 65654c3bdeeb6a5c5f016e1690197e62fb12e9a8 Mon Sep 17 00:00:00 2001
|
||
|
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
|
||
|
Date: Fri, 20 Jan 2023 12:37:11 +0000
|
||
|
Subject: [PATCH] don't crash with --disable-pdfium
|
||
|
|
||
|
Change-Id: I946e62d70b937d27b2f1258acc643fdaa5bee23d
|
||
|
---
|
||
|
sw/qa/core/text/text.cxx | 28 +++++++++++++++++++++++++++
|
||
|
sw/qa/extras/mailmerge/mailmerge2.cxx | 3 ++-
|
||
|
2 files changed, 30 insertions(+), 1 deletion(-)
|
||
|
|
||
|
diff --git a/sw/qa/core/text/text.cxx b/sw/qa/core/text/text.cxx
|
||
|
index db1895b795c0..c4821f5d6eae 100644
|
||
|
--- a/sw/qa/core/text/text.cxx
|
||
|
+++ b/sw/qa/core/text/text.cxx
|
||
|
@@ -634,6 +634,10 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testTdf43100_CursorMoveToSpacesOverMargin)
|
||
|
|
||
|
CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testContentControlPDF)
|
||
|
{
|
||
|
+ std::shared_ptr<vcl::pdf::PDFium> pPDFium = vcl::pdf::PDFiumLibrary::get();
|
||
|
+ if (!pPDFium)
|
||
|
+ return;
|
||
|
+
|
||
|
// Given a file with a content control:
|
||
|
createSwDoc();
|
||
|
SwDoc* pDoc = getSwDoc();
|
||
|
@@ -677,6 +681,10 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testContentControlPDF)
|
||
|
|
||
|
CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testCheckboxContentControlPDF)
|
||
|
{
|
||
|
+ std::shared_ptr<vcl::pdf::PDFium> pPDFium = vcl::pdf::PDFiumLibrary::get();
|
||
|
+ if (!pPDFium)
|
||
|
+ return;
|
||
|
+
|
||
|
// Given a file with a checkbox content control:
|
||
|
createSwDoc();
|
||
|
SwDoc* pDoc = getSwDoc();
|
||
|
@@ -703,6 +711,10 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testCheckboxContentControlPDF)
|
||
|
|
||
|
CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testDropdownContentControlPDF)
|
||
|
{
|
||
|
+ std::shared_ptr<vcl::pdf::PDFium> pPDFium = vcl::pdf::PDFiumLibrary::get();
|
||
|
+ if (!pPDFium)
|
||
|
+ return;
|
||
|
+
|
||
|
// Given a file with a dropdown content control:
|
||
|
createSwDoc();
|
||
|
SwDoc* pDoc = getSwDoc();
|
||
|
@@ -729,6 +741,10 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testDropdownContentControlPDF)
|
||
|
|
||
|
CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testDateContentControlPDF)
|
||
|
{
|
||
|
+ std::shared_ptr<vcl::pdf::PDFium> pPDFium = vcl::pdf::PDFiumLibrary::get();
|
||
|
+ if (!pPDFium)
|
||
|
+ return;
|
||
|
+
|
||
|
// Given a file with a date content control:
|
||
|
createSwDoc();
|
||
|
SwDoc* pDoc = getSwDoc();
|
||
|
@@ -758,6 +774,10 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testDateContentControlPDF)
|
||
|
|
||
|
CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testContentControlPDFFont)
|
||
|
{
|
||
|
+ std::shared_ptr<vcl::pdf::PDFium> pPDFium = vcl::pdf::PDFiumLibrary::get();
|
||
|
+ if (!pPDFium)
|
||
|
+ return;
|
||
|
+
|
||
|
// Given a document with a custom 24pt font size and a content control:
|
||
|
createSwDoc();
|
||
|
SwDoc* pDoc = getSwDoc();
|
||
|
@@ -786,6 +806,10 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testContentControlPDFFont)
|
||
|
|
||
|
CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testComboContentControlPDF)
|
||
|
{
|
||
|
+ std::shared_ptr<vcl::pdf::PDFium> pPDFium = vcl::pdf::PDFiumLibrary::get();
|
||
|
+ if (!pPDFium)
|
||
|
+ return;
|
||
|
+
|
||
|
// Given a file with a combo box content control:
|
||
|
createSwDoc();
|
||
|
SwDoc* pDoc = getSwDoc();
|
||
|
@@ -813,6 +837,10 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testComboContentControlPDF)
|
||
|
|
||
|
CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testRichContentControlPDF)
|
||
|
{
|
||
|
+ std::shared_ptr<vcl::pdf::PDFium> pPDFium = vcl::pdf::PDFiumLibrary::get();
|
||
|
+ if (!pPDFium)
|
||
|
+ return;
|
||
|
+
|
||
|
// Given a file with a rich content control, its value set to "xxx<b>yyy</b>":
|
||
|
createSwDoc();
|
||
|
SwDoc* pDoc = getSwDoc();
|
||
|
diff --git a/sw/qa/extras/mailmerge/mailmerge2.cxx b/sw/qa/extras/mailmerge/mailmerge2.cxx
|
||
|
index 20eb6b0f3896..cd8871e780d3 100644
|
||
|
--- a/sw/qa/extras/mailmerge/mailmerge2.cxx
|
||
|
+++ b/sw/qa/extras/mailmerge/mailmerge2.cxx
|
||
|
@@ -513,7 +513,8 @@ DECLARE_SHELL_MAILMERGE_TEST(exportDirectToPDF_shell, "linked-with-condition.odt
|
||
|
SvMemoryStream aMemory;
|
||
|
aMemory.WriteStream(aPDFFile);
|
||
|
std::shared_ptr<vcl::pdf::PDFium> pPDFium = vcl::pdf::PDFiumLibrary::get();
|
||
|
- CPPUNIT_ASSERT(pPDFium);
|
||
|
+ if (!pPDFium)
|
||
|
+ return;
|
||
|
|
||
|
std::unique_ptr<vcl::pdf::PDFiumDocument> pPdfDocument
|
||
|
= pPDFium->openDocument(aMemory.GetData(), aMemory.GetSize(), OString());
|
||
|
--
|
||
|
2.39.0
|
||
|
|