[Libreoffice-commits] core.git: Branch 'libreoffice-4-4' - 2 commits - filter/source vcl/source

Tor Lillqvist tml at collabora.com
Thu Dec 4 06:58:07 PST 2014


 filter/source/pdf/impdialog.cxx   |   11 ---------
 vcl/source/gdi/pdfwriter_impl.cxx |   42 +++++++++++++++++++-------------------
 2 files changed, 22 insertions(+), 31 deletions(-)

New commits:
commit 0268f7a50cc1f408ed3cbce11c025181036c69fe
Author: Tor Lillqvist <tml at collabora.com>
Date:   Thu Dec 4 13:25:33 2014 +0200

    We want PDF signing to be non-experimental now
    
    Change-Id: Ic02d1f5169197edd8f9793befd45adf5db145a3b

diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx
index b024d17..f835d7a 100644
--- a/filter/source/pdf/impdialog.cxx
+++ b/filter/source/pdf/impdialog.cxx
@@ -252,11 +252,6 @@ ImpPDFTabDialog::ImpPDFTabDialog(vcl::Window* pParent, Sequence< PropertyValue >
     mnInterfacePageId = AddTabPage("userinterface", ImpPDFTabViewerPage::Create, 0);
     mnViewPageId = AddTabPage("initialview", ImpPDFTabOpnFtrPage::Create, 0);
 
-//remove tabpage if experimentalmode is not set
-    SvtMiscOptions aMiscOptions;
-    if (!aMiscOptions.IsExperimentalMode())
-        RemoveTabPage(mnSigningPageId);
-
     //last queued is the first to be displayed (or so it seems..)
     mnGeneralPageId = AddTabPage("general", ImpPDFTabGeneralPage::Create, 0 );
 
@@ -323,11 +318,7 @@ ImpPDFTabDialog::~ImpPDFTabDialog()
     RemoveTabPage(mnViewPageId);
     RemoveTabPage(mnLinksPage);
     RemoveTabPage(mnSecurityPageId);
-
-//remove tabpage if experimentalmode is set
-    SvtMiscOptions aMiscOptions;
-    if (aMiscOptions.IsExperimentalMode())
-        RemoveTabPage(mnSigningPageId);
+    RemoveTabPage(mnSigningPageId);
 }
 
 
commit 3a21f81d707198eb948a3a4059cb4637b66444f4
Author: Tor Lillqvist <tml at collabora.com>
Date:   Thu Dec 4 12:39:38 2014 +0200

    Use the "vcl.pdfwriter" logging tag instead of "vcl.gdi"
    
    Change-Id: Idf000a8faee444e65c5f2fa20edde3eb70ddb371

diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index 1572b90..ffd9661 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -6009,11 +6009,11 @@ bool PDFWriterImpl::finalizeSignature()
 
     if (!cert)
     {
-        SAL_WARN("vcl.gdi", "PDF Signing: Error occurred, certificate cannot be reconstructed.");
+        SAL_WARN("vcl.pdfwriter", "PDF Signing: Error occurred, certificate cannot be reconstructed.");
         return false;
     }
 
-    SAL_WARN("vcl.gdi", "PDF Signing: Certificate Subject: " <<  cert->subjectName << "\n\tCertificate Issuer: " << cert->issuerName);
+    SAL_WARN("vcl.pdfwriter", "PDF Signing: Certificate Subject: " <<  cert->subjectName << "\n\tCertificate Issuer: " << cert->issuerName);
 
     // Prepare buffer and calculate PDF file digest
     CHECK_RETURN( (osl::File::E_None == m_aFile.setPos(osl_Pos_Absolut, 0)) );
@@ -6021,7 +6021,7 @@ bool PDFWriterImpl::finalizeSignature()
     HashContextScope hc(HASH_Create(HASH_AlgSHA1));
     if (!hc.get())
     {
-        SAL_WARN("vcl.gdi", "PDF Signing: SHA1 HASH_Create failed!");
+        SAL_WARN("vcl.pdfwriter", "PDF Signing: SHA1 HASH_Create failed!");
         return false;
     }
 
@@ -6033,7 +6033,7 @@ bool PDFWriterImpl::finalizeSignature()
     //FIXME: Check if SHA1 is calculated from the correct byterange
     CHECK_RETURN( (osl::File::E_None == m_aFile.read(buffer.get(), m_nSignatureContentOffset - 1 , bytesRead)) );
     if (bytesRead != (sal_uInt64)m_nSignatureContentOffset - 1)
-        SAL_WARN("vcl.gdi", "PDF Signing: First buffer read failed!");
+        SAL_WARN("vcl.pdfwriter", "PDF Signing: First buffer read failed!");
 
     HASH_Update(hc.get(), reinterpret_cast<const unsigned char*>(buffer.get()), bytesRead);
 
@@ -6041,7 +6041,7 @@ bool PDFWriterImpl::finalizeSignature()
     buffer.reset(new char[nLastByteRangeNo + 1]);
     CHECK_RETURN( (osl::File::E_None == m_aFile.read(buffer.get(), nLastByteRangeNo, bytesRead)) );
     if (bytesRead != (sal_uInt64) nLastByteRangeNo)
-        SAL_WARN("vcl.gdi", "PDF Signing: Second buffer read failed!");
+        SAL_WARN("vcl.pdfwriter", "PDF Signing: Second buffer read failed!");
 
     HASH_Update(hc.get(), reinterpret_cast<const unsigned char*>(buffer.get()), bytesRead);
 
