sw/AllLangResTarget_sw.mk               |    2 
 sw/UIConfig_swriter.mk                  |    1 
 sw/inc/helpid.h                         |    1 
 sw/source/ui/config/optdlg.hrc          |    9 -
 sw/source/ui/config/optdlg.src          |   75 -----------
 sw/source/ui/config/optpage.cxx         |  110 ++++++++---------
 sw/source/ui/inc/optpage.hxx            |   16 +-
 sw/uiconfig/swriter/ui/optcomparison.ui |  201 ++++++++++++++++++++++++++++++++
 8 files changed, 262 insertions(+), 153 deletions(-)

New commits:
commit c99830c221cd2362d58caac15dd2fb33a2b1ad38
Author: abdulmajeed ahmed <aalabdulraz...@kacst.edu.sa>
Date:   Thu May 30 17:27:46 2013 +0200

    Convert Comparison tab page to .ui
    
    Change-Id: Ia1cd8c868de4c73ae518b2775dc568d32a15f16f

diff --git a/sw/AllLangResTarget_sw.mk b/sw/AllLangResTarget_sw.mk
index bfb95fc..3b60502 100644
--- a/sw/AllLangResTarget_sw.mk
+++ b/sw/AllLangResTarget_sw.mk
@@ -70,7 +70,7 @@ $(eval $(call gb_SrsTarget_add_files,sw/res,\
     sw/source/ui/chrdlg/paradlg.src \
     sw/source/ui/config/mailconfigpage.src \
     sw/source/ui/config/optcomp.src \
-    sw/source/ui/config/optdlg.src \
+       sw/source/ui/config/optdlg.src \
     sw/source/ui/config/optload.src \
     sw/source/ui/config/redlopt.src \
     sw/source/ui/dbui/addresslistdialog.src \
diff --git a/sw/UIConfig_swriter.mk b/sw/UIConfig_swriter.mk
index eb100cf..a01d738 100644
--- a/sw/UIConfig_swriter.mk
+++ b/sw/UIConfig_swriter.mk
@@ -94,6 +94,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\
        sw/uiconfig/swriter/ui/newuserindexdialog \
        sw/uiconfig/swriter/ui/numparapage \
        sw/uiconfig/swriter/ui/numberingnamedialog \
+       sw/uiconfig/swriter/ui/optcomparison \
        sw/uiconfig/swriter/ui/opttestpage \
        sw/uiconfig/swriter/ui/outlinenumbering \
        sw/uiconfig/swriter/ui/outlinenumberingpage \
diff --git a/sw/inc/helpid.h b/sw/inc/helpid.h
index 2fa479f..e2c2be3 100644
--- a/sw/inc/helpid.h
+++ b/sw/inc/helpid.h
@@ -193,7 +193,6 @@
 
 #define HID_OPTCOMPATIBILITY_PAGE                               
"SW_HID_OPTCOMPATIBILITY_PAGE"
 #define HID_COMPATIBILITY_OPTIONS_BOX                           
"SW_HID_COMPATIBILITY_OPTIONS_BOX"
-#define HID_COMPARISON_OPT                                                     
"SW_HID_COMPARISON_OPT"
 
 #define HID_PROPERTYPANEL_WRAP_SECTION          
"SW_HID_PROPERTYPANEL_WRAP_SECTION"
 #define HID_PROPERTYPANEL_WRAP_RB_NO_WRAP       
"SW_HID_PROPERTYPANEL_WRAP_RB_NO_WRAP"
diff --git a/sw/source/ui/config/optdlg.hrc b/sw/source/ui/config/optdlg.hrc
index 4d716c8..160b8f1 100644
--- a/sw/source/ui/config/optdlg.hrc
+++ b/sw/source/ui/config/optdlg.hrc
@@ -135,13 +135,4 @@
 #define CB_MATH_BASELINE_ALIGNMENT    16
 
 
-#define FL_CMP                                         141
-#define RB_AUTO                                                142
-#define RB_WORD                                                143
-#define RB_CHAR                                                144
-#define FL_SET                                         145
-#define CB_RSID                                                146
-#define CB_IGNORE                                      147
-#define NF_LEN                                         148
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/config/optdlg.src b/sw/source/ui/config/optdlg.src
index 889408f9..b411db0 100644
--- a/sw/source/ui/config/optdlg.src
+++ b/sw/source/ui/config/optdlg.src
@@ -641,79 +641,4 @@ StringArray STR_PRINTOPTUI
     };
 };
 
-
-/**************************************************************************/
-/*                                                                        */
-/*     TabPage Comparison                                                      
  */
