From 2f4d180bc934565c24066ef82372b6a482fa21d2 Mon Sep 17 00:00:00 2001 From: Samuel Mehrbrodt Date: Mon, 15 Jul 2024 09:19:45 +0200 Subject: tdf#161871 Revert "Removed Type and Usage Columns from Certificate Chooser" The commit broke the display of all columns except the first one in all backends except gtk3. Also it's not clear why those columns are deemed superfluous; see discussion in tdf#161871 This reverts commit 9f327102c435887bbae650b3a573f44500b6f534. Change-Id: Idc3496122137f98c23bb7df8e36b17281fc948d3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170491 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt (cherry picked from commit a19aa4754651e685ca07131bfa454c3360191269) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171194 Reviewed-by: Adolfo Jayme Barrientos --- xmlsecurity/source/dialogs/certificatechooser.cxx | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'xmlsecurity/source') diff --git a/xmlsecurity/source/dialogs/certificatechooser.cxx b/xmlsecurity/source/dialogs/certificatechooser.cxx index 730549093390..4bdb4bcc3e07 100644 --- a/xmlsecurity/source/dialogs/certificatechooser.cxx +++ b/xmlsecurity/source/dialogs/certificatechooser.cxx @@ -57,6 +57,14 @@ CertificateChooser::CertificateChooser(weld::Window* _pParent, auto nControlWidth = m_xCertLB->get_approximate_digit_width() * 105; m_xCertLB->set_size_request(nControlWidth, m_xCertLB->get_height_rows(12)); + std::vector aWidths + { + o3tl::narrowing(30*nControlWidth/100), + o3tl::narrowing(30*nControlWidth/100), + o3tl::narrowing(10*nControlWidth/100), + o3tl::narrowing(20*nControlWidth/100) + }; + m_xCertLB->set_column_fixed_widths(aWidths); m_xCertLB->connect_changed( LINK( this, CertificateChooser, CertificateHighlightHdl ) ); m_xCertLB->connect_row_activated( LINK( this, CertificateChooser, CertificateSelectHdl ) ); m_xViewBtn->connect_clicked( LINK( this, CertificateChooser, ViewButtonHdl ) ); @@ -220,7 +228,6 @@ void CertificateChooser::ImplInitialize(bool mbSearch) mvUserData.push_back(userData); OUString sIssuer = xmlsec::GetContentPart( xCert->getIssuerName(), xCert->getCertificateKind()); - OUString sExpDate = utl::GetDateString(xCert->getNotValidAfter()); // If we are searching and there is no match skip if (mbSearch @@ -231,11 +238,13 @@ void CertificateChooser::ImplInitialize(bool mbSearch) m_xCertLB->append(); int nRow = m_xCertLB->n_children() - 1; - OUString sId(weld::toId(userData.get())); - m_xCertLB->set_id(nRow, sId); m_xCertLB->set_text(nRow, xmlsec::GetContentPart(xCert->getSubjectName(), xCert->getCertificateKind()), 0); m_xCertLB->set_text(nRow, sIssuer, 1); - m_xCertLB->set_text(nRow, sExpDate, 2); + m_xCertLB->set_text(nRow, xmlsec::GetCertificateKind(xCert->getCertificateKind()), 2); + m_xCertLB->set_text(nRow, utl::GetDateString(xCert->getNotValidAfter()), 3); + m_xCertLB->set_text(nRow, UsageInClearText(xCert->getCertificateUsage()), 4); + OUString sId(weld::toId(userData.get())); + m_xCertLB->set_id(nRow, sId); #if HAVE_FEATURE_GPGME // only GPG has preferred keys -- cgit