Kaydet (Commit) 0c466688 authored tarafından Caolán McNamara's avatar Caolán McNamara

weld SwMergeTableDlg

Change-Id: Idbe96bb8150fc695408faa38342237191aceb777
Reviewed-on: https://gerrit.libreoffice.org/52271Tested-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 cc78e723
...@@ -446,7 +446,7 @@ public: ...@@ -446,7 +446,7 @@ public:
css::uno::Reference< css::container::XNameAccess > & xNameAccess) = 0; css::uno::Reference< css::container::XNameAccess > & xNameAccess) = 0;
virtual VclPtr<AbstractSwModalRedlineAcceptDlg> CreateSwModalRedlineAcceptDlg(vcl::Window *pParent) = 0; virtual VclPtr<AbstractSwModalRedlineAcceptDlg> CreateSwModalRedlineAcceptDlg(vcl::Window *pParent) = 0;
virtual VclPtr<VclAbstractDialog> CreateTableMergeDialog( vcl::Window* pParent, bool& rWithPrev ) = 0; virtual VclPtr<VclAbstractDialog> CreateTableMergeDialog(weld::Window* pParent, bool& rWithPrev) = 0;
virtual VclPtr<SfxAbstractTabDialog> CreateFrameTabDialog(const OUString &rDialogType, virtual VclPtr<SfxAbstractTabDialog> CreateFrameTabDialog(const OUString &rDialogType,
SfxViewFrame *pFrame, vcl::Window *pParent, SfxViewFrame *pFrame, vcl::Window *pParent,
const SfxItemSet& rCoreSet, const SfxItemSet& rCoreSet,
......
...@@ -111,6 +111,10 @@ short AbstractSwTableHeightDlg_Impl::Execute() ...@@ -111,6 +111,10 @@ short AbstractSwTableHeightDlg_Impl::Execute()
{ {
return m_xDlg->execute(); return m_xDlg->execute();
} }
short AbstractSwMergeTableDlg_Impl::Execute()
{
return m_xDlg->execute();
}
short AbstractSwSortDlg_Impl::Execute() short AbstractSwSortDlg_Impl::Execute()
{ {
return m_xDlg->execute(); return m_xDlg->execute();
...@@ -887,10 +891,9 @@ VclPtr<AbstractSwModalRedlineAcceptDlg> SwAbstractDialogFactory_Impl::CreateSwMo ...@@ -887,10 +891,9 @@ VclPtr<AbstractSwModalRedlineAcceptDlg> SwAbstractDialogFactory_Impl::CreateSwMo
return VclPtr<AbstractSwModalRedlineAcceptDlg_Impl>::Create( pDlg ); return VclPtr<AbstractSwModalRedlineAcceptDlg_Impl>::Create( pDlg );
} }
VclPtr<VclAbstractDialog> SwAbstractDialogFactory_Impl::CreateTableMergeDialog(vcl::Window* pParent, bool& rWithPrev) VclPtr<VclAbstractDialog> SwAbstractDialogFactory_Impl::CreateTableMergeDialog(weld::Window* pParent, bool& rWithPrev)
{ {
VclPtr<Dialog> pDlg = VclPtr<SwMergeTableDlg>::Create( pParent, rWithPrev ); return VclPtr<AbstractSwMergeTableDlg_Impl>::Create(new SwMergeTableDlg(pParent, rWithPrev));
return VclPtr<VclAbstractDialog_Impl>::Create( pDlg );
} }
VclPtr<SfxAbstractTabDialog> SwAbstractDialogFactory_Impl::CreateFrameTabDialog(const OUString &rDialogType, VclPtr<SfxAbstractTabDialog> SwAbstractDialogFactory_Impl::CreateFrameTabDialog(const OUString &rDialogType,
......
...@@ -28,6 +28,7 @@ class SwBreakDlg; ...@@ -28,6 +28,7 @@ class SwBreakDlg;
class SwSortDlg; class SwSortDlg;
class SwTableHeightDlg; class SwTableHeightDlg;
class SwTableWidthDlg; class SwTableWidthDlg;
class SwMergeTableDlg;
class SignatureLineDialog; class SignatureLineDialog;
class SfxTabDialog; class SfxTabDialog;
class SwConvertTableDlg; class SwConvertTableDlg;
...@@ -168,6 +169,18 @@ public: ...@@ -168,6 +169,18 @@ public:
virtual short Execute() override; virtual short Execute() override;
}; };
class AbstractSwMergeTableDlg_Impl : public VclAbstractDialog
{
protected:
std::unique_ptr<SwMergeTableDlg> m_xDlg;
public:
explicit AbstractSwMergeTableDlg_Impl(SwMergeTableDlg* p)
: m_xDlg(p)
{
}
virtual short Execute() override;
};
class AbstractSplitTableDialog_Impl : public AbstractSplitTableDialog // add for class AbstractSplitTableDialog_Impl : public AbstractSplitTableDialog // add for
{ {
protected: protected:
...@@ -523,7 +536,7 @@ public: ...@@ -523,7 +536,7 @@ public:
css::uno::Reference< css::container::XNameAccess > & xNameAccess) override; css::uno::Reference< css::container::XNameAccess > & xNameAccess) override;
virtual VclPtr<AbstractSwModalRedlineAcceptDlg> CreateSwModalRedlineAcceptDlg(vcl::Window *pParent) override; virtual VclPtr<AbstractSwModalRedlineAcceptDlg> CreateSwModalRedlineAcceptDlg(vcl::Window *pParent) override;
virtual VclPtr<VclAbstractDialog> CreateTableMergeDialog(vcl::Window* pParent, bool& rWithPrev) override; virtual VclPtr<VclAbstractDialog> CreateTableMergeDialog(weld::Window* pParent, bool& rWithPrev) override;
virtual VclPtr<SfxAbstractTabDialog> CreateFrameTabDialog( const OUString &rDialogType, virtual VclPtr<SfxAbstractTabDialog> CreateFrameTabDialog( const OUString &rDialogType,
SfxViewFrame *pFrame, vcl::Window *pParent, SfxViewFrame *pFrame, vcl::Window *pParent,
const SfxItemSet& rCoreSet, const SfxItemSet& rCoreSet,
......
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
#include <label.hxx> #include <label.hxx>
#include <mailmrge.hxx> #include <mailmrge.hxx>
#include <mailmergewizard.hxx> #include <mailmergewizard.hxx>
#include <mergetbl.hxx>
#include <regionsw.hxx> #include <regionsw.hxx>
#include <rowht.hxx> #include <rowht.hxx>
#include <selglos.hxx> #include <selglos.hxx>
......
...@@ -20,29 +20,25 @@ ...@@ -20,29 +20,25 @@
#include <swtypes.hxx> #include <swtypes.hxx>
#include <mergetbl.hxx> #include <mergetbl.hxx>
SwMergeTableDlg::SwMergeTableDlg( vcl::Window *pParent, bool& rWithPrev ) SwMergeTableDlg::SwMergeTableDlg(weld::Window *pParent, bool& rWithPrev)
: SvxStandardDialog(pParent, "MergeTableDialog", "modules/swriter/ui/mergetabledialog.ui") : GenericDialogController(pParent, "modules/swriter/ui/mergetabledialog.ui", "MergeTableDialog")
, m_rMergePrev(rWithPrev) , m_rMergePrev(rWithPrev)
, m_xMergePrevRB(m_xBuilder->weld_radio_button("prev"))
{ {
get(m_pMergePrevRB, "prev"); m_xMergePrevRB->set_active(true);
m_pMergePrevRB->Check();
} }
SwMergeTableDlg::~SwMergeTableDlg() void SwMergeTableDlg::Apply()
{
disposeOnce();
}
void SwMergeTableDlg::dispose()
{ {
m_pMergePrevRB.clear(); m_rMergePrev = m_xMergePrevRB->get_active();
SvxStandardDialog::dispose();
} }
short SwMergeTableDlg::execute()
void SwMergeTableDlg::Apply()
{ {
m_rMergePrev = m_pMergePrevRB->IsChecked(); int nRet = run();
if (nRet == RET_OK)
Apply();
return nRet;
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -19,23 +19,19 @@ ...@@ -19,23 +19,19 @@
#ifndef INCLUDED_SW_SOURCE_UIBASE_INC_MERGETBL_HXX #ifndef INCLUDED_SW_SOURCE_UIBASE_INC_MERGETBL_HXX
#define INCLUDED_SW_SOURCE_UIBASE_INC_MERGETBL_HXX #define INCLUDED_SW_SOURCE_UIBASE_INC_MERGETBL_HXX
#include <vcl/button.hxx> #include <vcl/weld.hxx>
#include <vcl/fixed.hxx> class SwMergeTableDlg : public weld::GenericDialogController
#include <svx/stddlg.hxx>
class SwMergeTableDlg : public SvxStandardDialog
{ {
VclPtr<RadioButton> m_pMergePrevRB; bool& m_rMergePrev;
bool& m_rMergePrev; std::unique_ptr<weld::RadioButton> m_xMergePrevRB;
protected: private:
virtual void Apply() override; void Apply();
public: public:
SwMergeTableDlg( vcl::Window *pParent, bool& rWithPrev ); SwMergeTableDlg(weld::Window *pParent, bool& rWithPrev);
virtual ~SwMergeTableDlg() override; short execute();
virtual void dispose() override;
}; };
#endif #endif
......
...@@ -1050,7 +1050,7 @@ void SwTableShell::Execute(SfxRequest &rReq) ...@@ -1050,7 +1050,7 @@ void SwTableShell::Execute(SfxRequest &rReq)
{ {
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
ScopedVclPtr<VclAbstractDialog> pDlg(pFact->CreateTableMergeDialog(GetView().GetWindow(), bPrev)); ScopedVclPtr<VclAbstractDialog> pDlg(pFact->CreateTableMergeDialog(GetView().GetFrameWeld(), bPrev));
OSL_ENSURE(pDlg, "Dialog creation failed!"); OSL_ENSURE(pDlg, "Dialog creation failed!");
if( RET_OK != pDlg->Execute()) if( RET_OK != pDlg->Execute())
bPrev = bNext = false; bPrev = bNext = false;
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.20.4 -->
<interface domain="sw"> <interface domain="sw">
<!-- interface-requires gtk+ 3.0 --> <requires lib="gtk+" version="3.18"/>
<object class="GtkDialog" id="MergeTableDialog"> <object class="GtkDialog" id="MergeTableDialog">
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="border_width">6</property> <property name="border_width">6</property>
<property name="title" translatable="yes" context="mergetabledialog|MergeTableDialog">Merge Tables</property> <property name="title" translatable="yes" context="mergetabledialog|MergeTableDialog">Merge Tables</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">
...@@ -57,6 +61,7 @@ ...@@ -57,6 +61,7 @@
<property name="expand">False</property> <property name="expand">False</property>
<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>
</packing> </packing>
</child> </child>
</object> </object>
...@@ -95,13 +100,10 @@ ...@@ -95,13 +100,10 @@
<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">next</property>
</object> </object>
<packing> <packing>
<property name="left_attach">0</property> <property name="left_attach">0</property>
<property name="top_attach">0</property> <property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing> </packing>
</child> </child>
<child> <child>
...@@ -118,8 +120,6 @@ ...@@ -118,8 +120,6 @@
<packing> <packing>
<property name="left_attach">0</property> <property name="left_attach">0</property>
<property name="top_attach">1</property> <property name="top_attach">1</property>
<property name="width">1</property>
<property name="height">1</property>
</packing> </packing>
</child> </child>
</object> </object>
...@@ -150,5 +150,8 @@ ...@@ -150,5 +150,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>
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