-/*                                                                        */
-/**************************************************************************/
-TabPage TP_COMPARISON_OPT
-{
-    HelpID = HID_COMPARISON_OPT;
-    SVLook = TRUE ;
-    Hide = TRUE;
-    Size = MAP_APPFONT ( TP_WIDTH , TP_HEIGHT );
-    FixedLine FL_CMP
-    {
-        Pos = MAP_APPFONT ( 6 , 3 ) ;
-        Size = MAP_APPFONT ( 248 , 8 ) ;
-        Text [ en-US ] = "Compare documents";
-    };
-    RadioButton RB_AUTO
-    {
-        Pos = MAP_APPFONT ( 12 , 14 ) ;
-        Size = MAP_APPFONT ( 70 , 10 ) ;
-        Text [ en-US ] = "~Auto";
-        TabStop = TRUE ;
-        Group = TRUE ;
-    };
-    RadioButton RB_WORD
-    {
-        Pos = MAP_APPFONT ( 12 , 27 ) ;
-        Size = MAP_APPFONT ( 70 , 10 ) ;
-        Text [ en-US ] = "By ~word";
-    };
-    RadioButton RB_CHAR
-    {
-        Pos = MAP_APPFONT ( 12 , 40 ) ;
-        Size = MAP_APPFONT ( 70 , 10 ) ;
-        Text [ en-US ] = "By ~character";
-    };
-    FixedLine FL_SET
-    {
-        Pos = MAP_APPFONT ( 6 , 56 ) ;
-        Size = MAP_APPFONT ( 248 , 8 ) ;
-        Text [ en-US ] = "Settings";
-    };
-    CheckBox CB_RSID
-    {
-        Pos = MAP_APPFONT ( 12 , 69 ) ;
-        Size = MAP_APPFONT ( 70 , 10 ) ;
-        Text [ en-US ] = "Use ~RSID";
-        TabStop = TRUE ;
-        Group = TRUE ;
-    };
-    CheckBox CB_IGNORE
-    {
-        Pos = MAP_APPFONT ( 12 , 82 ) ;
-        Size = MAP_APPFONT ( 70 , 10 ) ;
-        Text [ en-US ] = "Ignore ~pieces of length";
-    };
-    NumericField NF_LEN
-    {
-        Pos = MAP_APPFONT ( 100 , 80 ) ;
-        Size = MAP_APPFONT ( 25 , 12 ) ;
-        Border = TRUE ;
-        Left = TRUE ;
-        First = 1 ;
-        Minimum = 1 ;
-        Maximum = 99;
-        Repeat = TRUE ;
-        Spin = TRUE ;
-        SpinSize = 1 ;
-        StrictFormat = TRUE ;
-        TabStop = TRUE ;
-    };
-};
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx
index 6afe7d3..79595b2 100644
--- a/sw/source/ui/config/optpage.cxx
+++ b/sw/source/ui/config/optpage.cxx
@@ -2262,24 +2262,22 @@ void 
SwRedlineOptionsTabPage::InitFontStyle(SvxFontPrevWindow& rExampleWin)
 
 //----------------------------------------------------------
 SwCompareOptionsTabPage::SwCompareOptionsTabPage(  Window* pParent, const 
SfxItemSet& rSet )
-    : SfxTabPage( pParent, SW_RES( TP_COMPARISON_OPT ), rSet ),
-
-    aComparisonFL(     this, SW_RES( FL_CMP ) ),
-    aAutoRB(           this, SW_RES( RB_AUTO ) ),
-    aWordRB(           this, SW_RES( RB_WORD ) ),
-    aCharRB(           this, SW_RES( RB_CHAR ) ),
-    aSettingsFL(       this, SW_RES( FL_SET ) ),
-    aRsidCB(           this, SW_RES( CB_RSID) ),
-    aIgnoreCB(         this, SW_RES( CB_IGNORE ) ),
-    aLenNF(                    this, SW_RES( NF_LEN ) )
+    : SfxTabPage( 
pParent,"OptComparison","modules/swriter/ui/optcomparison.ui", rSet )
 {
-    FreeResource();
+    get(m_pAutoRB,"auto");
+    get(m_pWordRB, "byword");
+    get(m_pCharRB, "bycharacter");
+
+    get(m_pRsidCB, "useRSID");
+    get(m_pIgnoreCB, "ignore");
+    get(m_pLenNF, "ignorelen");
+
     Link aLnk( LINK( this, SwCompareOptionsTabPage, ComparisonHdl ) );
-    aAutoRB.SetClickHdl( aLnk );
-    aWordRB.SetClickHdl( aLnk );
-    aCharRB.SetClickHdl( aLnk );
+    m_pAutoRB->SetClickHdl( aLnk );
+    m_pWordRB->SetClickHdl( aLnk );
+    m_pCharRB->SetClickHdl( aLnk );
 
-    aIgnoreCB.SetClickHdl( LINK( this, SwCompareOptionsTabPage, IgnoreHdl) );
+    m_pIgnoreCB->SetClickHdl( LINK( this, SwCompareOptionsTabPage, IgnoreHdl) 
);
 }
 
 SwCompareOptionsTabPage::~SwCompareOptionsTabPage()
