aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-10-29 15:45:01 +0000
committerMichael Stahl <michael.stahl@cib.de>2020-12-03 12:57:51 +0100
commit3e82fcb8387e3d9a1f5cf658a5e969eb2db0dbd5 (patch)
treea27259510b6e1aee9b3021f7149f566f93a810ad
parent060651068797bf15aed91b9f8dc3378bf759665a (diff)
fix --disable-pdfium build
Change-Id: I580972220bc39abe16288fa62c717e4ab25833d9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105015 Tested-by: Jenkins Tested-by: René Engelhard <rene@debian.org> Reviewed-by: René Engelhard <rene@debian.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> (cherry picked from commit b9e5d5347e5dece693fe56b88570abc07a30a8ba) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107064 Tested-by: Michael Stahl <michael.stahl@cib.de> Reviewed-by: Michael Stahl <michael.stahl@cib.de>
-rw-r--r--vcl/source/filter/ipdf/pdfread.cxx2
-rw-r--r--xmlsecurity/source/pdfio/pdfdocument.cxx11
2 files changed, 8 insertions, 5 deletions
diff --git a/vcl/source/filter/ipdf/pdfread.cxx b/vcl/source/filter/ipdf/pdfread.cxx
index 5401bf3734a3..538a6055f168 100644
--- a/vcl/source/filter/ipdf/pdfread.cxx
+++ b/vcl/source/filter/ipdf/pdfread.cxx
@@ -206,7 +206,7 @@ size_t RenderPDFBitmaps(const void* pBuffer, int nSize, std::vector<Bitmap>& rBi
(void)rBitmaps;
(void)nFirstPage;
(void)nPages;
- (void)fResolutionDPI;
+ (void)pSizeHint;
return 0;
#endif // HAVE_FEATURE_PDFIUM
}
diff --git a/xmlsecurity/source/pdfio/pdfdocument.cxx b/xmlsecurity/source/pdfio/pdfdocument.cxx
index 9d056de0a15c..5580fed9d178 100644
--- a/xmlsecurity/source/pdfio/pdfdocument.cxx
+++ b/xmlsecurity/source/pdfio/pdfdocument.cxx
@@ -138,11 +138,11 @@ bool IsCompleteSignature(SvStream& rStream, vcl::filter::PDFDocument& rDocument,
return std::find(rAllEOFs.begin(), rAllEOFs.end(), nFileEnd) != rAllEOFs.end();
}
+#if HAVE_FEATURE_PDFIUM
/// Collects the checksum of each page of one version of the PDF.
void AnalyizeSignatureStream(SvMemoryStream& rStream, std::vector<BitmapChecksum>& rPageChecksums,
int nMDPPerm)
{
-#if HAVE_FEATURE_PDFIUM
auto pPdfium = vcl::pdf::PDFiumLibrary::get();
vcl::pdf::PDFiumDocument aPdfDocument(
FPDF_LoadMemDocument(rStream.GetData(), rStream.GetSize(), /*password=*/nullptr));
@@ -159,10 +159,8 @@ void AnalyizeSignatureStream(SvMemoryStream& rStream, std::vector<BitmapChecksum
BitmapChecksum nPageChecksum = pPdfPage->getChecksum(nMDPPerm);
rPageChecksums.push_back(nPageChecksum);
}
-#else
- (void)rStream;
-#endif
}
+#endif
/**
* Checks if incremental updates after singing performed valid modifications only.
@@ -176,6 +174,7 @@ bool IsValidSignature(SvStream& rStream, vcl::filter::PDFObjectElement* pSignatu
return false;
}
+#if HAVE_FEATURE_PDFIUM
SvMemoryStream aSignatureStream;
sal_uInt64 nPos = rStream.Tell();
rStream.Seek(0);
@@ -197,6 +196,10 @@ bool IsValidSignature(SvStream& rStream, vcl::filter::PDFObjectElement* pSignatu
// Fail if any page looks different after signing and at the end. Annotations/commenting doesn't
// count, though.
return aSignedPages == aAllPages;
+#else
+ (void)rStream;
+ return true;
+#endif
}
}