diff options
author | TokieSan <eltokhy@aucegypt.edu> | 2023-06-06 21:51:42 +0300 |
---|---|---|
committer | Thorsten Behrens <thorsten.behrens@allotropia.de> | 2023-06-18 22:03:43 +0200 |
commit | 46722dbaa7795074e3c5043a76ae3f3a7782491e (patch) | |
tree | 2f4e2549508b2f659209efa1a574490234010e85 /include | |
parent | 68a4f005bc3e74d847e82dddf3237137cf3a1648 (diff) |
tdf#155665 Adding option to remember signatures for each save
Added the option in digital signatures dialog to remember used
signature.
Implemented ResignDocument function in objserv.cxx to resign after
every save in case the option to remember signature is on.
Added a new dialog box that checks whether there is a need to
remember the signature.
Change-Id: Ia7dbcc952044e9542e3fe6cd84b5d6633fcd1461
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152687
Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
Tested-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/sfx2/objsh.hxx | 10 | ||||
-rw-r--r-- | include/sfx2/strings.hrc | 1 |
2 files changed, 9 insertions, 2 deletions
diff --git a/include/sfx2/objsh.hxx b/include/sfx2/objsh.hxx index b29fb43d77e4..15533c2954ca 100644 --- a/include/sfx2/objsh.hxx +++ b/include/sfx2/objsh.hxx @@ -190,6 +190,7 @@ private: // sal_False := new object bool bIsInGenerateThumbnail; //optimize thumbnail generate and store procedure to improve odt saving performance, i120030 bool mbAvoidRecentDocs; ///< Avoid adding to the recent documents list, if not necessary. + bool bRememberSignature; // Do we want to remember the signature. enum TriState {undefined, yes, no}; TriState mbContinueImportOnFilterExceptions = undefined; // try to import as much as possible @@ -199,6 +200,8 @@ private: SAL_DLLPRIVATE void UpdateTime_Impl(const css::uno::Reference< css::document::XDocumentProperties> & i_xDocProps); + css::uno::Sequence< css::security::DocumentSignatureInformation > rSignatureInfosRemembered; + SAL_DLLPRIVATE bool SaveTo_Impl(SfxMedium &rMedium, const SfxItemSet* pSet ); protected: @@ -350,13 +353,14 @@ public: void AfterSigning(bool bSignSuccess, bool bSignScriptingContent); bool HasValidSignatures() const; SignatureState GetDocumentSignatureState(); - void SignDocumentContent(weld::Window* pDialogParent); + bool SignDocumentContent(weld::Window* pDialogParent); css::uno::Sequence<css::security::DocumentSignatureInformation> GetDocumentSignatureInformation( bool bScriptingContent, const css::uno::Reference<css::security::XDocumentDigitalSignatures>& xSigner = css::uno::Reference<css::security::XDocumentDigitalSignatures>()); bool SignDocumentContentUsingCertificate(const css::uno::Reference<css::security::XCertificate>& xCertificate); + bool ResignDocument(css::uno::Sequence< css::security::DocumentSignatureInformation >& rSignaturesInfo); void SignSignatureLine(weld::Window* pDialogParent, const OUString& aSignatureLineId, const css::uno::Reference<css::security::XCertificate>& xCert, @@ -364,7 +368,7 @@ public: const css::uno::Reference<css::graphic::XGraphic>& xInvalidGraphic, const OUString& aComment); SignatureState GetScriptingSignatureState(); - void SignScriptingContent(weld::Window* pDialogParent); + bool SignScriptingContent(weld::Window* pDialogParent); DECL_DLLPRIVATE_LINK(SignDocumentHandler, weld::Button&, void); virtual std::shared_ptr<SfxDocumentInfoDialog> CreateDocumentInfoDialog(weld::Window* pParent, const SfxItemSet& rItemSet); @@ -458,6 +462,8 @@ public: /// Don't add to the recent documents - it's an expensive operation, sometimes it is not wanted. bool IsAvoidRecentDocs() const { return mbAvoidRecentDocs; } + bool IsRememberingSignature() const { return bRememberSignature; } + /// Don't add to the recent documents - it's an expensive operation, sometimes it is not wanted. void AvoidRecentDocs(bool bAvoid) { mbAvoidRecentDocs = bAvoid; } diff --git a/include/sfx2/strings.hrc b/include/sfx2/strings.hrc index bd2c0b5d5630..3ccc50cb0947 100644 --- a/include/sfx2/strings.hrc +++ b/include/sfx2/strings.hrc @@ -149,6 +149,7 @@ #define RID_SVXSTR_XMLSEC_QUERY_LOSINGSIGNATURE NC_("RID_SVXSTR_XMLSEC_QUERY_LOSINGSIGNATURE", "Saving will remove all existing signatures.\nDo you want to continue saving the document?") #define RID_SVXSTR_XMLSEC_QUERY_SAVEBEFORESIGN NC_("RID_SVXSTR_XMLSEC_QUERY_SAVEBEFORESIGN", "The document has to be saved before it can be signed.\nDo you want to save the document?") #define STR_QUERY_CANCELCHECKOUT NC_("STR_QUERY_CANCELCHECKOUT", "This will discard all changes on the server since check-out.\nDo you want to proceed?") +#define STR_QUERY_REMEMBERSIGNATURE NC_("STR_QUERY_REMEMBERSIGNATURE", "Do you want to remember that signature for each save?") #define STR_INFO_WRONGDOCFORMAT NC_("STR_INFO_WRONGDOCFORMAT", "This document must be saved in OpenDocument file format before it can be digitally signed.") #define RID_XMLSEC_DOCUMENTSIGNED NC_("RID_XMLSEC_DOCUMENTSIGNED", " (Signed)") #define STR_EMBEDDED_TITLE NC_("STR_EMBEDDED_TITLE", " (Embedded document)") |