Commit e01329eb authored by Heiko Becker's avatar Heiko Becker Committed by Albert Astals Cid

Fix build with poppler <0.58

Summary:
- Poppler::FormFieldSignature::signatureType
- Poppler::SignatureValidationInfo::hashAlgorithm
- Poppler::SignatureValidationInfo::signature
- Poppler::SignatureValidationInfo::signedRangeBounds
- Poppler::SignatureValidationInfo::signerSubjectDN
- Poppler::SignatureValidationInfo::signsTotalDocument

were all introduced with poppler 0.58.

Test Plan:
Builds fine with poppler 0.57 and 0.75, looked at
http://tecxoft.com/samples/pdf_digital_signature_timestamp.pdf

Reviewers: aacid

Reviewed By: aacid

Subscribers: aacid, okular-devel

Tags: #okular

Differential Revision: https://phabricator.kde.org/D20488
parent 81d417d2
......@@ -51,6 +51,15 @@ int main()
}
" HAVE_POPPLER_0_53)
check_cxx_source_compiles("
#include <poppler-qt5.h>
#include <poppler-form.h>
int main()
{
auto s = &Poppler::SignatureValidationInfo::signsTotalDocument;
}
" HAVE_POPPLER_0_58)
check_cxx_source_compiles("
#include <poppler-qt5.h>
int main()
......
......@@ -19,6 +19,9 @@
/* Defined if we have the 0.53 version of the Poppler library */
#cmakedefine HAVE_POPPLER_0_53 1
/* Defined if we have the 0.58 version of the Poppler library */
#cmakedefine HAVE_POPPLER_0_58 1
/* Defined if we have the 0.60 version of the Poppler library */
#cmakedefine HAVE_POPPLER_0_60 1
......
......@@ -429,6 +429,7 @@ bool PopplerFormFieldSignature::isVisible() const
PopplerFormFieldSignature::SignatureType PopplerFormFieldSignature::signatureType() const
{
#ifdef HAVE_POPPLER_0_58
switch ( m_field->signatureType() )
{
case Poppler::FormFieldSignature::AdbePkcs7sha1:
......@@ -440,6 +441,9 @@ PopplerFormFieldSignature::SignatureType PopplerFormFieldSignature::signatureTyp
default:
return Okular::FormFieldSignature::UnknownType;
}
#else
return Okular::FormFieldSignature::UnknownType;
#endif
}
const Okular::SignatureInfo &PopplerFormFieldSignature::signatureInfo() const
......
......@@ -193,6 +193,7 @@ PopplerSignatureInfo::CertificateStatus PopplerSignatureInfo::certificateStatus(
PopplerSignatureInfo::HashAlgorithm PopplerSignatureInfo::hashAlgorithm() const
{
#ifdef HAVE_POPPLER_0_58
switch ( m_info.hashAlgorithm() )
{
case Poppler::SignatureValidationInfo::HashAlgorithmMd2:
......@@ -212,6 +213,9 @@ PopplerSignatureInfo::HashAlgorithm PopplerSignatureInfo::hashAlgorithm() const
default:
return HashAlgorithmUnknown;
}
#else
return HashAlgorithmUnknown;
#endif
}
QString PopplerSignatureInfo::signerName() const
......@@ -221,7 +225,11 @@ QString PopplerSignatureInfo::signerName() const
QString PopplerSignatureInfo::signerSubjectDN() const
{
#ifdef HAVE_POPPLER_0_58
return m_info.signerSubjectDN();
#else
return {};
#endif
}
QString PopplerSignatureInfo::location() const
......@@ -249,17 +257,29 @@ QDateTime PopplerSignatureInfo::signingTime() const
QByteArray PopplerSignatureInfo::signature() const
{
#ifdef HAVE_POPPLER_0_58
return m_info.signature();
#else
return {};
#endif
}
QList<qint64> PopplerSignatureInfo::signedRangeBounds() const
{
#ifdef HAVE_POPPLER_0_58
return m_info.signedRangeBounds();
#else
return {};
#endif
}
bool PopplerSignatureInfo::signsTotalDocument() const
{
#ifdef HAVE_POPPLER_0_58
return m_info.signsTotalDocument();
#else
return false;
#endif
}
const Okular::CertificateInfo &PopplerSignatureInfo::certificateInfo() const
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment