summaryrefslogtreecommitdiff
path: root/vcl/source
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2021-02-16 21:07:53 +0100
committerMiklos Vajna <vmiklos@collabora.com>2021-02-17 09:10:05 +0100
commitdba40f311bc512c05ea59fbdfeb794ef44af72a6 (patch)
tree68544d7b1714b359782bc493752227324f343d90 /vcl/source
parent2f9a61e3c92932569f8bffbd254a4a71f3354440 (diff)
pdfium: eliminate FPDF_SIGNATURE from public header
Change-Id: I9c8297c69ca359d861c8506e41c069692331eb8f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111005 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'vcl/source')
-rw-r--r--vcl/source/pdf/PDFiumLibrary.cxx34
1 files changed, 26 insertions, 8 deletions
diff --git a/vcl/source/pdf/PDFiumLibrary.cxx b/vcl/source/pdf/PDFiumLibrary.cxx
index 29d5bb8f3ba6..d183cd6f22c3 100644
--- a/vcl/source/pdf/PDFiumLibrary.cxx
+++ b/vcl/source/pdf/PDFiumLibrary.cxx
@@ -306,6 +306,24 @@ public:
/// Returned rect is no longer upside down and is in mm100.
basegfx::B2DRectangle getCharBox(int nIndex, double fPageHeight) override;
};
+
+class PDFiumSignatureImpl final : public PDFiumSignature
+{
+private:
+ FPDF_SIGNATURE mpSignature;
+ PDFiumSignatureImpl(const PDFiumSignatureImpl&) = delete;
+ PDFiumSignatureImpl& operator=(const PDFiumSignatureImpl&) = delete;
+
+public:
+ PDFiumSignatureImpl(FPDF_SIGNATURE pSignature);
+
+ std::vector<int> getByteRange() override;
+ int getDocMDPPermission() override;
+ std::vector<unsigned char> getContents() override;
+ OString getSubFilter() override;
+ OUString getReason() override;
+ css::util::DateTime getTime() override;
+};
}
OUString convertPdfDateToISO8601(OUString const& rInput)
@@ -438,12 +456,12 @@ std::unique_ptr<PDFiumBitmap> PDFium::createBitmap(int nWidth, int nHeight, int
return pPDFiumBitmap;
}
-PDFiumSignature::PDFiumSignature(FPDF_SIGNATURE pSignature)
+PDFiumSignatureImpl::PDFiumSignatureImpl(FPDF_SIGNATURE pSignature)
: mpSignature(pSignature)
{
}
-std::vector<int> PDFiumSignature::getByteRange()
+std::vector<int> PDFiumSignatureImpl::getByteRange()
{
int nByteRangeLen = FPDFSignatureObj_GetByteRange(mpSignature, nullptr, 0);
std::vector<int> aByteRange(nByteRangeLen);
@@ -456,12 +474,12 @@ std::vector<int> PDFiumSignature::getByteRange()
return aByteRange;
}
-int PDFiumSignature::getDocMDPPermission()
+int PDFiumSignatureImpl::getDocMDPPermission()
{
return FPDFSignatureObj_GetDocMDPPermission(mpSignature);
}
-std::vector<unsigned char> PDFiumSignature::getContents()
+std::vector<unsigned char> PDFiumSignatureImpl::getContents()
{
int nContentsLen = FPDFSignatureObj_GetContents(mpSignature, nullptr, 0);
std::vector<unsigned char> aContents(nContentsLen);
@@ -474,7 +492,7 @@ std::vector<unsigned char> PDFiumSignature::getContents()
return aContents;
}
-OString PDFiumSignature::getSubFilter()
+OString PDFiumSignatureImpl::getSubFilter()
{
int nSubFilterLen = FPDFSignatureObj_GetSubFilter(mpSignature, nullptr, 0);
std::vector<char> aSubFilterBuf(nSubFilterLen);
@@ -484,7 +502,7 @@ OString PDFiumSignature::getSubFilter()
return aSubFilter;
}
-OUString PDFiumSignature::getReason()
+OUString PDFiumSignatureImpl::getReason()
{
int nReasonLen = FPDFSignatureObj_GetReason(mpSignature, nullptr, 0);
OUString aRet;
@@ -498,7 +516,7 @@ OUString PDFiumSignature::getReason()
return aRet;
}
-util::DateTime PDFiumSignature::getTime()
+util::DateTime PDFiumSignatureImpl::getTime()
{
util::DateTime aRet;
int nTimeLen = FPDFSignatureObj_GetTime(mpSignature, nullptr, 0);
@@ -551,7 +569,7 @@ std::unique_ptr<PDFiumSignature> PDFiumDocument::getSignature(int nIndex)
FPDF_SIGNATURE pSignature = FPDF_GetSignatureObject(mpPdfDocument, nIndex);
if (pSignature)
{
- pPDFiumSignature = std::make_unique<PDFiumSignature>(pSignature);
+ pPDFiumSignature = std::make_unique<PDFiumSignatureImpl>(pSignature);
}
return pPDFiumSignature;
}