[Libreoffice-commits] core.git: sc/inc sc/source sc/uiconfig sc/UIConfig_scalc.mk

Caolán McNamara caolanm at redhat.com
Wed Oct 23 02:44:24 PDT 2013


 sc/UIConfig_scalc.mk                      |    1 
 sc/inc/sc.hrc                             |    2 
 sc/inc/scabstdlg.hxx                      |    5 -
 sc/source/ui/attrdlg/scdlgfact.cxx        |   26 +-----
 sc/source/ui/attrdlg/scdlgfact.hxx        |    5 -
 sc/source/ui/inc/miscdlgs.hrc             |    1 
 sc/source/ui/inc/strindlg.hxx             |   29 +++----
 sc/source/ui/miscdlgs/scuiautofmt.cxx     |    4 -
 sc/source/ui/miscdlgs/strindlg.cxx        |   43 ++--------
 sc/source/ui/src/miscdlgs.src             |   42 ----------
 sc/source/ui/view/tabvwshf.cxx            |    4 -
 sc/uiconfig/scalc/ui/inputstringdialog.ui |  118 ++++++++++++++++++++++++++++++
 12 files changed, 155 insertions(+), 125 deletions(-)

New commits:
commit 05ef22774ac842ffff96eeec3a3cdcfa3c292d2f
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Oct 23 09:53:02 2013 +0100

    convert input string dialog to .ui
    
    Change-Id: I2d40924e77f075024aed54548ffda8a162f7af91

diff --git a/sc/UIConfig_scalc.mk b/sc/UIConfig_scalc.mk
index 2945a5c..2bbaf3a 100644
--- a/sc/UIConfig_scalc.mk
+++ b/sc/UIConfig_scalc.mk
@@ -82,6 +82,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/scalc,\
 	sc/uiconfig/scalc/ui/headerdialog \
 	sc/uiconfig/scalc/ui/headerfootercontent \
 	sc/uiconfig/scalc/ui/headerfooterdialog \
+	sc/uiconfig/scalc/ui/inputstringdialog \
 	sc/uiconfig/scalc/ui/insertcells \
 	sc/uiconfig/scalc/ui/insertname \
 	sc/uiconfig/scalc/ui/insertsheet \
diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc
index ba125eb..7e945b6 100644
--- a/sc/inc/sc.hrc
+++ b/sc/inc/sc.hrc
@@ -987,7 +987,7 @@
 
 #define RID_SCDLG_INSCONT       (SC_DIALOGS_START + 14)
 
-#define RID_SCDLG_STRINPUT      (SC_DIALOGS_START + 16)
+
 #define RID_SCDLG_MTRINPUT      (SC_DIALOGS_START + 17)
 #define RID_SCDLG_SELENTRY      (SC_DIALOGS_START + 18)
 #define RID_SCDLG_AUTOFORMAT    (SC_DIALOGS_START + 20)
diff --git a/sc/inc/scabstdlg.hxx b/sc/inc/scabstdlg.hxx
index d5f6876..cdd08eb 100644
--- a/sc/inc/scabstdlg.hxx
+++ b/sc/inc/scabstdlg.hxx
@@ -299,7 +299,7 @@ class AbstractScSortWarningDlg : public VclAbstractDialog
 class AbstractScStringInputDlg :  public VclAbstractDialog
 {
 public:
-    virtual void GetInputString( OUString& rString ) const = 0;
+    virtual OUString GetInputString() const = 0;
 };
 
 class AbstractScTabBgColorDlg : public VclAbstractDialog
@@ -458,8 +458,7 @@ public:
                                                                 const OUString& rTitle,
                                                                 const OUString& rEditTitle,
                                                                 const OUString& rDefault,
