summaryrefslogtreecommitdiff
path: root/xmlsecurity
diff options
context:
space:
mode:
authorMichael Stahl <michael.stahl@allotropia.de>2023-12-14 18:27:24 +0100
committerMichael Stahl <michael.stahl@allotropia.de>2023-12-15 11:51:09 +0100
commit7068c92257a05b3937c8a137d2d9048a881d0dc0 (patch)
treedaff5aeb22d03b8077b0f3e27e3b78e5c2314784 /xmlsecurity
parent5303dde8a7c2c09b7104f2c099f879d9273438cb (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> (cherry picked from commit 53c64cce13863861aabc4b1056cc3a1a66bf64a7) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160802
Diffstat (limited to 'xmlsecurity')
-rw-r--r--xmlsecurity/source/dialogs/certificatechooser.cxx10
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;
}