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:
css::uno::Reference< css::container::XNameAccess > & xNameAccess) = 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,
SfxViewFrame *pFrame, vcl::Window *pParent,
const SfxItemSet& rCoreSet,
......
......@@ -111,6 +111,10 @@ short AbstractSwTableHeightDlg_Impl::Execute()
{
return m_xDlg->execute();
}
short AbstractSwMergeTableDlg_Impl::Execute()
{
return m_xDlg->execute();
}
short AbstractSwSortDlg_Impl::Execute()
{
return m_xDlg->execute();
......@@ -887,10 +891,9 @@ VclPtr<AbstractSwModalRedlineAcceptDlg> SwAbstractDialogFactory_Impl::CreateSwMo
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<VclAbstractDialog_Impl>::Create( pDlg );
return VclPtr<AbstractSwMergeTableDlg_Impl>::Create(new SwMergeTableDlg(pParent, rWithPrev));
}
VclPtr<SfxAbstractTabDialog> SwAbstractDialogFactory_Impl::CreateFrameTabDialog(const OUString &rDialogType,
......
......@@ -28,6 +28,7 @@ class SwBreakDlg;
class SwSortDlg;
class SwTableHeightDlg;
class SwTableWidthDlg;
class SwMergeTableDlg;
class SignatureLineDialog;
class SfxTabDialog;
class SwConvertTableDlg;
......@@ -168,6 +169,18 @@ public:
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
{
protected:
......@@ -523,7 +536,7 @@ public:
css::uno::Reference< css::container::XNameAccess > & xNameAccess) 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,
SfxViewFrame *pFrame, vcl::Window *pParent,
const SfxItemSet& rCoreSet,
......
......@@ -36,6 +36,7 @@
#include <label.hxx>
#include <mailmrge.hxx>
#include <mailmergewizard.hxx>
#include <mergetbl.hxx>
#include <regionsw.hxx>
#include <rowht.hxx>
#include <selglos.hxx>
......
......@@ -20,29 +20,25 @@
#include <swtypes.hxx>
#include <mergetbl.hxx>
SwMergeTableDlg::SwMergeTableDlg( vcl::Window *pParent, bool& rWithPrev )
: SvxStandardDialog(pParent, "MergeTableDialog", "modules/swriter/ui/mergetabledialog.ui")
SwMergeTableDlg::SwMergeTableDlg(weld::Window *pParent, bool& rWithPrev)
: GenericDialogController(pParent, "modules/swriter/ui/mergetabledialog.ui", "MergeTableDialog")
, m_rMergePrev(rWithPrev)
, m_xMergePrevRB(m_xBuilder->weld_radio_button("prev"))
{
get(m_pMergePrevRB, "prev");
m_pMergePrevRB->Check();
m_xMergePrevRB->set_active(true);
}
SwMergeTableDlg::~SwMergeTableDlg()
{
disposeOnce();
}
void SwMergeTableDlg::dispose()
void SwMergeTableDlg::Apply()
{
m_pMergePrevRB.clear();
SvxStandardDialog::dispose();
m_rMergePrev = m_xMergePrevRB->get_active();
}
void SwMergeTableDlg::Apply()
short SwMergeTableDlg::execute()
{
m_rMergePrev = m_pMergePrevRB->IsChecked();
int nRet = run();
if (nRet == RET_OK)
Apply();
return nRet;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -19,23 +19,19 @@
#ifndef 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>
#include <svx/stddlg.hxx>
class SwMergeTableDlg : public SvxStandardDialog
class SwMergeTableDlg : public weld::GenericDialogController
{
VclPtr<RadioButton> m_pMergePrevRB;
bool& m_rMergePrev;
bool& m_rMergePrev;
protected:
virtual void Apply() override;
std::unique_ptr<weld::RadioButton> m_xMergePrevRB;
private:
void Apply();
public:
SwMergeTableDlg( vcl::Window *pParent, bool& rWithPrev );
virtual ~SwMergeTableDlg() override;
virtual void dispose() override;
SwMergeTableDlg(weld::Window *pParent, bool& rWithPrev);
short execute();
};
#endif
......
......@@ -1050,7 +1050,7 @@ void SwTableShell::Execute(SfxRequest &rReq)
{
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
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!");
if( RET_OK != pDlg->Execute())
bPrev = bNext = false;
......
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.20.4 -->
<interface domain="sw">
<!-- interface-requires gtk+ 3.0 -->
<requires lib="gtk+" version="3.18"/>
<object class="GtkDialog" id="MergeTableDialog">
<property name="can_focus">False</property>
<property name="border_width">6</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>
<child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox1">
......@@ -57,6 +61,7 @@
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
<property name="secondary">True</property>
</packing>
</child>
</object>
......@@ -95,13 +100,10 @@
<property name="xalign">0</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
<property name="group">next</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
......@@ -118,8 +120,6 @@
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
</object>
......@@ -150,5 +150,8 @@
<action-widget response="-6">cancel</action-widget>
<action-widget response="-11">help</action-widget>
</action-widgets>
<child>
<placeholder/>
</child>
</object>
</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