diff options
author | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2018-05-16 16:34:35 +0200 |
---|---|---|
committer | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2018-05-18 14:45:19 +0200 |
commit | 201321f648e82ecc610e7a3324a46248a19c1704 (patch) | |
tree | 3905f8cf6f47b32e21c69afa34bccd98cd9676ba /sfx2 | |
parent | 168034416c9477ee5ae1d3c6f899451e28d42851 (diff) |
tdf#83877 Write SignatureLineId to ODF & OOXML signatures
Change-Id: I483a3b7895cdcb10ef9d6dacf167ed0f8db7e723
Reviewed-on: https://gerrit.libreoffice.org/54432
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/doc/docfile.cxx | 9 | ||||
-rw-r--r-- | sfx2/source/doc/objserv.cxx | 13 |
2 files changed, 12 insertions, 10 deletions
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx index 9de896d77a62..14a5f6aa61f0 100644 --- a/sfx2/source/doc/docfile.cxx +++ b/sfx2/source/doc/docfile.cxx @@ -3661,8 +3661,9 @@ void SfxMedium::CreateTempFileNoCopy() CloseStorage(); } -bool SfxMedium::SignContents_Impl(const Reference<XCertificate> xCert, bool bScriptingContent, - const OUString& aODFVersion, bool bHasValidDocumentSignature) +bool SfxMedium::SignContents_Impl(const Reference<XCertificate> xCert, const OUString& aSignatureLineId, + bool bScriptingContent, const OUString& aODFVersion, + bool bHasValidDocumentSignature) { bool bChanges = false; @@ -3753,7 +3754,7 @@ bool SfxMedium::SignContents_Impl(const Reference<XCertificate> xCert, bool bScr bool bSuccess = false; if (xCert.is()) bSuccess = xSigner->signDocumentContentWithCertificate( - GetZipStorageToSign_Impl(), xStream, xCert); + GetZipStorageToSign_Impl(), xStream, xCert, aSignatureLineId); else bSuccess = xSigner->signDocumentContent(GetZipStorageToSign_Impl(), xStream); @@ -3779,7 +3780,7 @@ bool SfxMedium::SignContents_Impl(const Reference<XCertificate> xCert, bool bScr if (xCert.is()) { bSuccess = xSigner->signDocumentContentWithCertificate( - GetZipStorageToSign_Impl(), xStream, xCert); + GetZipStorageToSign_Impl(/*bReadOnly=*/false), xStream, xCert, aSignatureLineId); } else { diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx index edac57aeceee..46865cf1107a 100644 --- a/sfx2/source/doc/objserv.cxx +++ b/sfx2/source/doc/objserv.cxx @@ -1361,7 +1361,7 @@ SignatureState SfxObjectShell::ImplGetSignatureState( bool bScriptingContent ) return *pState; } -void SfxObjectShell::ImplSign(Reference<XCertificate> xCert, +void SfxObjectShell::ImplSign(Reference<XCertificate> xCert, const OUString& aSignatureLineId, bool bScriptingContent) { // Check if it is stored in OASIS format... @@ -1488,7 +1488,7 @@ void SfxObjectShell::ImplSign(Reference<XCertificate> xCert, || pImpl->nDocumentSignatureState == SignatureState::PARTIAL_OK; bool bSignSuccess = GetMedium()->SignContents_Impl( - xCert, bScriptingContent, aODFVersion, bHasValidSignatures); + xCert, aSignatureLineId, bScriptingContent, aODFVersion, bHasValidSignatures); pImpl->m_bSavingForSigning = true; DoSaveCompleted( GetMedium() ); @@ -1523,12 +1523,13 @@ SignatureState SfxObjectShell::GetDocumentSignatureState() void SfxObjectShell::SignDocumentContent() { - ImplSign(Reference<XCertificate>()); + ImplSign(); } -void SfxObjectShell::SignDocumentContent(const Reference<XCertificate> xCert) +void SfxObjectShell::SignDocumentContent(const Reference<XCertificate> xCert, + const OUString& aSignatureLineId) { - ImplSign(xCert); + ImplSign(xCert, aSignatureLineId); } SignatureState SfxObjectShell::GetScriptingSignatureState() @@ -1538,7 +1539,7 @@ SignatureState SfxObjectShell::GetScriptingSignatureState() void SfxObjectShell::SignScriptingContent() { - ImplSign( Reference<XCertificate>(), true ); + ImplSign( Reference<XCertificate>(), OUString(), true ); } namespace |