@@ -2296,35 +2294,35 @@ sal_Bool SwCompareOptionsTabPage::FillItemSet( 
SfxItemSet& )
     sal_Bool bRet = sal_False;
     SwModuleOptions *pOpt = SW_MOD()->GetModuleConfig();
 
-    if( aAutoRB.IsChecked() != aAutoRB.GetSavedValue() ||
-        aWordRB.IsChecked() != aWordRB.GetSavedValue() ||
-        aCharRB.IsChecked() != aCharRB.GetSavedValue() )
+    if( m_pAutoRB->IsChecked() != m_pAutoRB->GetSavedValue() ||
+        m_pWordRB->IsChecked() != m_pWordRB->GetSavedValue() ||
+        m_pCharRB->IsChecked() != m_pCharRB->GetSavedValue() )
     {
         SvxCompareMode eCmpMode = SVX_CMP_AUTO;
 
-        if ( aAutoRB.IsChecked() ) eCmpMode = SVX_CMP_AUTO;
-        if ( aWordRB.IsChecked() ) eCmpMode = SVX_CMP_BY_WORD;
-        if ( aCharRB.IsChecked() ) eCmpMode = SVX_CMP_BY_CHAR;
+        if ( m_pAutoRB->IsChecked() ) eCmpMode = SVX_CMP_AUTO;
+        if ( m_pWordRB->IsChecked() ) eCmpMode = SVX_CMP_BY_WORD;
+        if ( m_pCharRB->IsChecked() ) eCmpMode = SVX_CMP_BY_CHAR;
 
         pOpt->SetCompareMode( eCmpMode );
         bRet = sal_True;
     }
 
-    if( aRsidCB.IsChecked() != aRsidCB.GetSavedValue() )
+    if( m_pRsidCB->IsChecked() != m_pRsidCB->GetSavedValue() )
     {
-        pOpt->SetUseRsid( aRsidCB.IsChecked() );
+        pOpt->SetUseRsid( m_pRsidCB->IsChecked() );
         bRet = sal_True;
     }
 
-    if( aIgnoreCB.IsChecked() != aIgnoreCB.GetSavedValue() )
+    if( m_pIgnoreCB->IsChecked() != m_pIgnoreCB->GetSavedValue() )
     {
-        pOpt->SetIgnorePieces( aIgnoreCB.IsChecked() );
+        pOpt->SetIgnorePieces( m_pIgnoreCB->IsChecked() );
         bRet = sal_True;
     }
 
-    if( aLenNF.IsModified() )
+    if( m_pLenNF->IsModified() )
     {
-        pOpt->SetPieceLen( aLenNF.GetValue() );
+        pOpt->SetPieceLen( m_pLenNF->GetValue() );
         bRet = sal_True;
     }
 
@@ -2338,58 +2336,54 @@ void SwCompareOptionsTabPage::Reset( const SfxItemSet& )
     SvxCompareMode eCmpMode = pOpt->GetCompareMode();
     if( eCmpMode == SVX_CMP_AUTO )
     {
-        aAutoRB.Check();
-        aSettingsFL.Disable();
-        aRsidCB.Disable();
-        aIgnoreCB.Disable();
-        aLenNF.Disable();
+        m_pAutoRB->Check();
+        m_pRsidCB->Disable();
+        m_pIgnoreCB->Disable();
+        m_pLenNF->Disable();
     }
     else if( eCmpMode == SVX_CMP_BY_WORD )
     {
-        aWordRB.Check();
-        aSettingsFL.Enable();
-        aRsidCB.Enable();
-        aIgnoreCB.Enable();
-        aLenNF.Enable();
+        m_pWordRB->Check();
+        m_pRsidCB->Enable();
+        m_pIgnoreCB->Enable();
+        m_pLenNF->Enable();
     }
     else if( eCmpMode == SVX_CMP_BY_CHAR)
     {
-        aCharRB.Check();
-        aSettingsFL.Enable();
-        aRsidCB.Enable();
-        aIgnoreCB.Enable();
-        aLenNF.Enable();
+        m_pCharRB->Check();
+        m_pRsidCB->Enable();
+        m_pIgnoreCB->Enable();
+        m_pLenNF->Enable();
     }