-                                                                const OString& sHelpId, const OString& sEditHelpId,
-                                                                int nId ) = 0;
+                                                                const OString& sHelpId, const OString& sEditHelpId ) = 0;
 
     virtual AbstractScTabBgColorDlg * CreateScTabBgColorDlg (  Window* pParent,
                                                                 const OUString& rTitle, //Dialog Title
diff --git a/sc/source/ui/attrdlg/scdlgfact.cxx b/sc/source/ui/attrdlg/scdlgfact.cxx
index ba7817c..c779526 100644
--- a/sc/source/ui/attrdlg/scdlgfact.cxx
+++ b/sc/source/ui/attrdlg/scdlgfact.cxx
@@ -572,14 +572,14 @@ sal_uInt16  AbstractScShowTabDlg_Impl::GetSelectEntryPos(sal_uInt16 nPos) const
     return pDlg->GetSelectEntryPos( nPos);
 }
 
-OUString   AbstractScShowTabDlg_Impl::GetSelectEntry(sal_uInt16 nPos) const
+OUString AbstractScShowTabDlg_Impl::GetSelectEntry(sal_uInt16 nPos) const
 {
-        return pDlg->GetSelectEntry(nPos);
+    return pDlg->GetSelectEntry(nPos);
 }
 
-void AbstractScStringInputDlg_Impl::GetInputString( OUString& rString ) const
+OUString AbstractScStringInputDlg_Impl::GetInputString() const
 {
-    pDlg->GetInputString( rString );
+    return pDlg->GetInputString();
 }
 
 void AbstractScTabBgColorDlg_Impl::GetSelectedColor( Color& rColor ) const
@@ -1025,22 +1025,10 @@ AbstractScStringInputDlg * ScAbstractDialogFactory_Impl::CreateScStringInputDlg
                                                                 const OUString& rTitle,
                                                                 const OUString& rEditTitle,
                                                                 const OUString& rDefault,
