diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2020-11-17 21:06:33 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2020-11-18 08:02:21 +0100 |
commit | d9391396434a5ad93f6796248c255b5bb2f3cba7 (patch) | |
tree | 1b9fc10e2f9c61f4fc05483040c701641de97410 | |
parent | c70b00820ec46035e50c7922876c5423c2f5f936 (diff) |
vcl: clean up unused PDFDocument functions
These are unused since the pdfium-based signature verification.
Change-Id: Ie15369cbd0548febd03be3ac3475036e1f46cd16
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106027
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
-rw-r--r-- | include/vcl/filter/pdfdocument.hxx | 7 | ||||
-rw-r--r-- | vcl/source/filter/ipdf/pdfdocument.cxx | 67 |
2 files changed, 0 insertions, 74 deletions
diff --git a/include/vcl/filter/pdfdocument.hxx b/include/vcl/filter/pdfdocument.hxx index 4177e615516e..b938234b9370 100644 --- a/include/vcl/filter/pdfdocument.hxx +++ b/include/vcl/filter/pdfdocument.hxx @@ -490,15 +490,8 @@ public: bool Write(SvStream& rStream); /// Get a list of signatures embedded into this document. std::vector<PDFObjectElement*> GetSignatureWidgets(); - /** - * Get the value of the "modification detection and prevention" permission: - * Valid values are 1, 2 and 3: only 3 allows annotations after signing. - */ - int GetMDPPerm(); /// Remove the nth signature from read document in the edit buffer. bool RemoveSignature(size_t nPosition); - /// Get byte offsets of the end of incremental updates. - const std::vector<size_t>& GetEOFs() const; //@} /// See vcl::PDFObjectContainer::createObject(). diff --git a/vcl/source/filter/ipdf/pdfdocument.cxx b/vcl/source/filter/ipdf/pdfdocument.cxx index 911cb2381ed5..41c44bd01b57 100644 --- a/vcl/source/filter/ipdf/pdfdocument.cxx +++ b/vcl/source/filter/ipdf/pdfdocument.cxx @@ -180,8 +180,6 @@ bool PDFDocument::RemoveSignature(size_t nPosition) return m_aEditBuffer.good(); } -const std::vector<size_t>& PDFDocument::GetEOFs() const { return m_aEOFs; } - sal_Int32 PDFDocument::createObject() { sal_Int32 nObject = m_aXRef.size(); @@ -2163,71 +2161,6 @@ std::vector<PDFObjectElement*> PDFDocument::GetSignatureWidgets() return aRet; } -int PDFDocument::GetMDPPerm() -{ - int nRet = 3; - - std::vector<PDFObjectElement*> aSignatures = GetSignatureWidgets(); - if (aSignatures.empty()) - { - return nRet; - } - - for (const auto& pSignature : aSignatures) - { - vcl::filter::PDFObjectElement* pSig = pSignature->LookupObject("V"); - if (!pSig) - { - SAL_WARN("vcl.filter", "PDFDocument::GetMDPPerm: can't find signature object"); - continue; - } - - auto pReference = dynamic_cast<PDFArrayElement*>(pSig->Lookup("Reference")); - if (!pReference || pReference->GetElements().empty()) - { - continue; - } - - auto pFirstReference = dynamic_cast<PDFDictionaryElement*>(pReference->GetElements()[0]); - if (!pFirstReference) - { - SAL_WARN("vcl.filter", - "PDFDocument::GetMDPPerm: reference array doesn't contain a dictionary"); - continue; - } - - PDFElement* pTransformParams = pFirstReference->LookupElement("TransformParams"); - auto pTransformParamsDict = dynamic_cast<PDFDictionaryElement*>(pTransformParams); - if (!pTransformParamsDict) - { - auto pTransformParamsRef = dynamic_cast<PDFReferenceElement*>(pTransformParams); - if (pTransformParamsRef) - { - PDFObjectElement* pTransformParamsObj = pTransformParamsRef->LookupObject(); - if (pTransformParamsObj) - { - pTransformParamsDict = pTransformParamsObj->GetDictionary(); - } - } - } - - if (!pTransformParamsDict) - { - continue; - } - - auto pP = dynamic_cast<PDFNumberElement*>(pTransformParamsDict->LookupElement("P")); - if (!pP) - { - return 2; - } - - return pP->GetValue(); - } - - return nRet; -} - std::vector<unsigned char> PDFDocument::DecodeHexString(PDFHexStringElement const* pElement) { return svl::crypto::DecodeHexString(pElement->GetValue()); |