summaryrefslogtreecommitdiff
path: root/xmlsecurity/source
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>2024-07-15 09:19:45 +0200
committerAndras Timar <andras.timar@collabora.com>2024-08-23 11:17:12 +0200
commit2f4d180bc934565c24066ef82372b6a482fa21d2 (patch)
tree5840203d3a66ed0cd91707aee0deef11a761b979 /xmlsecurity/source
parentcf84c493f302e122a60a9bc7d59c2621b1e8b2d2 (diff)
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 <samuel.mehrbrodt@allotropia.de> (cherry picked from commit a19aa4754651e685ca07131bfa454c3360191269) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171194 Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
Diffstat (limited to 'xmlsecurity/source')
-rw-r--r--xmlsecurity/source/dialogs/certificatechooser.cxx17
1 files changed, 13 insertions, 4 deletions
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<int> aWidths
+ {
+ o3tl::narrowing<int>(30*nControlWidth/100),
+ o3tl::narrowing<int>(30*nControlWidth/100),
+ o3tl::narrowing<int>(10*nControlWidth/100),
+ o3tl::narrowing<int>(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