-                                                                const OString& sHelpId, const OString& sEditHelpId,
-                                                                int nId )
+                                                                const OString& sHelpId, const OString& sEditHelpId )
 {
-    ScStringInputDlg * pDlg=NULL;
-    switch ( nId )
-    {
-        case RID_SCDLG_STRINPUT :
-            pDlg = new ScStringInputDlg( pParent, rTitle, rEditTitle, rDefault, sHelpId, sEditHelpId );
-            break;
-        default:
-            break;
-    }
-
-    if ( pDlg )
-        return new AbstractScStringInputDlg_Impl( pDlg );
-    return 0;
+    ScStringInputDlg *pDlg = new ScStringInputDlg( pParent, rTitle, rEditTitle, rDefault, sHelpId, sEditHelpId );
+    return new AbstractScStringInputDlg_Impl( pDlg );
 }
 
 AbstractScTabBgColorDlg * ScAbstractDialogFactory_Impl::CreateScTabBgColorDlg (
diff --git a/sc/source/ui/attrdlg/scdlgfact.hxx b/sc/source/ui/attrdlg/scdlgfact.hxx
index 5dc7607..07cc577 100644
--- a/sc/source/ui/attrdlg/scdlgfact.hxx
+++ b/sc/source/ui/attrdlg/scdlgfact.hxx
@@ -352,7 +352,7 @@ class AbstractScSortWarningDlg_Impl : public AbstractScSortWarningDlg
 class AbstractScStringInputDlg_Impl :  public AbstractScStringInputDlg
 {
     DECL_ABSTDLG_BASE( AbstractScStringInputDlg_Impl, ScStringInputDlg )
-    virtual void GetInputString( OUString& rString ) const;
+    virtual OUString GetInputString() const;
 };
 
 class AbstractScTabBgColorDlg_Impl :  public AbstractScTabBgColorDlg
@@ -527,8 +527,7 @@ public:
                                                                 const OUString& rTitle,
                                                                 const OUString& rEditTitle,
                                                                 const OUString& rDefault,
-                                                                const OString& sHelpId, const OString& sEditHelpId,
-                                                                int nId );
+                                                                const OString& sHelpId, const OString& sEditHelpId );
 
     virtual AbstractScTabBgColorDlg * CreateScTabBgColorDlg (  Window* pParent,
                                                                 const OUString& rTitle, //Dialog Title
diff --git a/sc/source/ui/inc/miscdlgs.hrc b/sc/source/ui/inc/miscdlgs.hrc
index ae49e07..70766c4 100644
--- a/sc/source/ui/inc/miscdlgs.hrc
+++ b/sc/source/ui/inc/miscdlgs.hrc
@@ -20,7 +20,6 @@
 #include "sc.hrc"
                     // -> RID_SCDLG_INSCONT
                     // -> RID_SCDLG_MOVETAB
-                    // -> RID_SCDLG_STRINPUT
                     // -> RID_SCDLG_MTRINPUT
                     // -> RID_SCDLG_SELENTRY
                     // -> RID_SCDLG_FILLSERIES
diff --git a/sc/source/ui/inc/strindlg.hxx b/sc/source/ui/inc/strindlg.hxx
index b5673db..2fd1aa1 100644
--- a/sc/source/ui/inc/strindlg.hxx
+++ b/sc/source/ui/inc/strindlg.hxx
@@ -20,32 +20,27 @@
 #ifndef SC_STRINDLG_HXX
 #define SC_STRINDLG_HXX
 
-
 #include <vcl/dialog.hxx>
-#include <vcl/fixed.hxx>
-#include <vcl/button.hxx>
 #include <vcl/edit.hxx>
-
-//------------------------------------------------------------------------
+#include <vcl/fixed.hxx>
 
 class ScStringInputDlg : public ModalDialog
 {
 public:
-            ScStringInputDlg(     Window* pParent,
-                            const OUString& rTitle,
-                            const OUString& rEditTitle,
-                            const OUString& rDefault,
-                            const OString& sHelpId, const OString& sEditHelpId );
-            ~ScStringInputDlg();
+    ScStringInputDlg(Window* pParent,
+        const OUString& rTitle,
+        const OUString& rEditTitle,
+        const OUString& rDefault,
+        const OString& sHelpId, const OString& sEditHelpId);
 
-    void GetInputString( OUString& rString ) const;
+    OUString GetInputString() const
+    {
+        return m_pEdInput->GetText();
+    }
 
 private:
-    FixedText       aFtEditTitle;
-    Edit            aEdInput;
-    OKButton        aBtnOk;
-    CancelButton    aBtnCancel;
-    HelpButton      aBtnHelp;
+    FixedText* m_pFtEditTitle;
+    Edit*      m_pEdInput;
 };
 
 #endif // SC_STRINDLG_HXX
diff --git a/sc/source/ui/miscdlgs/scuiautofmt.cxx b/sc/source/ui/miscdlgs/scuiautofmt.cxx
index 71490f2..7a2fbbd 100644
--- a/sc/source/ui/miscdlgs/scuiautofmt.cxx
+++ b/sc/source/ui/miscdlgs/scuiautofmt.cxx
@@ -249,7 +249,7 @@ IMPL_LINK_NOARG(ScAutoFormatDlg, AddHdl)
 
             if ( pDlg->Execute() == RET_OK )
             {
-                pDlg->GetInputString( aFormatName );
+                aFormatName = pDlg->GetInputString();
 
                 if ( !aFormatName.isEmpty() && !aFormatName.equals(aStrStandard) )
                 {
@@ -359,7 +359,7 @@ IMPL_LINK_NOARG(ScAutoFormatDlg, RenameHdl)
         if( pDlg->Execute() == RET_OK )
         {
             bool bFmtRenamed = false;
-            pDlg->GetInputString( aFormatName );
+            aFormatName = pDlg->GetInputString();
 
             if (!aFormatName.isEmpty())
             {
diff --git a/sc/source/ui/miscdlgs/strindlg.cxx b/sc/source/ui/miscdlgs/strindlg.cxx
index e621fdb..ae04d4b 100644
--- a/sc/source/ui/miscdlgs/strindlg.cxx
+++ b/sc/source/ui/miscdlgs/strindlg.cxx
@@ -17,53 +17,26 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-
 #undef SC_DLLIMPLEMENTATION
 
-
-
-//------------------------------------------------------------------
-
 #include "strindlg.hxx"
 #include "scresid.hxx"
-#include "miscdlgs.hrc"
-
-//==================================================================
 
 ScStringInputDlg::ScStringInputDlg( Window*         pParent,
                                     const OUString&   rTitle,
                                     const OUString&   rEditTitle,
                                     const OUString&   rDefault,
-                                    const OString& sHelpId, const OString& sEditHelpId    ) :
-    ModalDialog     ( pParent, ScResId( RID_SCDLG_STRINPUT ) ),
-    //
-    aFtEditTitle    ( this, ScResId( FT_LABEL ) ),
-    aEdInput        ( this, ScResId( ED_INPUT ) ),
-    aBtnOk          ( this, ScResId( BTN_OK ) ),
-    aBtnCancel      ( this, ScResId( BTN_CANCEL ) ),
-    aBtnHelp        ( this, ScResId( BTN_HELP ) )
+                                    const OString& sHelpId, const OString& sEditHelpId )
+    : ModalDialog(pParent, "InputStringDialog", "modules/scalc/ui/inputstringdialog.ui")
 {
     SetHelpId( sHelpId );
     SetText( rTitle );
-    aFtEditTitle.SetText( rEditTitle );
-    aEdInput.SetText( rDefault );
-    aEdInput.SetSelection(Selection(SELECTION_MIN, SELECTION_MAX));
-    aEdInput.SetHelpId( sEditHelpId );
-    //-------------
-    FreeResource();
-}
-
-//------------------------------------------------------------------------
-
-void ScStringInputDlg::GetInputString( OUString& rString ) const
-{
-    rString = aEdInput.GetText();
+    get(m_pFtEditTitle, "description_label");
+    m_pFtEditTitle->SetText(rEditTitle);
+    get(m_pEdInput, "name_entry");
+    m_pEdInput->SetText( rDefault );
+    m_pEdInput->SetSelection(Selection(SELECTION_MIN, SELECTION_MAX));
+    m_pEdInput->SetHelpId( sEditHelpId );
 }
 
-ScStringInputDlg::~ScStringInputDlg()
-{
-}
-
-
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/src/miscdlgs.src b/sc/source/ui/src/miscdlgs.src
index ad18772..caf1eb2 100644
--- a/sc/source/ui/src/miscdlgs.src
+++ b/sc/source/ui/src/miscdlgs.src
@@ -224,48 +224,6 @@ ModalDialog RID_SCDLG_INSCONT
     };
 };
 
-ModalDialog RID_SCDLG_STRINPUT
-{
-    HelpID = "sc:ModalDialog:RID_SCDLG_STRINPUT";
-    OutputSize = TRUE ;
-    SVLook = TRUE ;
-    Size = MAP_APPFONT ( 178 , 63 ) ;
-    Moveable = TRUE ;
-    Closeable = FALSE ;
-    OKButton BTN_OK
-    {
-        Pos = MAP_APPFONT ( 122 , 6 ) ;
-        Size = MAP_APPFONT ( 50 , 14 ) ;
-        TabStop = TRUE ;
-        DefButton = TRUE ;
-    };
-    CancelButton BTN_CANCEL
-    {
-        Pos = MAP_APPFONT ( 122 , 23 ) ;
-        Size = MAP_APPFONT ( 50 , 14 ) ;
-        TabStop = TRUE ;
-    };
-    HelpButton BTN_HELP
-    {
-        Pos = MAP_APPFONT ( 122 , 43 ) ;
-        Size = MAP_APPFONT ( 50 , 14 ) ;
-        TabStop = TRUE ;
-    };
-    Edit ED_INPUT
-    {
-        HelpID = "sc:Edit:RID_SCDLG_STRINPUT:ED_INPUT";
-        Border = TRUE ;
-        Pos = MAP_APPFONT ( 6 , 17 ) ;
-        Size = MAP_APPFONT ( 110 , 12 ) ;
-        TabStop = TRUE ;
-    };
-    FixedText FT_LABEL
-    {
-        Pos = MAP_APPFONT ( 6 , 6 ) ;
-        Size = MAP_APPFONT ( 110 , 8 ) ;
-    };
-};
-
 ModalDialog RID_SCDLG_TAB_BG_COLOR
 {
     HelpID = "sc:ModalDialog:RID_SCDLG_TAB_BG_COLOR";
diff --git a/sc/source/ui/view/tabvwshf.cxx b/sc/source/ui/view/tabvwshf.cxx
index d8fcbaf..18ab0c7 100644
--- a/sc/source/ui/view/tabvwshf.cxx
+++ b/sc/source/ui/view/tabvwshf.cxx
@@ -377,7 +377,7 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
                     AbstractScStringInputDlg* pDlg = pFact->CreateScStringInputDlg(
                         GetDialogParent(), aDlgTitle, OUString(ScResId(SCSTR_NAME)),
                         aName, GetStaticInterface()->GetSlot(nSlot)->GetCommand(),
-                        pHelpId, RID_SCDLG_STRINPUT);
+                        pHelpId);
 
                     OSL_ENSURE(pDlg, "Dialog create fail!");
 
@@ -387,7 +387,7 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
 
                         if ( nRet == RET_OK )
                         {
-                            pDlg->GetInputString( aName );
+                            aName = pDlg->GetInputString();
 
 
                             switch ( nSlot )
diff --git a/sc/uiconfig/scalc/ui/inputstringdialog.ui b/sc/uiconfig/scalc/ui/inputstringdialog.ui
new file mode 100644
index 0000000..2d48deb
--- /dev/null
+++ b/sc/uiconfig/scalc/ui/inputstringdialog.ui
@@ -0,0 +1,118 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <!-- interface-requires gtk+ 3.0 -->
+  <object class="GtkDialog" id="InputStringDialog">
+    <property name="can_focus">False</property>
+    <property name="border_width">6</property>
+    <property name="type_hint">dialog</property>
+    <child internal-child="vbox">
+      <object class="GtkBox" id="dialog-vbox1">
+        <property name="can_focus">False</property>
+        <property name="orientation">vertical</property>
+        <property name="spacing">12</property>
+        <child internal-child="action_area">
+          <object class="GtkButtonBox" id="dialog-action_area1">
+            <property name="can_focus">False</property>
+            <property name="layout_style">end</property>
+            <child>
+              <object class="GtkButton" id="ok">
+                <property name="label">gtk-ok</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="can_default">True</property>
+                <property name="has_default">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="cancel">
+                <property name="label">gtk-cancel</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="help">
+                <property name="label">gtk-help</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">2</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="pack_type">end</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkBox" id="box1">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="orientation">vertical</property>
+            <property name="spacing">6</property>
+            <child>
+              <object class="GtkLabel" id="description_label">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="xalign">0</property>
+                <property name="use_underline">True</property>
+                <property name="wrap">True</property>
+                <property name="mnemonic_widget">name_entry</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkEntry" id="name_entry">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="invisible_char">•</property>
+                <property name="width_chars">24</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">True</property>
+            <property name="fill">True</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+    <action-widgets>
+      <action-widget response="0">ok</action-widget>
+      <action-widget response="0">cancel</action-widget>
+      <action-widget response="0">help</action-widget>
+    </action-widgets>
+  </object>
+</interface>


More information about the Libreoffice-commits mailing list