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

Caolán McNamara caolanm at redhat.com
Tue May 15 10:46:52 UTC 2018


 sc/source/ui/inc/crdlg.hxx             |   20 ++++++----------
 sc/source/ui/miscdlgs/crdlg.cxx        |   39 +++++++++------------------------
 sc/source/ui/optdlg/tpusrlst.cxx       |    3 +-
 sc/uiconfig/scalc/ui/colorrowdialog.ui |    9 +++++--
 4 files changed, 28 insertions(+), 43 deletions(-)

New commits:
commit f7048e9b792c0123318f1133bafa030d688e10d7
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue May 15 09:28:26 2018 +0100

    weld ScColOrRowDlg
    
    Change-Id: I475974fc54910da88064779ceae6586bd71a3865
    Reviewed-on: https://gerrit.libreoffice.org/54356
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sc/source/ui/inc/crdlg.hxx b/sc/source/ui/inc/crdlg.hxx
index faf4e4b11037..daea06afd699 100644
--- a/sc/source/ui/inc/crdlg.hxx
+++ b/sc/source/ui/inc/crdlg.hxx
@@ -20,25 +20,21 @@
 #ifndef INCLUDED_SC_SOURCE_UI_INC_CRDLG_HXX
 #define INCLUDED_SC_SOURCE_UI_INC_CRDLG_HXX
 
-#include <vcl/dialog.hxx>
-#include <vcl/button.hxx>
-#include <vcl/layout.hxx>
+#include <vcl/weld.hxx>
 #include "scui_def.hxx"
 
-class ScColOrRowDlg : public ModalDialog
+class ScColOrRowDlg : public weld::GenericDialogController
 {
 public:
-    ScColOrRowDlg(vcl::Window* pParent, const OUString& rStrTitle,
-        const OUString& rStrLabel);
+    ScColOrRowDlg(weld::Window* pParent, const OUString& rStrTitle, const OUString& rStrLabel);
     virtual ~ScColOrRowDlg() override;
-    virtual void dispose() override;
 private:
-    VclPtr<VclFrame>       m_pFrame;
-    VclPtr<RadioButton>    m_pBtnRows;
-    VclPtr<RadioButton>    m_pBtnCols;
-    VclPtr<OKButton>       m_pBtnOk;
+    std::unique_ptr<weld::Frame> m_xFrame;
+    std::unique_ptr<weld::RadioButton> m_xBtnRows;
+    std::unique_ptr<weld::RadioButton> m_xBtnCols;
+    std::unique_ptr<weld::Button> m_xBtnOk;
 
-    DECL_LINK(OkHdl, Button*, void);
+    DECL_LINK(OkHdl, weld::Button&, void);
 };
 
 #endif
diff --git a/sc/source/ui/miscdlgs/crdlg.cxx b/sc/source/ui/miscdlgs/crdlg.cxx
index 3ca8726c2895..4764075697a4 100644
--- a/sc/source/ui/miscdlgs/crdlg.cxx
+++ b/sc/source/ui/miscdlgs/crdlg.cxx
@@ -21,42 +21,25 @@
 
 #include <crdlg.hxx>
 
