[Libreoffice-commits] core.git: xmlsecurity/inc xmlsecurity/source xmlsecurity/uiconfig xmlsecurity/UIConfig_xmlsec.mk

Rachit Gupta rachitgupta1792 at gmail.com
Sun Aug 3 00:30:43 PDT 2014


 xmlsecurity/UIConfig_xmlsec.mk                    |    1 
 xmlsecurity/inc/xmlsecurity/certificateviewer.hxx |   10 -
 xmlsecurity/source/dialogs/certificateviewer.cxx  |   48 +++----
 xmlsecurity/source/dialogs/certificateviewer.src  |  145 +++++++++-------------
 xmlsecurity/source/dialogs/dialogs.hrc            |   33 +----
 xmlsecurity/uiconfig/ui/certdetails.ui            |   38 +++++
 6 files changed, 143 insertions(+), 132 deletions(-)

New commits:
commit e2b0e7571a8b082a2cb532e34b9770060128452b
Author: Rachit Gupta <rachitgupta1792 at gmail.com>
Date:   Sat Aug 2 19:04:56 2014 +0530

    Converted RID_XMLSECTP_DETAILS to Widget Layout.
    
    Change-Id: Ie284f5902879093f882a1f69b481df4a1a319a35
    Reviewed-on: https://gerrit.libreoffice.org/10693
    Reviewed-by: David Tardon <dtardon at redhat.com>
    Tested-by: David Tardon <dtardon at redhat.com>

