xmlsecurity/source/dialogs/certificatechooser.cxx  |   17 ++-------
 xmlsecurity/uiconfig/ui/selectcertificatedialog.ui |   36 ---------------------
 2 files changed, 5 insertions(+), 48 deletions(-)

New commits:
commit 9f327102c435887bbae650b3a573f44500b6f534
Author:     TokieSan <elto...@aucegypt.edu>
AuthorDate: Thu Aug 10 04:05:23 2023 +0300
Commit:     Heiko Tietze <heiko.tie...@documentfoundation.org>
CommitDate: Wed Aug 23 08:42:27 2023 +0200

    Removed Type and Usage Columns from Certificate Chooser
    
    Both columns are irrelevant in the main dialog's view, can be viewed
    through viewing certificate's details.
    
    Change-Id: I265a7e125c2679f3a05dba4414f4104f3a5cac2f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155746
    Tested-by: Jenkins
    Reviewed-by: Heiko Tietze <heiko.tie...@documentfoundation.org>

diff --git a/xmlsecurity/source/dialogs/certificatechooser.cxx 
b/xmlsecurity/source/dialogs/certificatechooser.cxx
index c7f055deea16..be3e88f9d453 100644
--- a/xmlsecurity/source/dialogs/certificatechooser.cxx
+++ b/xmlsecurity/source/dialogs/certificatechooser.cxx
@@ -57,14 +57,6 @@ CertificateChooser::CertificateChooser(weld::Window* 
_pParent,
     m_xCertLB->set_size_request(nControlWidth, m_xCertLB->get_height_rows(12));
     m_xCertLB->make_sorted();
 
-    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 
) );
@@ -225,6 +217,7 @@ 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
@@ -235,13 +228,11 @@ void CertificateChooser::ImplInitialize(bool mbSearch)
 
             m_xCertLB->append();
             int nRow = m_xCertLB->n_children() - 1;
-            m_xCertLB->set_text(nRow, 
xmlsec::GetContentPart(xCert->getSubjectName(), xCert->getCertificateKind()), 
0);
-            m_xCertLB->set_text(nRow, sIssuer, 1);
-            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);
+            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);
 
 #if HAVE_FEATURE_GPGME
             // only GPG has preferred keys
diff --git a/xmlsecurity/uiconfig/ui/selectcertificatedialog.ui 
b/xmlsecurity/uiconfig/ui/selectcertificatedialog.ui
index b6fb9a9c5610..e476a7ddd61a 100644
--- a/xmlsecurity/uiconfig/ui/selectcertificatedialog.ui
+++ b/xmlsecurity/uiconfig/ui/selectcertificatedialog.ui
@@ -8,12 +8,8 @@
       <column type="gchararray"/>
       <!-- column-name text2 -->
       <column type="gchararray"/>
-      <!-- column-name text3 -->
-      <column type="gchararray"/>
       <!-- column-name text4 -->
       <column type="gchararray"/>
-      <!-- column-name text5 -->
-      <column type="gchararray"/>
       <!-- column-name id -->
       <column type="gchararray"/>
     </columns>
@@ -172,7 +168,7 @@
                       <object class="GtkTreeViewColumn" id="treeviewcolumn5">
                         <property name="resizable">True</property>
                         <property name="spacing">6</property>
-                        <property name="title" translatable="yes" 
context="selectcertificatedialog|type">Type</property>
+                        <property name="title" translatable="yes" 
context="selectcertificatedialog|type">Expiration date</property>
                         <property name="sort-indicator">True</property>
                         <property name="sort-column-id">2</property>
                         <child>
@@ -183,36 +179,6 @@
                         </child>
                       </object>
                     </child>
-                    <child>
-                      <object class="GtkTreeViewColumn" id="treeviewcolumn6">
-                        <property name="resizable">True</property>
-                        <property name="spacing">6</property>
-                        <property name="title" translatable="yes" 
context="selectcertificatedialog|expiration">Expiration date</property>
-                        <property name="sort-indicator">True</property>
-                        <property name="sort-column-id">3</property>
-                        <child>
-                          <object class="GtkCellRendererText" 
id="cellrenderer4"/>
-                          <attributes>
-                            <attribute name="text">3</attribute>
-                          </attributes>
-                        </child>
-                      </object>
-                    </child>
-                    <child>
-                      <object class="GtkTreeViewColumn" id="treeviewcolumn7">
-                        <property name="resizable">True</property>
-                        <property name="spacing">6</property>
-                        <property name="title" translatable="yes" 
context="selectcertificatedialog|usage">Certificate usage</property>
-                        <property name="sort-indicator">True</property>
-                        <property name="sort-column-id">4</property>
-                        <child>
-                          <object class="GtkCellRendererText" 
id="cellrenderer5"/>
-                          <attributes>
-                            <attribute name="text">4</attribute>
-                          </attributes>
-                        </child>
-                      </object>
-                    </child>
                     <child internal-child="accessible">
                       <object class="AtkObject" id="signatures-atkobject">
                         <property name="AtkObject::accessible-description" 
translatable="yes" 
context="selectcertificatedialog|extended_tip|signatures">Select the 
certificate that you want to digitally sign the current document 
with.</property>

Reply via email to