diff options
author | Michael Stahl <michael.stahl@allotropia.de> | 2023-12-14 18:27:24 +0100 |
---|---|---|
committer | Michael Stahl <michael.stahl@allotropia.de> | 2023-12-15 10:51:22 +0100 |
commit | 53c64cce13863861aabc4b1056cc3a1a66bf64a7 (patch) | |
tree | c962cbdfdc1eb6c905906f7581535fe9e4bb1fe5 /xmlsecurity/source | |
parent | dcae6615ed254cf7884fa6415f64561f85b93588 (diff) |
xmlsecurity: fix assert in CertificateChooser::ImplInitialize()
gtk3/gtkinst.cxx:15371: virtual void (anonymous namespace)::GtkInstanceTreeView::select(int): Assertion `gtk_tree_view_get_model(m_pTreeView) && "don't select when frozen, select after thaw. Note selection doesn't survive a freeze"' failed.
(regression from commit ad6f23d2a3842c40f7c812003af4031150ea8183)
Change-Id: I8c0639e755188731bdd211f9d71a830d7afeeaa6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160786
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'xmlsecurity/source')
-rw-r--r-- | xmlsecurity/source/dialogs/certificatechooser.cxx | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/xmlsecurity/source/dialogs/certificatechooser.cxx b/xmlsecurity/source/dialogs/certificatechooser.cxx index a7ff02f1a583..9dba3e9e9066 100644 --- a/xmlsecurity/source/dialogs/certificatechooser.cxx +++ b/xmlsecurity/source/dialogs/certificatechooser.cxx @@ -169,6 +169,7 @@ void CertificateChooser::ImplInitialize(bool mbSearch) } + ::std::optional<int> oSelectRow; uno::Sequence<uno::Reference< security::XCertificate>> xCerts; for (auto& secContext : mxSecurityContexts) { @@ -242,7 +243,9 @@ void CertificateChooser::ImplInitialize(bool mbSearch) if ( sIssuer == msPreferredKey ) { if ( meAction == UserAction::Sign || meAction == UserAction::SelectSign ) - m_xCertLB->select(nRow); + { + oSelectRow.emplace(nRow); + } else if ( meAction == UserAction::Encrypt && aUserOpts.GetEncryptToSelf() ) mxEncryptToSelf = xCert; @@ -255,6 +258,11 @@ void CertificateChooser::ImplInitialize(bool mbSearch) m_xCertLB->thaw(); m_xCertLB->unselect_all(); + if (oSelectRow) + { + m_xCertLB->select(*oSelectRow); + } + CertificateHighlightHdl(*m_xCertLB); mbInitialized = true; } |