diff --git a/xmlsecurity/UIConfig_xmlsec.mk b/xmlsecurity/UIConfig_xmlsec.mk
index 1a7ef1e..1832191 100644
--- a/xmlsecurity/UIConfig_xmlsec.mk
+++ b/xmlsecurity/UIConfig_xmlsec.mk
@@ -11,6 +11,7 @@ $(eval $(call gb_UIConfig_UIConfig,xmlsec))
 
 $(eval $(call gb_UIConfig_add_uifiles,xmlsec,\
 	xmlsecurity/uiconfig/ui/certpage \
+	xmlsecurity/uiconfig/ui/certdetails \
 	xmlsecurity/uiconfig/ui/digitalsignaturesdialog \
 	xmlsecurity/uiconfig/ui/securitylevelpage \
 	xmlsecurity/uiconfig/ui/securitytrustpage \
diff --git a/xmlsecurity/inc/xmlsecurity/certificateviewer.hxx b/xmlsecurity/inc/xmlsecurity/certificateviewer.hxx
index 9d2f354..9964900 100644
--- a/xmlsecurity/inc/xmlsecurity/certificateviewer.hxx
+++ b/xmlsecurity/inc/xmlsecurity/certificateviewer.hxx
@@ -101,11 +101,11 @@ public:
 class CertificateViewerDetailsTP : public CertificateViewerTP
 {
 private:
-    SvSimpleTableContainer m_aElementsLBContainer;
-    SvSimpleTable      maElementsLB;
-    MultiLineEdit       maElementML;
-    Font                maStdFont;
-    Font                maFixedWidthFont;
+    SvSimpleTableContainer* m_pElementsLBContainer;
+    SvSimpleTable*          m_pElementsLB;
+    MultiLineEdit*          m_pValueDetails;
+    Font                    m_aStdFont;
+    Font                    m_aFixedWidthFont;
 
     DECL_LINK(          ElementSelectHdl, void* );
     void                Clear( void );
diff --git a/xmlsecurity/source/dialogs/certificateviewer.cxx b/xmlsecurity/source/dialogs/certificateviewer.cxx
index 99177dc..9ff204a 100644
--- a/xmlsecurity/source/dialogs/certificateviewer.cxx
+++ b/xmlsecurity/source/dialogs/certificateviewer.cxx
@@ -224,44 +224,45 @@ inline Details_UserDatat::Details_UserDatat( const OUString& _rTxt, bool _bFixed
 
 void CertificateViewerDetailsTP::Clear( void )
 {
-    maElementML.SetText( OUString() );
+    m_pValueDetails->SetText( OUString() );
     sal_uLong           i = 0;
-    SvTreeListEntry*    pEntry = maElementsLB.GetEntry( i );
+    SvTreeListEntry*    pEntry = m_pElementsLB->GetEntry( i );
     while( pEntry )
     {
         delete ( Details_UserDatat* ) pEntry->GetUserData();
         ++i;
-        pEntry = maElementsLB.GetEntry( i );
+        pEntry = m_pElementsLB->GetEntry( i );
     }
 
-    maElementsLB.Clear();
+    m_pElementsLB->Clear();
 }
 
 void CertificateViewerDetailsTP::InsertElement( const OUString& _rField, const OUString& _rValue,
                                                 const OUString& _rDetails, bool _bFixedWidthFont )
 {
-    SvTreeListEntry*    pEntry = maElementsLB.InsertEntry( _rField );
-    maElementsLB.SetEntryText( _rValue, pEntry, 1 );
+    SvTreeListEntry*    pEntry = m_pElementsLB->InsertEntry( _rField );
+    m_pElementsLB->SetEntryText( _rValue, pEntry, 1 );
     pEntry->SetUserData( ( void* ) new Details_UserDatat( _rDetails, _bFixedWidthFont ) );
 }
 
 CertificateViewerDetailsTP::CertificateViewerDetailsTP( Window* _pParent, CertificateViewer* _pDlg )
-    :CertificateViewerTP    ( _pParent, XMLSEC_RES( RID_XMLSECTP_DETAILS ), _pDlg  )
-    ,m_aElementsLBContainer(this, XMLSEC_RES(LB_ELEMENTS))
-    ,maElementsLB(m_aElementsLBContainer)
-    ,maElementML            ( this, XMLSEC_RES( ML_ELEMENT ) )
-    ,maStdFont              ( maElementML.GetControlFont() )
-    ,maFixedWidthFont       ( OutputDevice::GetDefaultFont( DEFAULTFONT_UI_FIXED, LANGUAGE_DONTKNOW, DEFAULTFONT_FLAGS_ONLYONE, this ) )
+    :CertificateViewerTP    ( _pParent, "CertDetails", "xmlsec/ui/certdetails.ui", _pDlg  )
+    ,m_aFixedWidthFont( OutputDevice::GetDefaultFont( DEFAULTFONT_UI_FIXED, LANGUAGE_DONTKNOW, DEFAULTFONT_FLAGS_ONLYONE, this ) )
 {
-    WinBits nStyle = maElementsLB.GetStyle();
+    get( m_pValueDetails, "valuedetails" );
+    get( m_pElementsLBContainer, "tablecontainer" );
+    m_pElementsLB = new SvSimpleTable( *m_pElementsLBContainer );
+
+    m_aStdFont = m_pValueDetails->GetControlFont();
+    WinBits nStyle = m_pElementsLB->GetStyle();
     nStyle &= ~WB_HSCROLL;
-    maElementsLB.SetStyle( nStyle );
+    m_pElementsLB->SetStyle( nStyle );
 
-    maFixedWidthFont.SetHeight( maStdFont.GetHeight() );
+    m_aFixedWidthFont.SetHeight( m_aStdFont.GetHeight() );
 
     static long nTabs[] = { 2, 0, 30*CS_LB_WIDTH/100 };
-    maElementsLB.SetTabs( &nTabs[ 0 ] );
-    maElementsLB.InsertHeaderEntry( XMLSEC_RES( STR_HEADERBAR ) );
+    m_pElementsLB->SetTabs( &nTabs[ 0 ] );
+    m_pElementsLB->InsertHeaderEntry( XMLSEC_RES( STR_HEADERBAR ) );
 
     // fill list box
     Reference< security::XCertificate > xCert = mpDlg->mxCert;
@@ -321,14 +322,13 @@ CertificateViewerDetailsTP::CertificateViewerDetailsTP( Window* _pParent, Certif
     aDetails = XmlSec::GetHexString( aSeq, pHexSep, nLineBreak );
     InsertElement( XMLSEC_RES( STR_THUMBPRINT_MD5 ), aLBEntry, aDetails, true );
 
-    FreeResource();
-
-    maElementsLB.SetSelectHdl( LINK( this, CertificateViewerDetailsTP, ElementSelectHdl ) );
+    m_pElementsLB->SetSelectHdl( LINK( this, CertificateViewerDetailsTP, ElementSelectHdl ) );
 }
 
 CertificateViewerDetailsTP::~CertificateViewerDetailsTP()
 {
     Clear();
+    delete m_pElementsLB;
 }
 
 void CertificateViewerDetailsTP::ActivatePage()
@@ -337,7 +337,7 @@ void CertificateViewerDetailsTP::ActivatePage()
 
 IMPL_LINK_NOARG(CertificateViewerDetailsTP, ElementSelectHdl)
 {
-    SvTreeListEntry*    pEntry = maElementsLB.FirstSelected();
+    SvTreeListEntry*    pEntry = m_pElementsLB->FirstSelected();
     OUString        aElementText;
     bool            bFixedWidthFont;
     if( pEntry )
@@ -349,9 +349,9 @@ IMPL_LINK_NOARG(CertificateViewerDetailsTP, ElementSelectHdl)
     else
         bFixedWidthFont = false;
 
-    maElementML.SetFont( bFixedWidthFont? maFixedWidthFont : maStdFont );
-    maElementML.SetControlFont( bFixedWidthFont? maFixedWidthFont : maStdFont );
-    maElementML.SetText( aElementText );
+    m_pValueDetails->SetFont( bFixedWidthFont? m_aFixedWidthFont : m_aStdFont );
+    m_pValueDetails->SetControlFont( bFixedWidthFont? m_aFixedWidthFont : m_aStdFont );
+    m_pValueDetails->SetText( aElementText );
 
     return 0;
 }
diff --git a/xmlsecurity/source/dialogs/certificateviewer.src b/xmlsecurity/source/dialogs/certificateviewer.src
index a7b3586..957b141 100644
--- a/xmlsecurity/source/dialogs/certificateviewer.src
+++ b/xmlsecurity/source/dialogs/certificateviewer.src
@@ -122,90 +122,69 @@ TabPage RID_XMLSECTP_GENERAL
     };
 };
 
-TabPage RID_XMLSECTP_DETAILS
+String STR_HEADERBAR
 {
-    HelpId = HID_XMLSEC_TP_DETAILS;
-    Size = MAP_APPFONT( TP_WIDTH, TP_HEIGHT );
-    OutputSize = TRUE;
-    Hide = TRUE;
-    SVLook = TRUE;
-    Control LB_ELEMENTS
-    {
-        HelpId = HID_XMLSEC_CTRL_ELEMENTS;
-        Pos = MAP_APPFONT( CV_COL_0, CV_ROW_0 );
-        Size = MAP_APPFONT( CV_CONT_WIDTH, CV_ROW_1-CV_ROW_0 );
-        SVLook = TRUE;
-        Border = TRUE;
-    };
-    String STR_HEADERBAR
-    {
-        Text [ en-US ] = "Field\tValue";
-    };
-    MultiLineEdit ML_ELEMENT
-    {
-        HelpID = "xmlsecurity:MultiLineEdit:RID_XMLSECTP_DETAILS:ML_ELEMENT";
-        Pos = MAP_APPFONT( CV_COL_0, CV_ROW_2 );
-        Size = MAP_APPFONT( CV_CONT_WIDTH, CV_ROW_3-CV_ROW_2 );
-        ReadOnly = TRUE;
-        Border = TRUE;
-        VSCROLL = TRUE;
-    };
-    String STR_VERSION
-    {
-        Text [ en-US ] = "Version";
-    };
-    String STR_SERIALNUM
-    {
-        Text [ en-US ] = "Serial Number";
-    };
-    String STR_SIGALGORITHM
-    {
-        Text [ en-US ] = "Signature Algorithm";
-    };
-    String STR_ISSUER
-    {
-        Text [ en-US ] = "Issuer";
-    };
-    String STR_ISSUER_ID
-    {
-        Text [ en-US ] = "Issuer Unique ID";
-    };
-    String STR_VALIDFROM
-    {
-        Text [ en-US ] = "Valid From";
-    };
-    String STR_VALIDTO
-    {
-        Text [ en-US ] = "Valid to";
-    };
-    String STR_SUBJECT
-    {
-        Text [ en-US ] = "Subject";
-    };
-    String STR_SUBJECT_ID
-    {
-        Text [ en-US ] = "Subject Unique ID";
-    };
-    String STR_SUBJECT_PUBKEY_ALGO
-    {
-        Text [ en-US ] = "Subject Algorithm";
-    };
-    String STR_SUBJECT_PUBKEY_VAL
-    {
-        Text [ en-US ] = "Public Key";
-    };
-    String STR_SIGNATURE_ALGO
-    {
-        Text [ en-US ] = "Signature Algorithm";
-    };
-    String STR_THUMBPRINT_SHA1
-    {
-        Text [ en-US ] = "Thumbprint SHA1";
-    };
-    String STR_THUMBPRINT_MD5
-    {
-        Text [ en-US ] = "Thumbprint MD5";
-    };
+    Text [ en-US ] = "Field\tValue";
+};
+
+String STR_VERSION
+{
+    Text [ en-US ] = "Version";
+};
+
+String STR_SERIALNUM
+{
+    Text [ en-US ] = "Serial Number";
+};
+
+String STR_SIGALGORITHM
+{
+    Text [ en-US ] = "Signature Algorithm";
+};
+
+String STR_ISSUER
+{
+    Text [ en-US ] = "Issuer";
+};
+
+String STR_VALIDFROM
+{
+    Text [ en-US ] = "Valid From";
+};
+
+String STR_VALIDTO
+{
+    Text [ en-US ] = "Valid to";
+};
+
+String STR_SUBJECT
+{
+    Text [ en-US ] = "Subject";
+};
+
+String STR_SUBJECT_PUBKEY_ALGO
+{
+    Text [ en-US ] = "Subject Algorithm";
+};
+
+String STR_SUBJECT_PUBKEY_VAL
+{
+    Text [ en-US ] = "Public Key";
+};
+
+String STR_SIGNATURE_ALGO
+{
+    Text [ en-US ] = "Signature Algorithm";
+};
+
+String STR_THUMBPRINT_SHA1
+{
+    Text [ en-US ] = "Thumbprint SHA1";
+};
+
+String STR_THUMBPRINT_MD5
+{
+    Text [ en-US ] = "Thumbprint MD5";
 };
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmlsecurity/source/dialogs/dialogs.hrc b/xmlsecurity/source/dialogs/dialogs.hrc
index 7e7476a..f07d52d 100644
--- a/xmlsecurity/source/dialogs/dialogs.hrc
+++ b/xmlsecurity/source/dialogs/dialogs.hrc
@@ -28,7 +28,19 @@
 #define FL_BOTTOM_SEP                   50
 #define BTN_HELP                        53
 
-#define STR_HEADERBAR                   56
+#define STR_HEADERBAR                   256
+#define STR_VERSION                     257
+#define STR_SERIALNUM                   258
+#define STR_ISSUER                      259
+#define STR_VALIDFROM                   260
+#define STR_VALIDTO                     261
+#define STR_SUBJECT                     262
+#define STR_SUBJECT_PUBKEY_ALGO         263
+#define STR_SUBJECT_PUBKEY_VAL          264
+#define STR_SIGALGORITHM                265
+#define STR_SIGNATURE_ALGO              266
+#define STR_THUMBPRINT_SHA1             267
+#define STR_THUMBPRINT_MD5              268
 
 // --------- general metrics ---------
 #define DLGS_WIDTH                      287
@@ -103,25 +115,6 @@
 #define CW_ROW_9                        (CW_ROW_8+RSC_SP_CTRL_Y+RSC_CD_FIXEDTEXT_HEIGHT)
 #define CW_ROW_10                       (CW_ROW_9+2)
 
-// --------- tab page Certificate viewer - Details ---------
-
-#define LB_ELEMENTS                     1
-#define ML_ELEMENT                      2
-
-#define STR_VERSION                     1
-#define STR_SERIALNUM                   2
-#define STR_SIGALGORITHM                3
-#define STR_ISSUER                      4
-#define STR_ISSUER_ID                   5
-#define STR_VALIDFROM                   6
-#define STR_VALIDTO                     7
-#define STR_SUBJECT                     8
-#define STR_SUBJECT_ID                  9
-#define STR_SUBJECT_PUBKEY_ALGO         10
-#define STR_SUBJECT_PUBKEY_VAL          11
-#define STR_SIGNATURE_ALGO              12
-#define STR_THUMBPRINT_SHA1             13
-#define STR_THUMBPRINT_MD5              14
 
 // --------- tab page Certificate viewer - Certification Path ---------
 
diff --git a/xmlsecurity/uiconfig/ui/certdetails.ui b/xmlsecurity/uiconfig/ui/certdetails.ui
new file mode 100644
index 0000000..52a6681
--- /dev/null
+++ b/xmlsecurity/uiconfig/ui/certdetails.ui
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.16.1 -->
+<interface>
+  <!-- interface-requires gtk+ 3.0 -->
+  <!-- interface-requires LibreOffice 1.0 -->
+  <object class="GtkBox" id="CertDetails">
+    <property name="visible">True</property>
+    <property name="can_focus">False</property>
+    <property name="orientation">vertical</property>
+    <property name="homogeneous">True</property>
+    <property name="spacing">12</property>
+    <property name="hexpand">True</property>
+    <property name="vexpand">True</property>
+    <property name="border_width">6</property>
+    <child>
+      <object class="svtlo-SvSimpleTableContainer" id="tablecontainer:border">
+        <property name="visible">True</property>
+        <property name="can_focus">True</property>
+      </object>
+      <packing>
+        <property name="expand">False</property>
+        <property name="fill">True</property>
+        <property name="position">0</property>
+      </packing>
+    </child>
+    <child>
+      <object class="svtlo-MultiLineEditSyntaxHighlight" id="valuedetails:border">
+        <property name="visible">True</property>
+        <property name="can_focus">True</property>
+      </object>
+      <packing>
+        <property name="expand">False</property>
+        <property name="fill">True</property>
+        <property name="position">1</property>
+      </packing>
+    </child>
+  </object>
+</interface>


More information about the Libreoffice-commits mailing list