-ScColOrRowDlg::ScColOrRowDlg(vcl::Window* pParent, const OUString& rStrTitle,
-    const OUString& rStrLabel)
-    : ModalDialog(pParent, "ColOrRowDialog",
-        "modules/scalc/ui/colorrowdialog.ui")
+ScColOrRowDlg::ScColOrRowDlg(weld::Window* pParent, const OUString& rStrTitle, const OUString& rStrLabel)
+    : GenericDialogController(pParent, "modules/scalc/ui/colorrowdialog.ui", "ColOrRowDialog")
+    , m_xFrame(m_xBuilder->weld_frame("frame"))
+    , m_xBtnRows(m_xBuilder->weld_radio_button("rows"))
+    , m_xBtnCols(m_xBuilder->weld_radio_button("columns"))
+    , m_xBtnOk(m_xBuilder->weld_button("ok"))
 {
-    get(m_pBtnOk, "ok");
-    get(m_pBtnCols, "columns");
-    get(m_pBtnRows, "rows");
-    get(m_pFrame, "frame");
-
-    SetText(rStrTitle);
-    m_pFrame->set_label(rStrLabel);
-
-    m_pBtnCols->Check();
-
-    m_pBtnOk->SetClickHdl( LINK( this, ScColOrRowDlg, OkHdl ) );
+    m_xDialog->set_title(rStrTitle);
+    m_xFrame->set_label(rStrLabel);
+    m_xBtnOk->connect_clicked(LINK(this, ScColOrRowDlg, OkHdl));
 }
 
 ScColOrRowDlg::~ScColOrRowDlg()
 {
-    disposeOnce();
 }
 
-void ScColOrRowDlg::dispose()
-{
-    m_pFrame.clear();
-    m_pBtnRows.clear();
-    m_pBtnCols.clear();
-    m_pBtnOk.clear();
-    ModalDialog::dispose();
-}
-
-
-IMPL_LINK_NOARG(ScColOrRowDlg, OkHdl, Button*, void)
+IMPL_LINK_NOARG(ScColOrRowDlg, OkHdl, weld::Button&, void)
 {
-    EndDialog( m_pBtnCols->IsChecked() ? SCRET_COLS : SCRET_ROWS );
+    m_xDialog->response(m_xBtnCols->get_active() ? SCRET_COLS : SCRET_ROWS);
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/optdlg/tpusrlst.cxx b/sc/source/ui/optdlg/tpusrlst.cxx
index 3bd623bc7d43..5f7734c483f6 100644
--- a/sc/source/ui/optdlg/tpusrlst.cxx
+++ b/sc/source/ui/optdlg/tpusrlst.cxx
@@ -357,7 +357,8 @@ void ScTpUserLists::CopyListFromArea( const ScRefAddress& rStartPos,
 
     if ( (nStartCol != nEndCol) && (nStartRow != nEndRow) )
     {
-        nCellDir = ScopedVclPtrInstance<ScColOrRowDlg>(this, aStrCopyList, aStrCopyFrom)->Execute();
+        ScColOrRowDlg aDialog(GetFrameWeld(), aStrCopyList, aStrCopyFrom);
+        nCellDir = aDialog.run();
     }
     else if ( nStartCol != nEndCol )
         nCellDir = SCRET_ROWS;
diff --git a/sc/uiconfig/scalc/ui/colorrowdialog.ui b/sc/uiconfig/scalc/ui/colorrowdialog.ui
index ad1e0ceb9c64..bfe948ff3304 100644
--- a/sc/uiconfig/scalc/ui/colorrowdialog.ui
+++ b/sc/uiconfig/scalc/ui/colorrowdialog.ui
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.18.3 -->
+<!-- Generated with glade 3.22.1 -->
 <interface domain="sc">
   <requires lib="gtk+" version="3.18"/>
   <object class="GtkDialog" id="ColOrRowDialog">
@@ -7,7 +7,13 @@
     <property name="border_width">6</property>
     <property name="title" translatable="yes" context="colorrowdialog|ColOrRowDialog">Copy List</property>
     <property name="resizable">False</property>
+    <property name="modal">True</property>
+    <property name="default_width">0</property>
+    <property name="default_height">0</property>
     <property name="type_hint">dialog</property>
+    <child>
+      <placeholder/>
+    </child>
     <child internal-child="vbox">
       <object class="GtkBox" id="dialog-vbox1">
         <property name="can_focus">False</property>
@@ -98,7 +104,6 @@
                         <property name="xalign">0</property>
                         <property name="active">True</property>
                         <property name="draw_indicator">True</property>
-                        <property name="group">rows</property>
                       </object>
                       <packing>
                         <property name="expand">False</property>


More information about the Libreoffice-commits mailing list