-    aAutoRB.SaveValue();
-    aWordRB.SaveValue();
-    aCharRB.SaveValue();
+    m_pAutoRB->SaveValue();
+    m_pWordRB->SaveValue();
+    m_pCharRB->SaveValue();
 
-    aRsidCB.Check( pOpt->IsUseRsid() );
-    aRsidCB.SaveValue();
+    m_pRsidCB->Check( pOpt->IsUseRsid() );
+    m_pRsidCB->SaveValue();
 
-    aIgnoreCB.Check( pOpt->IsIgnorePieces() );
-    aIgnoreCB.SaveValue();
+    m_pIgnoreCB->Check( pOpt->IsIgnorePieces() );
+    m_pIgnoreCB->SaveValue();
 
-    aLenNF.Enable( aIgnoreCB.IsChecked() && eCmpMode );
+    m_pLenNF->Enable( m_pIgnoreCB->IsChecked() && eCmpMode );
 
-    aLenNF.SetValue( pOpt->GetPieceLen() );
-    aLenNF.SaveValue();
+    m_pLenNF->SetValue( pOpt->GetPieceLen() );
+    m_pLenNF->SaveValue();
 }
 
 IMPL_LINK_NOARG(SwCompareOptionsTabPage, ComparisonHdl)
 {
-    bool bChecked = !aAutoRB.IsChecked();
-    aSettingsFL.Enable( bChecked );
-    aRsidCB.Enable( bChecked );
-    aIgnoreCB.Enable( bChecked );
-    aLenNF.Enable( bChecked && aIgnoreCB.IsChecked() );
+    bool bChecked = !m_pAutoRB->IsChecked();
+    m_pRsidCB->Enable( bChecked );
+    m_pIgnoreCB->Enable( bChecked );
+    m_pLenNF->Enable( bChecked && m_pIgnoreCB->IsChecked() );
 
     return 0;
 }
 
 IMPL_LINK_NOARG(SwCompareOptionsTabPage, IgnoreHdl)
 {
-    aLenNF.Enable( aIgnoreCB.IsChecked() );
+    m_pLenNF->Enable( m_pIgnoreCB->IsChecked() );
     return 0;
 }
 
