Kaydet (Commit) 03a59d9f authored tarafından Caolán McNamara's avatar Caolán McNamara

weld ScInsertCellDlg

Change-Id: I91118d4c0c5e2fa17fed02377547caa65e11bfdc
Reviewed-on: https://gerrit.libreoffice.org/52824Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst dab87ec9
...@@ -443,8 +443,8 @@ public: ...@@ -443,8 +443,8 @@ public:
virtual VclPtr<AbstractScGroupDlg> CreateAbstractScGroupDlg( vcl::Window* pParent, virtual VclPtr<AbstractScGroupDlg> CreateAbstractScGroupDlg( vcl::Window* pParent,
bool bUnGroup = false ) = 0; bool bUnGroup = false ) = 0;
virtual VclPtr<AbstractScInsertCellDlg> CreateScInsertCellDlg( vcl::Window* pParent, virtual VclPtr<AbstractScInsertCellDlg> CreateScInsertCellDlg(weld::Window* pParent,
bool bDisallowCellMove ) = 0; bool bDisallowCellMove) = 0;
virtual VclPtr<AbstractScInsertContentsDlg> CreateScInsertContentsDlg( vcl::Window* pParent, virtual VclPtr<AbstractScInsertContentsDlg> CreateScInsertContentsDlg( vcl::Window* pParent,
const OUString* pStrTitle = nullptr ) = 0; const OUString* pStrTitle = nullptr ) = 0;
......
...@@ -88,7 +88,12 @@ IMPL_ABSTDLG_BASE(AbstractScDataFormDlg_Impl); ...@@ -88,7 +88,12 @@ IMPL_ABSTDLG_BASE(AbstractScDataFormDlg_Impl);
IMPL_ABSTDLG_BASE(AbstractScDeleteContentsDlg_Impl); IMPL_ABSTDLG_BASE(AbstractScDeleteContentsDlg_Impl);
IMPL_ABSTDLG_BASE(AbstractScFillSeriesDlg_Impl); IMPL_ABSTDLG_BASE(AbstractScFillSeriesDlg_Impl);
IMPL_ABSTDLG_BASE(AbstractScGroupDlg_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(AbstractScInsertContentsDlg_Impl);
IMPL_ABSTDLG_BASE(AbstractScInsertTableDlg_Impl); IMPL_ABSTDLG_BASE(AbstractScInsertTableDlg_Impl);
IMPL_ABSTDLG_BASE(AbstractScSelEntryDlg_Impl); IMPL_ABSTDLG_BASE(AbstractScSelEntryDlg_Impl);
...@@ -113,6 +118,7 @@ IMPL_ABSTDLG_BASE(ScAbstractTabDialog_Impl); ...@@ -113,6 +118,7 @@ IMPL_ABSTDLG_BASE(ScAbstractTabDialog_Impl);
AbstractScLinkedAreaDlg_Impl::~AbstractScLinkedAreaDlg_Impl() AbstractScLinkedAreaDlg_Impl::~AbstractScLinkedAreaDlg_Impl()
{ {
} }
short AbstractScLinkedAreaDlg_Impl::Execute() short AbstractScLinkedAreaDlg_Impl::Execute()
{ {
return m_xDlg->run(); return m_xDlg->run();
...@@ -296,7 +302,7 @@ bool AbstractScGroupDlg_Impl::GetColsChecked() const ...@@ -296,7 +302,7 @@ bool AbstractScGroupDlg_Impl::GetColsChecked() const
InsCellCmd AbstractScInsertCellDlg_Impl::GetInsCellCmd() const InsCellCmd AbstractScInsertCellDlg_Impl::GetInsCellCmd() const
{ {
return pDlg->GetInsCellCmd(); return m_xDlg->GetInsCellCmd();
} }
InsertDeleteFlags AbstractScInsertContentsDlg_Impl::GetInsContentsCmdBits() const InsertDeleteFlags AbstractScInsertContentsDlg_Impl::GetInsContentsCmdBits() const
...@@ -714,11 +720,10 @@ VclPtr<AbstractScGroupDlg> ScAbstractDialogFactory_Impl::CreateAbstractScGroupDl ...@@ -714,11 +720,10 @@ VclPtr<AbstractScGroupDlg> ScAbstractDialogFactory_Impl::CreateAbstractScGroupDl
return VclPtr<AbstractScGroupDlg_Impl>::Create( pDlg ); return VclPtr<AbstractScGroupDlg_Impl>::Create( pDlg );
} }
VclPtr<AbstractScInsertCellDlg> ScAbstractDialogFactory_Impl::CreateScInsertCellDlg( vcl::Window* pParent, VclPtr<AbstractScInsertCellDlg> ScAbstractDialogFactory_Impl::CreateScInsertCellDlg(weld::Window* pParent,
bool bDisallowCellMove ) bool bDisallowCellMove)
{ {
VclPtr<ScInsertCellDlg> pDlg = VclPtr<ScInsertCellDlg>::Create( pParent, bDisallowCellMove); return VclPtr<AbstractScInsertCellDlg_Impl>::Create(new ScInsertCellDlg(pParent, bDisallowCellMove));
return VclPtr<AbstractScInsertCellDlg_Impl>::Create( pDlg );
} }
VclPtr<AbstractScInsertContentsDlg> ScAbstractDialogFactory_Impl::CreateScInsertContentsDlg( vcl::Window* pParent, VclPtr<AbstractScInsertContentsDlg> ScAbstractDialogFactory_Impl::CreateScInsertContentsDlg( vcl::Window* pParent,
......
...@@ -200,7 +200,13 @@ class AbstractScGroupDlg_Impl : public AbstractScGroupDlg ...@@ -200,7 +200,13 @@ class AbstractScGroupDlg_Impl : public AbstractScGroupDlg
class AbstractScInsertCellDlg_Impl : public AbstractScInsertCellDlg 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 ; virtual InsCellCmd GetInsCellCmd() const override ;
}; };
...@@ -449,8 +455,8 @@ public: ...@@ -449,8 +455,8 @@ public:
virtual VclPtr<AbstractScGroupDlg> CreateAbstractScGroupDlg( vcl::Window* pParent, virtual VclPtr<AbstractScGroupDlg> CreateAbstractScGroupDlg( vcl::Window* pParent,
bool bUnGroup = false) override; bool bUnGroup = false) override;
virtual VclPtr<AbstractScInsertCellDlg> CreateScInsertCellDlg( vcl::Window* pParent, virtual VclPtr<AbstractScInsertCellDlg> CreateScInsertCellDlg(weld::Window* pParent,
bool bDisallowCellMove ) override; bool bDisallowCellMove) override;
virtual VclPtr<AbstractScInsertContentsDlg> CreateScInsertContentsDlg( vcl::Window* pParent, virtual VclPtr<AbstractScInsertContentsDlg> CreateScInsertContentsDlg( vcl::Window* pParent,
const OUString* pStrTitle = nullptr ) override; const OUString* pStrTitle = nullptr ) override;
......
...@@ -20,24 +20,21 @@ ...@@ -20,24 +20,21 @@
#ifndef INCLUDED_SC_SOURCE_UI_INC_INSCLDLG_HXX #ifndef INCLUDED_SC_SOURCE_UI_INC_INSCLDLG_HXX
#define INCLUDED_SC_SOURCE_UI_INC_INSCLDLG_HXX #define INCLUDED_SC_SOURCE_UI_INC_INSCLDLG_HXX
#include <vcl/dialog.hxx> #include <vcl/weld.hxx>
#include <vcl/button.hxx>
#include <vcl/fixed.hxx>
#include <global.hxx> #include <global.hxx>
class ScInsertCellDlg : public ModalDialog class ScInsertCellDlg : public weld::GenericDialogController
{ {
private: private:
VclPtr<RadioButton> m_pBtnCellsDown; std::unique_ptr<weld::RadioButton> m_xBtnCellsDown;
VclPtr<RadioButton> m_pBtnCellsRight; std::unique_ptr<weld::RadioButton> m_xBtnCellsRight;
VclPtr<RadioButton> m_pBtnInsRow; std::unique_ptr<weld::RadioButton> m_xBtnInsRow;
VclPtr<RadioButton> m_pBtnInsCol; std::unique_ptr<weld::RadioButton> m_xBtnInsCol;
public: public:
ScInsertCellDlg( vcl::Window* pParent, bool bDisallowCellMove ); ScInsertCellDlg(weld::Window* pParent, bool bDisallowCellMove);
virtual ~ScInsertCellDlg() override; virtual ~ScInsertCellDlg() override;
virtual void dispose() override;
InsCellCmd GetInsCellCmd() const; InsCellCmd GetInsCellCmd() const;
}; };
......
...@@ -25,73 +25,76 @@ ...@@ -25,73 +25,76 @@
static sal_uInt8 nInsItemChecked=0; static sal_uInt8 nInsItemChecked=0;
ScInsertCellDlg::ScInsertCellDlg( vcl::Window* pParent,bool bDisallowCellMove) : ScInsertCellDlg::ScInsertCellDlg(weld::Window* pParent,bool bDisallowCellMove)
ModalDialog ( pParent, "InsertCellsDialog", "modules/scalc/ui/insertcells.ui") : 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) if (bDisallowCellMove)
{ {
m_pBtnCellsDown->Disable(); m_xBtnCellsDown->set_sensitive(false);
m_pBtnCellsRight->Disable(); m_xBtnCellsRight->set_sensitive(false);
m_pBtnInsRow->Check(); m_xBtnInsRow->set_active(true);
switch(nInsItemChecked) switch (nInsItemChecked)
{ {
case 2: m_pBtnInsRow->Check();break; case 2:
case 3: m_pBtnInsCol->Check();break; m_xBtnInsRow->set_active(true);
default:m_pBtnInsRow->Check();break; break;
case 3:
m_xBtnInsCol->set_active(true);
break;
default:
m_xBtnInsRow->set_active(true);
break;
} }
} }
else else
{ {
switch(nInsItemChecked) switch (nInsItemChecked)
{ {
case 0: m_pBtnCellsDown->Check();break; case 0:
case 1: m_pBtnCellsRight->Check();break; m_xBtnCellsDown->set_active(true);
case 2: m_pBtnInsRow->Check();break; break;
case 3: m_pBtnInsCol->Check();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() 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 ScInsertCellDlg::GetInsCellCmd() const
{ {
InsCellCmd nReturn = INS_NONE; InsCellCmd nReturn = INS_NONE;
if ( m_pBtnCellsDown->IsChecked() ) if (m_xBtnCellsDown->get_active())
{ {
nInsItemChecked=0; nInsItemChecked=0;
nReturn = INS_CELLSDOWN; nReturn = INS_CELLSDOWN;
} }
else if ( m_pBtnCellsRight->IsChecked()) else if (m_xBtnCellsRight->get_active())
{ {
nInsItemChecked=1; nInsItemChecked=1;
nReturn = INS_CELLSRIGHT; nReturn = INS_CELLSRIGHT;
} }
else if ( m_pBtnInsRow->IsChecked() ) else if (m_xBtnInsRow->get_active())
{ {
nInsItemChecked=2; nInsItemChecked=2;
nReturn = INS_INSROWS_BEFORE; nReturn = INS_INSROWS_BEFORE;
} }
else if ( m_pBtnInsCol->IsChecked() ) else if (m_xBtnInsCol->get_active())
{ {
nInsItemChecked=3; nInsItemChecked=3;
nReturn = INS_INSCOLS_BEFORE; nReturn = INS_INSCOLS_BEFORE;
......
...@@ -293,7 +293,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) ...@@ -293,7 +293,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "ScAbstractFactory create fail!"); 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!"); OSL_ENSURE(pDlg, "Dialog create fail!");
if (pDlg->Execute() == RET_OK) if (pDlg->Execute() == RET_OK)
eCmd = pDlg->GetInsCellCmd(); eCmd = pDlg->GetInsCellCmd();
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.18.3 --> <!-- Generated with glade 3.20.4 -->
<interface domain="sc"> <interface domain="sc">
<requires lib="gtk+" version="3.18"/> <requires lib="gtk+" version="3.18"/>
<object class="GtkDialog" id="InsertCellsDialog"> <object class="GtkDialog" id="InsertCellsDialog">
...@@ -7,6 +7,9 @@ ...@@ -7,6 +7,9 @@
<property name="border_width">6</property> <property name="border_width">6</property>
<property name="title" translatable="yes" context="insertcells|InsertCellsDialog">Insert Cells</property> <property name="title" translatable="yes" context="insertcells|InsertCellsDialog">Insert Cells</property>
<property name="resizable">False</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> <property name="type_hint">dialog</property>
<child internal-child="vbox"> <child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox1"> <object class="GtkBox" id="dialog-vbox1">
...@@ -64,7 +67,6 @@ ...@@ -64,7 +67,6 @@
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">2</property> <property name="position">2</property>
<property name="secondary">True</property> <property name="secondary">True</property>
<property name="non_homogeneous">True</property>
</packing> </packing>
</child> </child>
</object> </object>
...@@ -104,7 +106,6 @@ ...@@ -104,7 +106,6 @@
<property name="xalign">0</property> <property name="xalign">0</property>
<property name="active">True</property> <property name="active">True</property>
<property name="draw_indicator">True</property> <property name="draw_indicator">True</property>
<property name="group">right</property>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
...@@ -122,7 +123,7 @@ ...@@ -122,7 +123,7 @@
<property name="use_underline">True</property> <property name="use_underline">True</property>
<property name="xalign">0</property> <property name="xalign">0</property>
<property name="draw_indicator">True</property> <property name="draw_indicator">True</property>
<property name="group">rows</property> <property name="group">down</property>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
...@@ -140,7 +141,7 @@ ...@@ -140,7 +141,7 @@
<property name="use_underline">True</property> <property name="use_underline">True</property>
<property name="xalign">0</property> <property name="xalign">0</property>
<property name="draw_indicator">True</property> <property name="draw_indicator">True</property>
<property name="group">cols</property> <property name="group">down</property>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
...@@ -194,5 +195,8 @@ ...@@ -194,5 +195,8 @@
<action-widget response="-6">cancel</action-widget> <action-widget response="-6">cancel</action-widget>
<action-widget response="-11">help</action-widget> <action-widget response="-11">help</action-widget>
</action-widgets> </action-widgets>
<child>
<placeholder/>
</child>
</object> </object>
</interface> </interface>
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.20.4 --> <!-- Generated with glade 3.20.4 -->
<interface domain="sfx"> <interface domain="sfx">
<requires lib="gtk+" version="3.0"/> <requires lib="gtk+" version="3.18"/>
<object class="GtkDialog" id="BookmarkDialog"> <object class="GtkDialog" id="BookmarkDialog">
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="border_width">6</property> <property name="border_width">6</property>
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="pack_type">end</property>
<property name="position">0</property> <property name="position">0</property>
</packing> </packing>
</child> </child>
...@@ -47,7 +46,6 @@ ...@@ -47,7 +46,6 @@
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="pack_type">end</property>
<property name="position">1</property> <property name="position">1</property>
</packing> </packing>
</child> </child>
...@@ -63,7 +61,6 @@ ...@@ -63,7 +61,6 @@
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="pack_type">end</property>
<property name="position">2</property> <property name="position">2</property>
<property name="secondary">True</property> <property name="secondary">True</property>
</packing> </packing>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment