[Libreoffice-commits] core.git: sc/inc sc/source sc/uiconfig
Caolán McNamara
caolanm at redhat.com
Mon Apr 30 13:00:03 UTC 2018
sc/inc/scabstdlg.hxx | 3 --
sc/source/ui/attrdlg/scdlgfact.cxx | 14 +++++++-----
sc/source/ui/attrdlg/scdlgfact.hxx | 11 +++++++---
sc/source/ui/inc/groupdlg.hxx | 13 ++++-------
sc/source/ui/miscdlgs/groupdlg.cxx | 37 ++++++++++++----------------------
sc/source/ui/view/cellsh1.cxx | 4 +--
sc/uiconfig/scalc/ui/groupdialog.ui | 12 +++++++----
sc/uiconfig/scalc/ui/ungroupdialog.ui | 12 +++++++----
8 files changed, 54 insertions(+), 52 deletions(-)
New commits:
commit 7c112da22428ea56045f24911854a5569bd851df
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Apr 30 12:06:43 2018 +0100
weld ScGroupDlg
Change-Id: If62c664dbc068bde3fee552aabe35243eeb28a47
Reviewed-on: https://gerrit.libreoffice.org/53659
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/inc/scabstdlg.hxx b/sc/inc/scabstdlg.hxx
index dc4e89043bf6..9e097aef5aa2 100644
--- a/sc/inc/scabstdlg.hxx
+++ b/sc/inc/scabstdlg.hxx
@@ -440,8 +440,7 @@ public:
double fMax,
sal_uInt16 nPossDir) = 0;
- virtual VclPtr<AbstractScGroupDlg> CreateAbstractScGroupDlg( vcl::Window* pParent,
- bool bUnGroup = false ) = 0;
+ virtual VclPtr<AbstractScGroupDlg> CreateAbstractScGroupDlg(weld::Window* pParent, bool bUnGroup = false) = 0;
virtual VclPtr<AbstractScInsertCellDlg> CreateScInsertCellDlg(weld::Window* pParent,
bool bDisallowCellMove) = 0;
diff --git a/sc/source/ui/attrdlg/scdlgfact.cxx b/sc/source/ui/attrdlg/scdlgfact.cxx
index f8d4b8f0d542..1d3d3d10f1f9 100644
--- a/sc/source/ui/attrdlg/scdlgfact.cxx
+++ b/sc/source/ui/attrdlg/scdlgfact.cxx
@@ -97,7 +97,11 @@ short AbstractScDeleteContentsDlg_Impl::Execute()
}
IMPL_ABSTDLG_BASE(AbstractScFillSeriesDlg_Impl);
-IMPL_ABSTDLG_BASE(AbstractScGroupDlg_Impl);
+
+short AbstractScGroupDlg_Impl::Execute()
+{
+ return m_xDlg->run();
+}
short AbstractScInsertCellDlg_Impl::Execute()
{
@@ -307,7 +311,7 @@ void AbstractScFillSeriesDlg_Impl::SetEdStartValEnabled(bool bFlag)
bool AbstractScGroupDlg_Impl::GetColsChecked() const
{
- return pDlg->GetColsChecked();
+ return m_xDlg->GetColsChecked();
}
InsCellCmd AbstractScInsertCellDlg_Impl::GetInsCellCmd() const
@@ -721,11 +725,9 @@ VclPtr<AbstractScFillSeriesDlg> ScAbstractDialogFactory_Impl::CreateScFillSeries
return VclPtr<AbstractScFillSeriesDlg_Impl>::Create( pDlg );
}
-VclPtr<AbstractScGroupDlg> ScAbstractDialogFactory_Impl::CreateAbstractScGroupDlg( vcl::Window* pParent,
- bool bUnGroup )
+VclPtr<AbstractScGroupDlg> ScAbstractDialogFactory_Impl::CreateAbstractScGroupDlg(weld::Window* pParent, bool bUnGroup)
{
- VclPtr<ScGroupDlg> pDlg = VclPtr<ScGroupDlg>::Create( pParent, bUnGroup, true/*bRows*/);
- return VclPtr<AbstractScGroupDlg_Impl>::Create( pDlg );
+ return VclPtr<AbstractScGroupDlg_Impl>::Create(new ScGroupDlg(pParent, bUnGroup, true/*bRows*/));
}
VclPtr<AbstractScInsertCellDlg> ScAbstractDialogFactory_Impl::CreateScInsertCellDlg(weld::Window* pParent,
diff --git a/sc/source/ui/attrdlg/scdlgfact.hxx b/sc/source/ui/attrdlg/scdlgfact.hxx
index 3b1d5334b08b..d4565762ed22 100644
--- a/sc/source/ui/attrdlg/scdlgfact.hxx
+++ b/sc/source/ui/attrdlg/scdlgfact.hxx
@@ -206,7 +206,13 @@ class AbstractScFillSeriesDlg_Impl:public AbstractScFillSeriesDlg
class AbstractScGroupDlg_Impl : public AbstractScGroupDlg
{
- DECL_ABSTDLG_BASE( AbstractScGroupDlg_Impl, ScGroupDlg)
+ std::unique_ptr<ScGroupDlg> m_xDlg;
+public:
+ explicit AbstractScGroupDlg_Impl(ScGroupDlg* p)
+ : m_xDlg(p)
+ {
+ }
+ virtual short Execute() override;
virtual bool GetColsChecked() const override;
};
@@ -469,8 +475,7 @@ public:
double fStep,
double fMax,
sal_uInt16 nPossDir) override;
- virtual VclPtr<AbstractScGroupDlg> CreateAbstractScGroupDlg( vcl::Window* pParent,
- bool bUnGroup = false) override;
+ virtual VclPtr<AbstractScGroupDlg> CreateAbstractScGroupDlg(weld::Window* pParent, bool bUnGroup = false) override;
virtual VclPtr<AbstractScInsertCellDlg> CreateScInsertCellDlg(weld::Window* pParent,
bool bDisallowCellMove) override;
diff --git a/sc/source/ui/inc/groupdlg.hxx b/sc/source/ui/inc/groupdlg.hxx
index 47cc587a375c..6f654d193594 100644
--- a/sc/source/ui/inc/groupdlg.hxx
+++ b/sc/source/ui/inc/groupdlg.hxx
@@ -20,21 +20,18 @@
#ifndef INCLUDED_SC_SOURCE_UI_INC_GROUPDLG_HXX
#define INCLUDED_SC_SOURCE_UI_INC_GROUPDLG_HXX
-#include <vcl/dialog.hxx>
-#include <vcl/button.hxx>
-#include <vcl/fixed.hxx>
+#include <vcl/weld.hxx>
-class ScGroupDlg : public ModalDialog
+class ScGroupDlg : public weld::GenericDialogController
{
public:
- ScGroupDlg(vcl::Window* pParent, bool bUnGroup, bool bRows);
+ ScGroupDlg(weld::Window* pParent, bool bUnGroup, bool bRows);
virtual ~ScGroupDlg() override;
- virtual void dispose() override;
bool GetColsChecked() const;
private:
- VclPtr<RadioButton> m_pBtnRows;
- VclPtr<RadioButton> m_pBtnCols;
+ std::unique_ptr<weld::RadioButton> m_xBtnRows;
+ std::unique_ptr<weld::RadioButton> m_xBtnCols;
};
#endif // INCLUDED_SC_SOURCE_UI_INC_GROUPDLG_HXX
diff --git a/sc/source/ui/miscdlgs/groupdlg.cxx b/sc/source/ui/miscdlgs/groupdlg.cxx
index 371a76790597..839cc4f74a16 100644
--- a/sc/source/ui/miscdlgs/groupdlg.cxx
+++ b/sc/source/ui/miscdlgs/groupdlg.cxx
@@ -21,41 +21,32 @@
#include <groupdlg.hxx>
-ScGroupDlg::ScGroupDlg(vcl::Window* pParent, bool bUngroup, bool bRows)
- : ModalDialog(pParent,
- bUngroup ?
- OUString("UngroupDialog") :
- OUString("GroupDialog"),
+ScGroupDlg::ScGroupDlg(weld::Window* pParent, bool bUngroup, bool bRows)
+ : GenericDialogController(pParent,
bUngroup ?
OUString("modules/scalc/ui/ungroupdialog.ui") :
- OUString("modules/scalc/ui/groupdialog.ui"))
+ OUString("modules/scalc/ui/groupdialog.ui")
+ ,
+ bUngroup ?
+ OString("UngroupDialog") :
+ OString("GroupDialog"))
+ , m_xBtnRows(m_xBuilder->weld_radio_button("rows"))
+ , m_xBtnCols(m_xBuilder->weld_radio_button("cols"))
{
- get(m_pBtnRows, "rows");
- get(m_pBtnCols, "cols");
-
- if ( bRows )
- m_pBtnRows->Check();
+ if (bRows)
+ m_xBtnRows->set_active(true);
else
- m_pBtnCols->Check();
-
- m_pBtnRows->GrabFocus();
+ m_xBtnCols->set_active(true);
+ m_xBtnRows->grab_focus();
}
ScGroupDlg::~ScGroupDlg()
{
- disposeOnce();
-}
-
-void ScGroupDlg::dispose()
-{
- m_pBtnRows.clear();
- m_pBtnCols.clear();
- ModalDialog::dispose();
}
bool ScGroupDlg::GetColsChecked() const
{
- return m_pBtnCols->IsChecked();
+ return m_xBtnCols->get_active();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx
index a4f7323c0609..ff00befb301e 100644
--- a/sc/source/ui/view/cellsh1.cxx
+++ b/sc/source/ui/view/cellsh1.cxx
@@ -1178,7 +1178,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "ScAbstractFactory create fail!");
- ScopedVclPtr<AbstractScGroupDlg> pDlg(pFact->CreateAbstractScGroupDlg(pTabViewShell->GetDialogParent()));
+ ScopedVclPtr<AbstractScGroupDlg> pDlg(pFact->CreateAbstractScGroupDlg(pTabViewShell->GetFrameWeld()));
OSL_ENSURE(pDlg, "Dialog create fail!");
if ( pDlg->Execute() == RET_OK )
bColumns = pDlg->GetColsChecked();
@@ -1238,7 +1238,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "ScAbstractFactory create fail!");
- ScopedVclPtr<AbstractScGroupDlg> pDlg(pFact->CreateAbstractScGroupDlg(pTabViewShell->GetDialogParent(), true));
+ ScopedVclPtr<AbstractScGroupDlg> pDlg(pFact->CreateAbstractScGroupDlg(pTabViewShell->GetFrameWeld(), true));
OSL_ENSURE(pDlg, "Dialog create fail!");
if ( pDlg->Execute() == RET_OK )
bColumns = pDlg->GetColsChecked();
diff --git a/sc/uiconfig/scalc/ui/groupdialog.ui b/sc/uiconfig/scalc/ui/groupdialog.ui
index 695ee3e81785..bf6f05d97f18 100644
--- a/sc/uiconfig/scalc/ui/groupdialog.ui
+++ b/sc/uiconfig/scalc/ui/groupdialog.ui
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.18.3 -->
+<!-- Generated with glade 3.20.4 -->
<interface domain="sc">
<requires lib="gtk+" version="3.18"/>
<object class="GtkDialog" id="GroupDialog">
@@ -7,6 +7,9 @@
<property name="border_width">6</property>
<property name="title" translatable="yes" context="groupdialog|GroupDialog">Group</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 internal-child="vbox">
<object class="GtkBox" id="dialog-vbox1">
@@ -61,7 +64,6 @@
<property name="fill">True</property>
<property name="position">2</property>
<property name="secondary">True</property>
- <property name="non_homogeneous">True</property>
</packing>
</child>
</object>
@@ -103,7 +105,6 @@
<property name="xalign">0</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
- <property name="group">cols</property>
</object>
<packing>
<property name="expand">False</property>
@@ -137,8 +138,8 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
- <property name="xalign">0</property>
<property name="label" translatable="yes" context="groupdialog|includeLabel">Include</property>
+ <property name="xalign">0</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
@@ -158,5 +159,8 @@
<action-widget response="-6">cancel</action-widget>
<action-widget response="-11">help</action-widget>
</action-widgets>
+ <child>
+ <placeholder/>
+ </child>
</object>
</interface>
diff --git a/sc/uiconfig/scalc/ui/ungroupdialog.ui b/sc/uiconfig/scalc/ui/ungroupdialog.ui
index 5420c8dbb97a..fdada2db0a28 100644
--- a/sc/uiconfig/scalc/ui/ungroupdialog.ui
+++ b/sc/uiconfig/scalc/ui/ungroupdialog.ui
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.18.3 -->
+<!-- Generated with glade 3.20.4 -->
<interface domain="sc">
<requires lib="gtk+" version="3.18"/>
<object class="GtkDialog" id="UngroupDialog">
@@ -7,6 +7,9 @@
<property name="border_width">6</property>
<property name="title" translatable="yes" context="ungroupdialog|UngroupDialog">Ungroup</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 internal-child="vbox">
<object class="GtkBox" id="dialog-vbox1">
@@ -61,7 +64,6 @@
<property name="fill">True</property>
<property name="position">2</property>
<property name="secondary">True</property>
- <property name="non_homogeneous">True</property>
</packing>
</child>
</object>
@@ -103,7 +105,6 @@
<property name="xalign">0</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
- <property name="group">cols</property>
</object>
<packing>
<property name="expand">False</property>
@@ -137,8 +138,8 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
- <property name="xalign">0</property>
<property name="label" translatable="yes" context="ungroupdialog|includeLabel">Deactivate for</property>
+ <property name="xalign">0</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
@@ -158,5 +159,8 @@
<action-widget response="-6">cancel</action-widget>
<action-widget response="-11">help</action-widget>
</action-widgets>
+ <child>
+ <placeholder/>
+ </child>
</object>
</interface>
More information about the Libreoffice-commits
mailing list