summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-04-13 12:20:13 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-04-13 15:34:30 +0200
commit03a59d9f43c3bbe80e1f06b1a95afd4694ac2f50 (patch)
tree6f2907a264a3ec3f2c0fb8bdac9cb20ca26f44bd
parentdab87ec9ac4ac0e4803790232d8b487e1500f24a (diff)
weld ScInsertCellDlg
Change-Id: I91118d4c0c5e2fa17fed02377547caa65e11bfdc Reviewed-on: https://gerrit.libreoffice.org/52824 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--sc/inc/scabstdlg.hxx4
-rw-r--r--sc/source/ui/attrdlg/scdlgfact.cxx17
-rw-r--r--sc/source/ui/attrdlg/scdlgfact.hxx12
-rw-r--r--sc/source/ui/inc/inscldlg.hxx17
-rw-r--r--sc/source/ui/miscdlgs/inscldlg.cxx69
-rw-r--r--sc/source/ui/view/cellsh1.cxx2
-rw-r--r--sc/uiconfig/scalc/ui/insertcells.ui14
-rw-r--r--sfx2/uiconfig/ui/bookmarkdialog.ui5
8 files changed, 76 insertions, 64 deletions
diff --git a/sc/inc/scabstdlg.hxx b/sc/inc/scabstdlg.hxx
index ccdd419f2a69..d970cac36827 100644
--- a/sc/inc/scabstdlg.hxx
+++ b/sc/inc/scabstdlg.hxx
@@ -443,8 +443,8 @@ public:
virtual VclPtr<AbstractScGroupDlg> CreateAbstractScGroupDlg( vcl::Window* pParent,
bool bUnGroup = false ) = 0;
- virtual VclPtr<AbstractScInsertCellDlg> CreateScInsertCellDlg( vcl::Window* pParent,
- bool bDisallowCellMove ) = 0;
+ virtual VclPtr<AbstractScInsertCellDlg> CreateScInsertCellDlg(weld::Window* pParent,
+ bool bDisallowCellMove) = 0;
virtual VclPtr<AbstractScInsertContentsDlg> CreateScInsertContentsDlg( vcl::Window* pParent,
const OUString* pStrTitle = nullptr ) = 0;
diff --git a/sc/source/ui/attrdlg/scdlgfact.cxx b/sc/source/ui/attrdlg/scdlgfact.cxx
index 101ad4c56d96..2c7c7eb2ebba 100644
--- a/sc/source/ui/attrdlg/scdlgfact.cxx
+++ b/sc/source/ui/attrdlg/scdlgfact.cxx
@@ -88,7 +88,12 @@ IMPL_ABSTDLG_BASE(AbstractScDataFormDlg_Impl);
IMPL_ABSTDLG_BASE(AbstractScDeleteContentsDlg_Impl);
IMPL_ABSTDLG_BASE(AbstractScFillSeriesDlg_Impl);
IMPL_ABSTDLG_BASE(AbstractScGroupDlg_Impl);
-IMPL_ABSTDLG_BASE(AbstractScInsertCellDlg_Impl);
+
+short AbstractScInsertCellDlg_Impl::Execute()
+{
+ return m_xDlg->run();
+}
+
IMPL_ABSTDLG_BASE(AbstractScInsertContentsDlg_Impl);
IMPL_ABSTDLG_BASE(AbstractScInsertTableDlg_Impl);
IMPL_ABSTDLG_BASE(AbstractScSelEntryDlg_Impl);
@@ -113,6 +118,7 @@ IMPL_ABSTDLG_BASE(ScAbstractTabDialog_Impl);
AbstractScLinkedAreaDlg_Impl::~AbstractScLinkedAreaDlg_Impl()
{
}
+
short AbstractScLinkedAreaDlg_Impl::Execute()
{
return m_xDlg->run();
@@ -296,7 +302,7 @@ bool AbstractScGroupDlg_Impl::GetColsChecked() const
InsCellCmd AbstractScInsertCellDlg_Impl::GetInsCellCmd() const
{
- return pDlg->GetInsCellCmd();
+ return m_xDlg->GetInsCellCmd();
}
InsertDeleteFlags AbstractScInsertContentsDlg_Impl::GetInsContentsCmdBits() const
@@ -714,11 +720,10 @@ VclPtr<AbstractScGroupDlg> ScAbstractDialogFactory_Impl::CreateAbstractScGroupDl
return VclPtr<AbstractScGroupDlg_Impl>::Create( pDlg );
}
-VclPtr<AbstractScInsertCellDlg> ScAbstractDialogFactory_Impl::CreateScInsertCellDlg( vcl::Window* pParent,
- bool bDisallowCellMove )
+VclPtr<AbstractScInsertCellDlg> ScAbstractDialogFactory_Impl::CreateScInsertCellDlg(weld::Window* pParent,
+ bool bDisallowCellMove)
{
- VclPtr<ScInsertCellDlg> pDlg = VclPtr<ScInsertCellDlg>::Create( pParent, bDisallowCellMove);
- return VclPtr<AbstractScInsertCellDlg_Impl>::Create( pDlg );
+ return VclPtr<AbstractScInsertCellDlg_Impl>::Create(new ScInsertCellDlg(pParent, bDisallowCellMove));
}
VclPtr<AbstractScInsertContentsDlg> ScAbstractDialogFactory_Impl::CreateScInsertContentsDlg( vcl::Window* pParent,
diff --git a/sc/source/ui/attrdlg/scdlgfact.hxx b/sc/source/ui/attrdlg/scdlgfact.hxx
index 86cf786de353..1f2bcee38bce 100644
--- a/sc/source/ui/attrdlg/scdlgfact.hxx
+++ b/sc/source/ui/attrdlg/scdlgfact.hxx
@@ -200,7 +200,13 @@ class AbstractScGroupDlg_Impl : public AbstractScGroupDlg
class AbstractScInsertCellDlg_Impl : public AbstractScInsertCellDlg
{
- DECL_ABSTDLG_BASE( AbstractScInsertCellDlg_Impl, ScInsertCellDlg)
+ std::unique_ptr<ScInsertCellDlg> m_xDlg;
+public:
+ explicit AbstractScInsertCellDlg_Impl(ScInsertCellDlg* p)
+ : m_xDlg(p)
+ {
+ }
+ virtual short Execute() override;
virtual InsCellCmd GetInsCellCmd() const override ;
};
@@ -449,8 +455,8 @@ public:
virtual VclPtr<AbstractScGroupDlg> CreateAbstractScGroupDlg( vcl::Window* pParent,
bool bUnGroup = false) override;
- virtual VclPtr<AbstractScInsertCellDlg> CreateScInsertCellDlg( vcl::Window* pParent,
- bool bDisallowCellMove ) override;
+ virtual VclPtr<AbstractScInsertCellDlg> CreateScInsertCellDlg(weld::Window* pParent,
+ bool bDisallowCellMove) override;
virtual VclPtr<AbstractScInsertContentsDlg> CreateScInsertContentsDlg( vcl::Window* pParent,
const OUString* pStrTitle = nullptr ) override;
diff --git a/sc/source/ui/inc/inscldlg.hxx b/sc/source/ui/inc/inscldlg.hxx
index 58b830e27cf4..84f978f7cb9a 100644
--- a/sc/source/ui/inc/inscldlg.hxx
+++ b/sc/source/ui/inc/inscldlg.hxx
@@ -20,24 +20,21 @@
#ifndef INCLUDED_SC_SOURCE_UI_INC_INSCLDLG_HXX
#define INCLUDED_SC_SOURCE_UI_INC_INSCLDLG_HXX
-#include <vcl/dialog.hxx>
-#include <vcl/button.hxx>
-#include <vcl/fixed.hxx>
+#include <vcl/weld.hxx>
#include <global.hxx>
-class ScInsertCellDlg : public ModalDialog
+class ScInsertCellDlg : public weld::GenericDialogController
{
private:
- VclPtr<RadioButton> m_pBtnCellsDown;
- VclPtr<RadioButton> m_pBtnCellsRight;
- VclPtr<RadioButton> m_pBtnInsRow;
- VclPtr<RadioButton> m_pBtnInsCol;
+ std::unique_ptr<weld::RadioButton> m_xBtnCellsDown;
+ std::unique_ptr<weld::RadioButton> m_xBtnCellsRight;
+ std::unique_ptr<weld::RadioButton> m_xBtnInsRow;
+ std::unique_ptr<weld::RadioButton> m_xBtnInsCol;
public:
- ScInsertCellDlg( vcl::Window* pParent, bool bDisallowCellMove );
+ ScInsertCellDlg(weld::Window* pParent, bool bDisallowCellMove);
virtual ~ScInsertCellDlg() override;
- virtual void dispose() override;
InsCellCmd GetInsCellCmd() const;
};
diff --git a/sc/source/ui/miscdlgs/inscldlg.cxx b/sc/source/ui/miscdlgs/inscldlg.cxx
index 3ce3ae4a36e2..ceb4c4a85021 100644
--- a/sc/source/ui/miscdlgs/inscldlg.cxx
+++ b/sc/source/ui/miscdlgs/inscldlg.cxx
@@ -25,73 +25,76 @@
static sal_uInt8 nInsItemChecked=0;
-ScInsertCellDlg::ScInsertCellDlg( vcl::Window* pParent,bool bDisallowCellMove) :
- ModalDialog ( pParent, "InsertCellsDialog", "modules/scalc/ui/insertcells.ui")
+ScInsertCellDlg::ScInsertCellDlg(weld::Window* pParent,bool bDisallowCellMove)
+ : GenericDialogController(pParent, "modules/scalc/ui/insertcells.ui", "InsertCellsDialog")
+ , m_xBtnCellsDown(m_xBuilder->weld_radio_button("down"))
+ , m_xBtnCellsRight(m_xBuilder->weld_radio_button("right"))
+ , m_xBtnInsRow(m_xBuilder->weld_radio_button("rows"))
+ , m_xBtnInsCol(m_xBuilder->weld_radio_button("cols"))
{
- get(m_pBtnCellsDown, "down");
- get(m_pBtnCellsRight, "right");
- get(m_pBtnInsRow, "rows");
- get(m_pBtnInsCol, "cols");
-
if (bDisallowCellMove)
{
- m_pBtnCellsDown->Disable();
- m_pBtnCellsRight->Disable();
- m_pBtnInsRow->Check();
+ m_xBtnCellsDown->set_sensitive(false);
+ m_xBtnCellsRight->set_sensitive(false);
+ m_xBtnInsRow->set_active(true);
- switch(nInsItemChecked)
+ switch (nInsItemChecked)
{
- case 2: m_pBtnInsRow->Check();break;
- case 3: m_pBtnInsCol->Check();break;
- default:m_pBtnInsRow->Check();break;
+ case 2:
+ m_xBtnInsRow->set_active(true);
+ break;
+ case 3:
+ m_xBtnInsCol->set_active(true);
+ break;
+ default:
+ m_xBtnInsRow->set_active(true);
+ break;
}
}
else
{
- switch(nInsItemChecked)
+ switch (nInsItemChecked)
{
- case 0: m_pBtnCellsDown->Check();break;
- case 1: m_pBtnCellsRight->Check();break;
- case 2: m_pBtnInsRow->Check();break;
- case 3: m_pBtnInsCol->Check();break;
+ case 0:
+ m_xBtnCellsDown->set_active(true);
+ break;
+ case 1:
+ m_xBtnCellsRight->set_active(true);
+ break;
+ case 2:
+ m_xBtnInsRow->set_active(true);
+ break;
+ case 3:
+ m_xBtnInsCol->set_active(true);
+ break;
}
}
}
ScInsertCellDlg::~ScInsertCellDlg()
{
- disposeOnce();
-}
-
-void ScInsertCellDlg::dispose()
-{
- m_pBtnCellsDown.clear();
- m_pBtnCellsRight.clear();
- m_pBtnInsRow.clear();
- m_pBtnInsCol.clear();
- ModalDialog::dispose();
}
InsCellCmd ScInsertCellDlg::GetInsCellCmd() const
{
InsCellCmd nReturn = INS_NONE;
- if ( m_pBtnCellsDown->IsChecked() )
+ if (m_xBtnCellsDown->get_active())
{
nInsItemChecked=0;
nReturn = INS_CELLSDOWN;
}
- else if ( m_pBtnCellsRight->IsChecked())
+ else if (m_xBtnCellsRight->get_active())
{
nInsItemChecked=1;
nReturn = INS_CELLSRIGHT;
}
- else if ( m_pBtnInsRow->IsChecked() )
+ else if (m_xBtnInsRow->get_active())
{
nInsItemChecked=2;
nReturn = INS_INSROWS_BEFORE;
}
- else if ( m_pBtnInsCol->IsChecked() )
+ else if (m_xBtnInsCol->get_active())
{
nInsItemChecked=3;
nReturn = INS_INSCOLS_BEFORE;
diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx
index a7b28e26fafd..0593574a9891 100644
--- a/sc/source/ui/view/cellsh1.cxx
+++ b/sc/source/ui/view/cellsh1.cxx
@@ -293,7 +293,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "ScAbstractFactory create fail!");
- ScopedVclPtr<AbstractScInsertCellDlg> pDlg(pFact->CreateScInsertCellDlg( pTabViewShell->GetDialogParent(), bTheFlag));
+ ScopedVclPtr<AbstractScInsertCellDlg> pDlg(pFact->CreateScInsertCellDlg(pTabViewShell->GetFrameWeld(), bTheFlag));
OSL_ENSURE(pDlg, "Dialog create fail!");
if (pDlg->Execute() == RET_OK)
eCmd = pDlg->GetInsCellCmd();
diff --git a/sc/uiconfig/scalc/ui/insertcells.ui b/sc/uiconfig/scalc/ui/insertcells.ui
index dae243c24f5e..8dd827fd7c89 100644
--- a/sc/uiconfig/scalc/ui/insertcells.ui
+++ b/sc/uiconfig/scalc/ui/insertcells.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="InsertCellsDialog">
@@ -7,6 +7,9 @@
<property name="border_width">6</property>
<property name="title" translatable="yes" context="insertcells|InsertCellsDialog">Insert Cells</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">
@@ -64,7 +67,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>
@@ -104,7 +106,6 @@
<property name="xalign">0</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
- <property name="group">right</property>
</object>
<packing>
<property name="expand">False</property>
@@ -122,7 +123,7 @@
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
- <property name="group">rows</property>
+ <property name="group">down</property>
</object>
<packing>
<property name="expand">False</property>
@@ -140,7 +141,7 @@
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
- <property name="group">cols</property>
+ <property name="group">down</property>
</object>
<packing>
<property name="expand">False</property>
@@ -194,5 +195,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/sfx2/uiconfig/ui/bookmarkdialog.ui b/sfx2/uiconfig/ui/bookmarkdialog.ui
index b8663d906b5f..f8daf9eaf2bd 100644
--- a/sfx2/uiconfig/ui/bookmarkdialog.ui
+++ b/sfx2/uiconfig/ui/bookmarkdialog.ui
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.20.4 -->
<interface domain="sfx">
- <requires lib="gtk+" version="3.0"/>
+ <requires lib="gtk+" version="3.18"/>
<object class="GtkDialog" id="BookmarkDialog">
<property name="can_focus">False</property>
<property name="border_width">6</property>
@@ -32,7 +32,6 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="pack_type">end</property>
<property name="position">0</property>
</packing>
</child>
@@ -47,7 +46,6 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="pack_type">end</property>
<property name="position">1</property>
</packing>
</child>
@@ -63,7 +61,6 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="pack_type">end</property>
<property name="position">2</property>
<property name="secondary">True</property>
</packing>