[Libreoffice-commits] core.git: cui/source cui/uiconfig cui/UIConfig_cui.mk

Caolán McNamara caolanm at redhat.com
Sun Aug 4 06:48:26 PDT 2013


 cui/UIConfig_cui.mk                |    1 
 cui/source/inc/autocdlg.hxx        |   27 +++++------
 cui/source/inc/cuires.hrc          |    1 
 cui/source/inc/helpid.hrc          |    2 
 cui/source/tabpages/autocdlg.cxx   |   87 ++++++++++++++++---------------------
 cui/source/tabpages/autocdlg.hrc   |    2 
 cui/source/tabpages/autocdlg.src   |   22 ---------
 cui/uiconfig/ui/acoroptionspage.ui |   29 ++++++++++++
 8 files changed, 82 insertions(+), 89 deletions(-)

New commits:
commit 4b81079cbfe6b53fe3e1da1843d67c2358d2f257
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sun Aug 4 12:14:07 2013 +0200

    convert autocorrect options page to .ui
    
    Change-Id: If4370e300c74a543ca72f3e4b850d2f494f8d9ea

diff --git a/cui/UIConfig_cui.mk b/cui/UIConfig_cui.mk
index 27a996c..ec5667a 100644
--- a/cui/UIConfig_cui.mk
+++ b/cui/UIConfig_cui.mk
@@ -13,6 +13,7 @@ $(eval $(call gb_UIConfig_add_uifiles,cui,\
 	cui/uiconfig/ui/aboutdialog \
 	cui/uiconfig/ui/aboutconfigdialog\
 	cui/uiconfig/ui/acorexceptpage \
+	cui/uiconfig/ui/acoroptionspage \
 	cui/uiconfig/ui/acorreplacepage \
 	cui/uiconfig/ui/applyautofmtpage \
 	cui/uiconfig/ui/applylocalizedpage \
diff --git a/cui/source/inc/autocdlg.hxx b/cui/source/inc/autocdlg.hxx
index ac9966b..b53b282 100644
--- a/cui/source/inc/autocdlg.hxx
+++ b/cui/source/inc/autocdlg.hxx
@@ -94,22 +94,21 @@ class OfaAutocorrOptionsPage : public SfxTabPage
     using TabPage::ActivatePage;
 
 private:
-    SvxCheckListBox aCheckLB;
-
-    String      sInput;
-    String      sDoubleCaps;
-    String      sStartCap;
-    String      sBoldUnderline;
-    String      sURL;
-    String      sNoDblSpaces;
-    String      sDash;
-    String      sNonBrkSpace;
-    String      sFirst;
-    String      sAccidentalCaps;
+    SvxCheckListBox *m_pCheckLB;
+
+    OUString m_sInput;
+    OUString m_sDoubleCaps;
+    OUString m_sStartCap;
+    OUString m_sBoldUnderline;
+    OUString m_sURL;
+    OUString m_sNoDblSpaces;
+    OUString m_sDash;
+    OUString m_sNonBrkSpace;
+    OUString m_sFirst;
+    OUString m_sAccidentalCaps;
 
 public:
-                        OfaAutocorrOptionsPage( Window* pParent, const SfxItemSet& rSet );
-                        ~OfaAutocorrOptionsPage();
+    OfaAutocorrOptionsPage(Window* pParent, const SfxItemSet& rSet);
 
     static SfxTabPage*  Create( Window* pParent,
                                 const SfxItemSet& rAttrSet);
diff --git a/cui/source/inc/cuires.hrc b/cui/source/inc/cuires.hrc
index 7202e18..2de46b9 100644
--- a/cui/source/inc/cuires.hrc
+++ b/cui/source/inc/cuires.hrc
@@ -112,7 +112,6 @@
 
 // autocor
 #define RID_OFAPAGE_AUTOCOMPLETE_OPTIONS (RID_OFA_START + 119)
-#define RID_OFAPAGE_AUTOCORR_OPTIONS    (RID_OFA_START + 102)
 
 // options
 #define RID_SVXSTR_DIAGRAM_ROW                              (RID_SVX_START + 1162)
diff --git a/cui/source/inc/helpid.hrc b/cui/source/inc/helpid.hrc
index ef9e2e1..b0de4ee 100644
--- a/cui/source/inc/helpid.hrc
+++ b/cui/source/inc/helpid.hrc
@@ -222,14 +222,12 @@
 #define HID_SEARCHATTR "CUI_HID_SEARCHATTR"
 #define HID_SEARCHSIMILARITY "CUI_HID_SEARCHSIMILARITY"
 #define UID_SEARCH_RECORDSTATUS "CUI_UID_SEARCH_RECORDSTATUS"
-#define HID_OFAPAGE_AUTOCORR_CLB "CUI_HID_OFAPAGE_AUTOCORR_CLB"
 #define HID_TPCOLOR_RGB_1 "CUI_HID_TPCOLOR_RGB_1"
 #define HID_TPCOLOR_RGB_2 "CUI_HID_TPCOLOR_RGB_2"
 #define HID_TPCOLOR_RGB_3 "CUI_HID_TPCOLOR_RGB_3"
 #define HID_TPCOLOR_CMYK_1 "CUI_HID_TPCOLOR_CMYK_1"
 #define HID_TPCOLOR_CMYK_2 "CUI_HID_TPCOLOR_CMYK_2"
 #define HID_TPCOLOR_CMYK_3 "CUI_HID_TPCOLOR_CMYK_3"
-#define HID_OFAPAGE_AUTOCORR_OPTIONS "CUI_HID_OFAPAGE_AUTOCORR_OPTIONS"
 #define HID_OFAPAGE_AUTOCOMPLETE_OPTIONS "CUI_HID_OFAPAGE_AUTOCOMPLETE_OPTIONS"
 #define HID_PAGE_CONNECTION "CUI_HID_PAGE_CONNECTION"
 #define HID_PAGE_CONNECTION_CTL_PREVIEW "CUI_HID_PAGE_CONNECTION_CTL_PREVIEW"
diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx
index 1543113..2b57b6c 100644
--- a/cui/source/tabpages/autocdlg.cxx
+++ b/cui/source/tabpages/autocdlg.cxx
@@ -175,27 +175,18 @@ IMPL_LINK(OfaAutoCorrDlg, SelectLanguageHdl, ListBox*, pBox)
     return 0;
 }
 
-OfaAutocorrOptionsPage::OfaAutocorrOptionsPage( Window* pParent,
-                                                const SfxItemSet& rSet ) :
-    SfxTabPage(pParent, CUI_RES( RID_OFAPAGE_AUTOCORR_OPTIONS ), rSet),
-    aCheckLB            (this, CUI_RES(CLB_SETTINGS )),
-
-    sInput              (CUI_RES(RID_SVXSTR_USE_REPLACE     )),
-    sDoubleCaps         (CUI_RES(RID_SVXSTR_CPTL_STT_WORD     )),
-    sStartCap           (CUI_RES(RID_SVXSTR_CPTL_STT_SENT     )),
-    sBoldUnderline      (CUI_RES(RID_SVXSTR_BOLD_UNDER        )),
-    sURL                (CUI_RES(RID_SVXSTR_DETECT_URL        )),
-    sNoDblSpaces        (CUI_RES(RID_SVXSTR_NO_DBL_SPACES    )),
-    sDash               (CUI_RES(RID_SVXSTR_DASH              )),
-    sAccidentalCaps     (CUI_RES(RID_SVXSTR_CORRECT_ACCIDENTAL_CAPS_LOCK))
-{
-    FreeResource();
-
-    aCheckLB.SetHelpId(HID_OFAPAGE_AUTOCORR_CLB);
-}
-
-OfaAutocorrOptionsPage::~OfaAutocorrOptionsPage()
+OfaAutocorrOptionsPage::OfaAutocorrOptionsPage(Window* pParent, const SfxItemSet& rSet)
+    : SfxTabPage(pParent, "AutocorrectOptionsPage", "cui/ui/acoroptionspage.ui", rSet)
+    , m_sInput(CUI_RESSTR(RID_SVXSTR_USE_REPLACE))
+    , m_sDoubleCaps(CUI_RESSTR(RID_SVXSTR_CPTL_STT_WORD))
+    , m_sStartCap(CUI_RESSTR(RID_SVXSTR_CPTL_STT_SENT))
+    , m_sBoldUnderline(CUI_RESSTR(RID_SVXSTR_BOLD_UNDER))
+    , m_sURL(CUI_RESSTR(RID_SVXSTR_DETECT_URL))
+    , m_sNoDblSpaces(CUI_RESSTR(RID_SVXSTR_NO_DBL_SPACES))
+    , m_sDash(CUI_RESSTR(RID_SVXSTR_DASH))
+    , m_sAccidentalCaps(CUI_RESSTR(RID_SVXSTR_CORRECT_ACCIDENTAL_CAPS_LOCK))
 {
+    get(m_pCheckLB, "checklist");
 }
 
 SfxTabPage* OfaAutocorrOptionsPage::Create( Window* pParent,
@@ -210,14 +201,14 @@ sal_Bool OfaAutocorrOptionsPage::FillItemSet( SfxItemSet& )
     long nFlags = pAutoCorrect->GetFlags();
 
     sal_uInt16 nPos = 0;
-    pAutoCorrect->SetAutoCorrFlag(Autocorrect,          aCheckLB.IsChecked(nPos++));
-    pAutoCorrect->SetAutoCorrFlag(CptlSttWrd,           aCheckLB.IsChecked(nPos++));
-    pAutoCorrect->SetAutoCorrFlag(CptlSttSntnc,         aCheckLB.IsChecked(nPos++));
-    pAutoCorrect->SetAutoCorrFlag(ChgWeightUnderl,      aCheckLB.IsChecked(nPos++));
-    pAutoCorrect->SetAutoCorrFlag(SetINetAttr,          aCheckLB.IsChecked(nPos++));
-    pAutoCorrect->SetAutoCorrFlag(ChgToEnEmDash,        aCheckLB.IsChecked(nPos++));
-    pAutoCorrect->SetAutoCorrFlag(IgnoreDoubleSpace,    aCheckLB.IsChecked(nPos++));
-    pAutoCorrect->SetAutoCorrFlag(CorrectCapsLock,      aCheckLB.IsChecked(nPos++));
+    pAutoCorrect->SetAutoCorrFlag(Autocorrect,          m_pCheckLB->IsChecked(nPos++));
+    pAutoCorrect->SetAutoCorrFlag(CptlSttWrd,           m_pCheckLB->IsChecked(nPos++));
+    pAutoCorrect->SetAutoCorrFlag(CptlSttSntnc,         m_pCheckLB->IsChecked(nPos++));
+    pAutoCorrect->SetAutoCorrFlag(ChgWeightUnderl,      m_pCheckLB->IsChecked(nPos++));
+    pAutoCorrect->SetAutoCorrFlag(SetINetAttr,          m_pCheckLB->IsChecked(nPos++));
+    pAutoCorrect->SetAutoCorrFlag(ChgToEnEmDash,        m_pCheckLB->IsChecked(nPos++));
+    pAutoCorrect->SetAutoCorrFlag(IgnoreDoubleSpace,    m_pCheckLB->IsChecked(nPos++));
+    pAutoCorrect->SetAutoCorrFlag(CorrectCapsLock,      m_pCheckLB->IsChecked(nPos++));
 
     sal_Bool bReturn = nFlags != pAutoCorrect->GetFlags();
     if(bReturn )
@@ -239,29 +230,29 @@ void OfaAutocorrOptionsPage::Reset( const SfxItemSet& )
     SvxAutoCorrect* pAutoCorrect = SvxAutoCorrCfg::Get().GetAutoCorrect();
     const long nFlags = pAutoCorrect->GetFlags();
 
-    aCheckLB.SetUpdateMode(sal_False);
-    aCheckLB.Clear();
+    m_pCheckLB->SetUpdateMode(sal_False);
+    m_pCheckLB->Clear();
 
-    aCheckLB.InsertEntry(sInput);
-    aCheckLB.InsertEntry(sDoubleCaps);
-    aCheckLB.InsertEntry(sStartCap);
-    aCheckLB.InsertEntry(sBoldUnderline);
-    aCheckLB.InsertEntry(sURL);
-    aCheckLB.InsertEntry(sDash);
-    aCheckLB.InsertEntry(sNoDblSpaces);
-    aCheckLB.InsertEntry(sAccidentalCaps);
+    m_pCheckLB->InsertEntry(m_sInput);
+    m_pCheckLB->InsertEntry(m_sDoubleCaps);
+    m_pCheckLB->InsertEntry(m_sStartCap);
+    m_pCheckLB->InsertEntry(m_sBoldUnderline);
+    m_pCheckLB->InsertEntry(m_sURL);
+    m_pCheckLB->InsertEntry(m_sDash);
+    m_pCheckLB->InsertEntry(m_sNoDblSpaces);
+    m_pCheckLB->InsertEntry(m_sAccidentalCaps);
 
     sal_uInt16 nPos = 0;
-    aCheckLB.CheckEntryPos( nPos++, 0 != (nFlags & Autocorrect) );
-    aCheckLB.CheckEntryPos( nPos++, 0 != (nFlags & CptlSttWrd) );
-    aCheckLB.CheckEntryPos( nPos++, 0 != (nFlags & CptlSttSntnc) );
-    aCheckLB.CheckEntryPos( nPos++, 0 != (nFlags & ChgWeightUnderl) );
-    aCheckLB.CheckEntryPos( nPos++, 0 != (nFlags & SetINetAttr) );
-    aCheckLB.CheckEntryPos( nPos++, 0 != (nFlags & ChgToEnEmDash) );
-    aCheckLB.CheckEntryPos( nPos++, 0 != (nFlags & IgnoreDoubleSpace) );
-    aCheckLB.CheckEntryPos( nPos++, 0 != (nFlags & CorrectCapsLock) );
-
-    aCheckLB.SetUpdateMode(sal_True);
+    m_pCheckLB->CheckEntryPos( nPos++, 0 != (nFlags & Autocorrect) );
+    m_pCheckLB->CheckEntryPos( nPos++, 0 != (nFlags & CptlSttWrd) );
+    m_pCheckLB->CheckEntryPos( nPos++, 0 != (nFlags & CptlSttSntnc) );
+    m_pCheckLB->CheckEntryPos( nPos++, 0 != (nFlags & ChgWeightUnderl) );
+    m_pCheckLB->CheckEntryPos( nPos++, 0 != (nFlags & SetINetAttr) );
+    m_pCheckLB->CheckEntryPos( nPos++, 0 != (nFlags & ChgToEnEmDash) );
+    m_pCheckLB->CheckEntryPos( nPos++, 0 != (nFlags & IgnoreDoubleSpace) );
+    m_pCheckLB->CheckEntryPos( nPos++, 0 != (nFlags & CorrectCapsLock) );
+
+    m_pCheckLB->SetUpdateMode(sal_True);
 }
 
 /*********************************************************************/
diff --git a/cui/source/tabpages/autocdlg.hrc b/cui/source/tabpages/autocdlg.hrc
index fd2380f..ad13cb5 100644
--- a/cui/source/tabpages/autocdlg.hrc
+++ b/cui/source/tabpages/autocdlg.hrc
@@ -23,8 +23,6 @@
 
 // defines ------------------------------------------------------------------
 
-#define CLB_SETTINGS                    1
-
 #define ED_RIGHT_MARGIN                 100
 #define BT_OK                           101
 #define BT_CANCEL                       102
diff --git a/cui/source/tabpages/autocdlg.src b/cui/source/tabpages/autocdlg.src
index f4ea904..8d5d634 100644
--- a/cui/source/tabpages/autocdlg.src
+++ b/cui/source/tabpages/autocdlg.src
@@ -24,28 +24,6 @@
 
 /**************************************************************************/
 /*                                                                        */
-/*  Beschreibung: Autokorrektur-Optionen                                  */
-/*                                                                        */
-/**************************************************************************/
-TabPage RID_OFAPAGE_AUTOCORR_OPTIONS
-{
-    HelpId = HID_OFAPAGE_AUTOCORR_OPTIONS ;
-    OutputSize = TRUE ;
-    Size = MAP_APPFONT ( TP_WIDTH , TP_HEIGHT ) ;
-    Hide = TRUE ;
-    SVLook = TRUE ;
-    Text [ en-US ] = "Settings" ;
-    Control CLB_SETTINGS
-    {
-        Pos = MAP_APPFONT ( 6 , 6 ) ;
-        Size = MAP_APPFONT ( 248 , 173 ) ;
-        Border = TRUE ;
-        TabStop = TRUE ;
-    };
-};
-
-/**************************************************************************/
-/*                                                                        */
 /*  Beschreibung: automatische Wortergänzung                              */
 /*                                                                        */
 /**************************************************************************/
diff --git a/cui/uiconfig/ui/acoroptionspage.ui b/cui/uiconfig/ui/acoroptionspage.ui
new file mode 100644
index 0000000..b7f0906
--- /dev/null
+++ b/cui/uiconfig/ui/acoroptionspage.ui
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <!-- interface-requires gtk+ 3.0 -->
+  <!-- interface-requires LibreOffice 1.0 -->
+  <object class="GtkBox" id="AutocorrectOptionsPage">
+    <property name="visible">True</property>
+    <property name="can_focus">False</property>
+    <property name="hexpand">True</property>
+    <property name="vexpand">True</property>
+    <property name="border_width">6</property>
+    <property name="orientation">vertical</property>
+    <child>
+      <object class="svxcorelo-SvxCheckListBox" id="checklist:border">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="hexpand">True</property>
+        <property name="vexpand">True</property>
+        <child internal-child="selection">
+          <object class="GtkTreeSelection" id="Check List Box-selection1"/>
+        </child>
+      </object>
+      <packing>
+        <property name="expand">False</property>
+        <property name="fill">True</property>
+        <property name="position">0</property>
+      </packing>
+    </child>
+  </object>
+</interface>


More information about the Libreoffice-commits mailing list