diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2024-09-26 09:07:41 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2024-09-26 11:06:06 +0200 |
commit | c57434559cf5ffd82c3c72e8a0884d4874885dca (patch) | |
tree | 2189a287f7f455044b39de95866f4801fe7012c1 /include/sfx2 | |
parent | 2b68729253437600db43f5c24838677b963a8c2f (diff) |
cool#9992 lok doc sign: conditionally show the add button in the sign dialog
Open the sign dialog, the Add button is hidden, even if the LOK clients
initializes the view with a working signing certificate.
SfxMedium::SignContents_Impl() knows the correct view, but by the time
the execution arrives to the DigitalSignaturesDialog ctor, this info is
lost, so we don't know what is the current view.
Fix the problem by looking up the view of the object shell at UNO
command dispatch time, and passing that around, so the signature dialog
can also access it. If the view has a signing certificate configured,
then allow signing.
The certificate chooser triggered by this button still needs fixing.
Change-Id: I1fae63cea27ea1e68e938879f4507f53ade484f1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173964
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'include/sfx2')
-rw-r--r-- | include/sfx2/digitalsignatures.hxx | 3 | ||||
-rw-r--r-- | include/sfx2/docfile.hxx | 2 |
2 files changed, 5 insertions, 0 deletions
diff --git a/include/sfx2/digitalsignatures.hxx b/include/sfx2/digitalsignatures.hxx index 856e1c5bf61a..84b77fd759dd 100644 --- a/include/sfx2/digitalsignatures.hxx +++ b/include/sfx2/digitalsignatures.hxx @@ -18,6 +18,8 @@ #include <sal/types.h> +class SfxViewShell; + namespace sfx2 { /// Extension of css::security::XDocumentDigitalSignatures for internal purposes. @@ -35,6 +37,7 @@ public: /// Async replacement for signDocumentContent(). virtual void SignDocumentContentAsync(const css::uno::Reference<css::embed::XStorage>& xStorage, const css::uno::Reference<css::io::XStream>& xSignStream, + SfxViewShell* pViewShell, const std::function<void(bool)>& rCallback) = 0; diff --git a/include/sfx2/docfile.hxx b/include/sfx2/docfile.hxx index e2b826886c45..17d409c8d134 100644 --- a/include/sfx2/docfile.hxx +++ b/include/sfx2/docfile.hxx @@ -53,6 +53,7 @@ class SfxFilter; class SfxMedium_Impl; class INetURLObject; class SfxFrame; +class SfxViewShell; class DateTime; struct ImplSVEvent; @@ -275,6 +276,7 @@ public: SAL_DLLPRIVATE void SignContents_Impl(weld::Window* pDialogParent, bool bSignScriptingContent, bool bHasValidDocumentSignature, + SfxViewShell* pViewShell, const std::function<void(bool)>& rCallback, const OUString& aSignatureLineId = OUString(), const css::uno::Reference<css::security::XCertificate>& xCert |