From 76e0a520d6beb118dd6437889fbe16d2a94c941c Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Mon, 20 Jan 2025 09:27:54 +0100 Subject: 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 --- sfx2/source/doc/objserv.cxx | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'sfx2') 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 #include #include +#include #include #include @@ -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; } -- cgit ra/co-24.04.4'>distro/collabora/co-24.04.4 LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff