include/vcl/filter/pdfdocument.hxx     |    7 ---
 vcl/source/filter/ipdf/pdfdocument.cxx |   67 ---------------------------------
 2 files changed, 74 deletions(-)

New commits:
commit d9391396434a5ad93f6796248c255b5bb2f3cba7
Author:     Miklos Vajna <vmik...@collabora.com>
AuthorDate: Tue Nov 17 21:06:33 2020 +0100
Commit:     Miklos Vajna <vmik...@collabora.com>
CommitDate: Wed Nov 18 08:02:21 2020 +0100

    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 <vmik...@collabora.com>

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());
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to