diff --git a/sw/source/ui/inc/optpage.hxx b/sw/source/ui/inc/optpage.hxx
index e61c847..bf4166a 100644
--- a/sw/source/ui/inc/optpage.hxx
+++ b/sw/source/ui/inc/optpage.hxx
@@ -462,15 +462,13 @@ private:
 
 class SwCompareOptionsTabPage : public SfxTabPage
 {
-    FixedLine aComparisonFL;
-    RadioButton aAutoRB;
-    RadioButton aWordRB;
-    RadioButton aCharRB;
-
-    FixedLine aSettingsFL;
-    CheckBox aRsidCB;
-    CheckBox aIgnoreCB;
-    NumericField aLenNF;
+    RadioButton*  m_pAutoRB;
+    RadioButton*  m_pWordRB;
+    RadioButton*  m_pCharRB;
+
+    CheckBox*     m_pRsidCB;
+    CheckBox*     m_pIgnoreCB;
+    NumericField* m_pLenNF;
 
     SwCompareOptionsTabPage( Window* pParent, const SfxItemSet& rSet );
     ~SwCompareOptionsTabPage();
diff --git a/sw/uiconfig/swriter/ui/optcomparison.ui 
b/sw/uiconfig/swriter/ui/optcomparison.ui
new file mode 100644
index 0000000..5a9168c
--- /dev/null
+++ b/sw/uiconfig/swriter/ui/optcomparison.ui
@@ -0,0 +1,201 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <!-- interface-requires gtk+ 3.0 -->
+<object class="GtkAdjustment" id="adjustment1">
+    <property name="lower">1</property>
+    <property name="upper">99</property>
+    <property name="value">1</property>
+    <property name="step_increment">1</property>
+    <property name="page_increment">10</property>
+  </object>
+  <object class="GtkBox" id="OptComparison">
+    <property name="visible">True</property>
+    <property name="can_focus">False</property>
+    <property name="border_width">6</property>
+    <property name="orientation">vertical</property>
+    <property name="spacing">12</property>
+    <child>
+      <object class="GtkFrame" id="frame1">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="label_xalign">0</property>
+        <property name="shadow_type">none</property>
+        <child>
+          <object class="GtkAlignment" id="alignment1">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="top_padding">5</property>
+            <property name="left_padding">12</property>
+            <child>
+              <object class="GtkGrid" id="grid1">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="row_spacing">6</property>
+                <property name="column_homogeneous">True</property>
+                <child>
+                  <object class="GtkRadioButton" id="auto">
+                    <property name="label" translatable="yes">A_uto</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">False</property>
+                    <property name="use_underline">True</property>
+                    <property name="xalign">0</property>
+                    <property name="active">True</property>
+                    <property name="draw_indicator">True</property>
+                    <property name="group">byword</property>
+                  </object>
+                  <packing>
+                    <property name="left_attach">0</property>
+                    <property name="top_attach">0</property>
+                    <property name="width">1</property>
+                    <property name="height">1</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkRadioButton" id="byword">
+                    <property name="label" translatable="yes">By 
w_ord</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">False</property>
+                    <property name="use_underline">True</property>
+                    <property name="xalign">0</property>
+                    <property name="draw_indicator">True</property>
+                    <property name="group">bycharacter</property>
+                  </object>
+                  <packing>
+                    <property name="left_attach">0</property>
+                    <property name="top_attach">1</property>
+                    <property name="width">1</property>
+                    <property name="height">1</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkRadioButton" id="bycharacter">
+                    <property name="label" translatable="yes">By 
_character</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">False</property>
+                    <property name="xalign">0</property>
+                    <property name="draw_indicator">True</property>
+                  </object>
+                  <packing>
+                    <property name="left_attach">0</property>
+                    <property name="top_attach">2</property>
+                    <property name="width">1</property>
+                    <property name="height">1</property>
+                  </packing>
+                </child>
+              </object>
+            </child>
+          </object>
+        </child>
+        <child type="label">
+          <object class="GtkLabel" id="label1">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="label" translatable="yes">Compare 
documents</property>
+            <attributes>
+              <attribute name="weight" value="semibold"/>
+            </attributes>
+          </object>
+        </child>
+      </object>
+      <packing>
+        <property name="expand">False</property>
+        <property name="fill">True</property>
+        <property name="position">0</property>
+      </packing>
+    </child>
+    <child>
+      <object class="GtkFrame" id="frame2">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="label_xalign">0</property>
+        <property name="shadow_type">none</property>
+        <child>
+          <object class="GtkAlignment" id="alignment2">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="top_padding">6</property>
+            <property name="left_padding">12</property>
+            <child>
+              <object class="GtkGrid" id="grid2">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="row_spacing">6</property>
+                <child>
+                  <object class="GtkCheckButton" id="ignore">
+                    <property name="label" translatable="yes">Ignore _pieces 
of lengthAsian</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">False</property>
+                    <property name="use_underline">True</property>
+                    <property name="xalign">0</property>
+                    <property name="draw_indicator">True</property>
+                  </object>
+                  <packing>
+                    <property name="left_attach">0</property>
+                    <property name="top_attach">1</property>
+                    <property name="width">1</property>
+                    <property name="height">1</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkCheckButton" id="useRSID">
+                    <property name="label" translatable="yes">Use 
_RSID</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">False</property>
+                    <property name="use_underline">True</property>
+                    <property name="xalign">0</property>
+                    <property name="image_position">right</property>
+                    <property name="draw_indicator">True</property>
+                  </object>
+                  <packing>
+                    <property name="left_attach">0</property>
+                    <property name="top_attach">0</property>
+                    <property name="width">1</property>
+                    <property name="height">1</property>
+                  </packing>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <object class="GtkSpinButton" id="ignorelen">
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="invisible_char">•</property>
+                    <property name="invisible_char_set">True</property>
+                    <property name="adjustment">adjustment1</property>
+                  </object>
+                  <packing>
+                    <property name="left_attach">1</property>
+                    <property name="top_attach">1</property>
+                    <property name="width">1</property>
+                    <property name="height">1</property>
+                  </packing>
+                </child>
+              </object>
+            </child>
+          </object>
+        </child>
+        <child type="label">
+          <object class="GtkLabel" id="setting">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="label" translatable="yes">Settings</property>
+            <attributes>
+              <attribute name="weight" value="semibold"/>
+            </attributes>
+          </object>
+        </child>
+      </object>
+      <packing>
+        <property name="expand">False</property>
+        <property name="fill">True</property>
+        <property name="position">1</property>
+      </packing>
+    </child>
+  </object>
+</interface>
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to