summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2025-01-20 09:27:54 +0100
committerMiklos Vajna <vmiklos@collabora.com>2025-01-20 17:21:18 +0100
commit76e0a520d6beb118dd6437889fbe16d2a94c941c (patch)
tree1778225de6ac93e3639ee44c9c0497dfcdb78e9e /sfx2
parent4c6316ef441a2013cf92ed81436ad569d6ebe44a (diff)
cool#10630 doc electronic sign: unselect & reject reselect
Insert a signature line, move/resize the selected shape, finish signing, the signature line is still selected and you can still move/resize it. This was working for the desktop visual signing which SfxViewShell::GetSignPDFCertificate() returned an XCertificate, but not for electronic signing, which is a separate branch in SfxObjectShell::ExecFile_Impl(). Fix the problem by deselecting the shape even in the desktop case and the moving this cleanup code to a new ResetSignatureSelection() and calling that in the electronic sign case, too. SdrMarkView::UnmarkAllObj() is private to sfx2/, so go via UNO to do the same. Change-Id: I52c89c4aea0203f8624bd801a900186211541dc3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180508 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/doc/objserv.cxx19
1 files changed, 17 insertions, 2 deletions
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index 2990405e63d0..7c4f79b57d22 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -92,6 +92,7 @@
#include <sfx2/sfxuno.hxx>
#include <sfx2/sfxsids.hrc>
#include <sfx2/lokhelper.hxx>
+#include <comphelper/dispatchcommand.hxx>
#include <SfxRedactionHelper.hxx>
#include <com/sun/star/util/XCloseable.hpp>
@@ -520,6 +521,17 @@ void SfxObjectShell::AfterSignContent(bool bHaveWeSigned, weld::Window* pDialogP
}
}
+namespace
+{
+/// Updates the UI so it doesn't try to modify an already finalized signature line shape.
+void ResetSignatureSelection(SfxObjectShell& rObjectShell, SfxViewShell& rViewShell)
+{
+ rViewShell.SetSignPDFCertificate({});
+ comphelper::dispatchCommand(".uno:DeSelect", {});
+ rObjectShell.RecheckSignature(false);
+}
+}
+
void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
{
weld::Window* pDialogParent = rReq.GetFrameWeld();
@@ -557,8 +569,7 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
// the infobar back to "sign document".
if (pViewShell)
{
- pViewShell->SetSignPDFCertificate({});
- RecheckSignature(false);
+ ResetSignatureSelection(*this, *pViewShell);
pFrame->RemoveInfoBar(u"readonly");
pFrame->AppendReadOnlyInfobar();
}
@@ -600,6 +611,10 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
if (!aSigningContext.m_aSignatureValue.empty())
{
SignDocumentContentUsingCertificate(aSigningContext);
+ if (pViewShell)
+ {
+ ResetSignatureSelection(*this, *pViewShell);
+ }
rReq.Done();
return;
}