@@ -6056,21 +6056,21 @@ bool PDFWriterImpl::finalizeSignature()
     NSSCMSMessage *cms_msg = NSS_CMSMessage_Create(NULL);
     if (!cms_msg)
     {
-        SAL_WARN("vcl.gdi", "PDF signing: can't create new CMS message.");
+        SAL_WARN("vcl.pdfwriter", "PDF signing: can't create new CMS message.");
         return false;
     }
 
     NSSCMSSignedData *cms_sd = NSS_CMSSignedData_Create(cms_msg);
     if (!cms_sd)
     {
-        SAL_WARN("vcl.gdi", "PDF signing: can't create CMS SignedData.");
+        SAL_WARN("vcl.pdfwriter", "PDF signing: can't create CMS SignedData.");
         return false;
     }
 
     NSSCMSContentInfo *cms_cinfo = NSS_CMSMessage_GetContentInfo(cms_msg);
     if (NSS_CMSContentInfo_SetContent_SignedData(cms_msg, cms_cinfo, cms_sd) != SECSuccess)
     {
-        SAL_WARN("vcl.gdi", "PDF signing: Can't set CMS content signed data.");
+        SAL_WARN("vcl.pdfwriter", "PDF signing: Can't set CMS content signed data.");
         return false;
     }
 
@@ -6078,48 +6078,48 @@ bool PDFWriterImpl::finalizeSignature()
     //attach NULL data as detached data
     if (NSS_CMSContentInfo_SetContent_Data(cms_msg, cms_cinfo, NULL, PR_TRUE) != SECSuccess)
     {
-        SAL_WARN("vcl.gdi", "PDF signing: Can't set CMS content data.");
+        SAL_WARN("vcl.pdfwriter", "PDF signing: Can't set CMS content data.");
         return false;
     }
 
     NSSCMSSignerInfo *cms_signer = NSS_CMSSignerInfo_Create(cms_msg, cert, SEC_OID_SHA1);
     if (!cms_signer)
     {
-        SAL_WARN("vcl.gdi", "PDF signing: can't create CMS SignerInfo.");
+        SAL_WARN("vcl.pdfwriter", "PDF signing: can't create CMS SignerInfo.");
         return false;
     }
 
     if (NSS_CMSSignerInfo_IncludeCerts(cms_signer, NSSCMSCM_CertChain, certUsageEmailSigner) != SECSuccess)
     {
-        SAL_WARN("vcl.gdi", "PDF signing: can't include cert chain.");
+        SAL_WARN("vcl.pdfwriter", "PDF signing: can't include cert chain.");
         return false;
     }
 
     if (NSS_CMSSignerInfo_AddSigningTime(cms_signer, PR_Now()) != SECSuccess)
     {
-        SAL_WARN("vcl.gdi", "PDF signing: can't add signing time.");
+        SAL_WARN("vcl.pdfwriter", "PDF signing: can't add signing time.");
         return false;
     }
 
     if (NSS_CMSSignedData_AddCertificate(cms_sd, cert) != SECSuccess)
     {
-        SAL_WARN("vcl.gdi", "PDF signing: can't add signer certificate.");
+        SAL_WARN("vcl.pdfwriter", "PDF signing: can't add signer certificate.");
         return false;
     }
 
     if (NSS_CMSSignedData_AddSignerInfo(cms_sd, cms_signer) != SECSuccess)
     {
-        SAL_WARN("vcl.gdi", "PDF signing: can't add signer info.");
+        SAL_WARN("vcl.pdfwriter", "PDF signing: can't add signer info.");
         return false;
     }
 
     if (NSS_CMSSignedData_SetDigestValue(cms_sd, SEC_OID_SHA1, &digest) != SECSuccess)
     {
-        SAL_WARN("vcl.gdi", "PDF signing: can't set PDF digest value.");
+        SAL_WARN("vcl.pdfwriter", "PDF signing: can't set PDF digest value.");
         return false;
     }
 
-    SAL_WARN("vcl.gdi","PKCS7 Object created successfully!");
+    SAL_WARN("vcl.pdfwriter","PKCS7 Object created successfully!");
 
     SECItem cms_output;
     cms_output.data = 0;
@@ -6132,24 +6132,24 @@ bool PDFWriterImpl::finalizeSignature()
 
     if (!cms_ecx)
     {
-        SAL_WARN("vcl.gdi", "PDF Signing: can't start DER encoder.");
+        SAL_WARN("vcl.pdfwriter", "PDF Signing: can't start DER encoder.");
         return false;
     }
-    SAL_WARN("vcl.gdi", "PDF Signing: Started DER encoding.");
+    SAL_WARN("vcl.pdfwriter", "PDF Signing: Started DER encoding.");
 
     if (NSS_CMSEncoder_Finish(cms_ecx) != SECSuccess)
     {
-        SAL_WARN("vcl.gdi", "PDF Signing: can't finish DER encoder.");
+        SAL_WARN("vcl.pdfwriter", "PDF Signing: can't finish DER encoder.");
         return false;
     }
-    SAL_WARN("vcl.gdi", "PDF Signing: Finished DER encoding.");
+    SAL_WARN("vcl.pdfwriter", "PDF Signing: Finished DER encoding.");
 
     OStringBuffer cms_hexbuffer;
 
     for (unsigned int i = 0; i < cms_output.len ; i++)
         appendHex(cms_output.data[i], cms_hexbuffer);
 
-    SAL_WARN("vcl.gdi","PKCS7 object encoded successfully!");
+    SAL_WARN("vcl.pdfwriter","PKCS7 object encoded successfully!");
 
     // Set file pointer to the m_nSignatureContentOffset, we're ready to overwrite PKCS7 object
     nWritten = 0;


More information about the Libreoffice-commits mailing list