diff options
author | Tor Lillqvist <tml@collabora.com> | 2015-02-17 10:35:54 +0200 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2015-02-17 10:46:32 +0200 |
commit | d83e6e9cdb727b3ca2938048e115ba38886d4c70 (patch) | |
tree | 9f3f529a0bc155ecbf1681ebe62b1b16b6fd68db | |
parent | b8b9d51b8cf1cafe1a94e1baf957f3f282abb32f (diff) |
tdf#88431: Pass the selected Time Stamp Authority, if any, along to vcl
Work in progress. If a TSA is selected, pass it along to the signature
generation in vcl.
Change-Id: Ibe105b6d02ab9241b93dd66ab3cb1fa8c6d10093
-rw-r--r-- | filter/source/pdf/impdialog.cxx | 11 | ||||
-rw-r--r-- | filter/source/pdf/impdialog.hxx | 1 | ||||
-rw-r--r-- | filter/source/pdf/pdfexport.cxx | 3 | ||||
-rw-r--r-- | filter/source/pdf/pdfexport.hxx | 1 | ||||
-rw-r--r-- | include/vcl/pdfwriter.hxx | 1 |
5 files changed, 15 insertions, 2 deletions
diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx index da7929902de8..9ab990cd6796 100644 --- a/filter/source/pdf/impdialog.cxx +++ b/filter/source/pdf/impdialog.cxx @@ -435,7 +435,8 @@ Sequence< PropertyValue > ImpPDFTabDialog::GetFilterData() Sequence< PropertyValue > aRet( maConfigItem.GetFilterData() ); - int nElementAdded = 11; + // OMG, this is horrible coding style... + int nElementAdded = 12; aRet.realloc( aRet.getLength() + nElementAdded ); @@ -499,6 +500,10 @@ Sequence< PropertyValue > ImpPDFTabDialog::GetFilterData() aRet[ nLength - nElementAdded ].Value <<= maSignCertificate; nElementAdded--; + aRet[ nLength - nElementAdded ].Name = "SignatureTSA"; + aRet[ nLength - nElementAdded ].Value <<= msSignTSA; + nElementAdded--; + return aRet; } @@ -1626,7 +1631,9 @@ void ImpPDFTabSigningPage::GetFilterConfigItem( ImpPDFTabDialog* paParent ) paParent->msSignPassword = mpEdSignPassword->GetText(); paParent->msSignContact = mpEdSignContactInfo->GetText(); paParent->msSignReason = mpEdSignReason->GetText(); - + // Entry 0 is 'None' + if (mpLBSignTSA->GetSelectEntryPos() >= 1) + paParent->msSignTSA = mpLBSignTSA->GetSelectEntry(); } diff --git a/filter/source/pdf/impdialog.hxx b/filter/source/pdf/impdialog.hxx index 8ef6b18d57da..dc4a78789ce3 100644 --- a/filter/source/pdf/impdialog.hxx +++ b/filter/source/pdf/impdialog.hxx @@ -153,6 +153,7 @@ protected: OUString msSignContact; OUString msSignReason; com::sun::star::uno::Reference< com::sun::star::security::XCertificate > maSignCertificate; + OUString msSignTSA; OUString maWatermarkText; diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx index 84c95b8a477c..e2f5773cf690 100644 --- a/filter/source/pdf/pdfexport.cxx +++ b/filter/source/pdf/pdfexport.cxx @@ -556,6 +556,8 @@ bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue >& rFilterData[ nData ].Value >>= msSignPassword; else if ( rFilterData[ nData ].Name == "SignatureCertificate" ) rFilterData[ nData ].Value >>= maSignCertificate; + else if ( rFilterData[ nData ].Name == "SignatureTSA" ) + rFilterData[ nData ].Value >>= msSignTSA; } aContext.URL = aURL.GetMainURL(INetURLObject::DECODE_TO_IURI); @@ -787,6 +789,7 @@ bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue >& aContext.SignReason = msSignReason; aContext.SignPassword = msSignPassword; aContext.SignCertificate = maSignCertificate; + aContext.SignTSA = msSignTSA; // all context data set, time to create the printing device boost::scoped_ptr<PDFWriter> pPDFWriter(new PDFWriter( aContext, xEnc )); diff --git a/filter/source/pdf/pdfexport.hxx b/filter/source/pdf/pdfexport.hxx index 38a050d0d759..5123bdc6c897 100644 --- a/filter/source/pdf/pdfexport.hxx +++ b/filter/source/pdf/pdfexport.hxx @@ -108,6 +108,7 @@ private: OUString msSignReason; OUString msSignPassword; Reference< security::XCertificate > maSignCertificate; + OUString msSignTSA; void ImplWriteWatermark( ::vcl::PDFWriter& rWriter, const Size& rPageSize ); public: diff --git a/include/vcl/pdfwriter.hxx b/include/vcl/pdfwriter.hxx index f8c1ff55b479..d8c64c483963 100644 --- a/include/vcl/pdfwriter.hxx +++ b/include/vcl/pdfwriter.hxx @@ -630,6 +630,7 @@ The following structure describes the permissions used in PDF security // 0 here specifies a default handling PDFWriter::ColorMode ColorMode; com::sun::star::uno::Reference< com::sun::star::security::XCertificate> SignCertificate; + OUString SignTSA; PDFWriterContext() : RelFsys( false ), //i56629, i49415?, i64585? |