summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-04-02 17:27:05 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-04-02 21:55:07 +0200
commit0c466688fef13295e2a5fcbe23e215b528c4f781 (patch)
tree38619027f0530bf143aa64243a359925a78b1142 /sw
parentcc78e723723bac34a43e5f3ad05947f775abe0db (diff)
weld SwMergeTableDlg
Change-Id: Idbe96bb8150fc695408faa38342237191aceb777 Reviewed-on: https://gerrit.libreoffice.org/52271 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/swabstdlg.hxx2
-rw-r--r--sw/source/ui/dialog/swdlgfact.cxx9
-rw-r--r--sw/source/ui/dialog/swdlgfact.hxx15
-rw-r--r--sw/source/ui/dialog/swuiexp.cxx1
-rw-r--r--sw/source/ui/table/mergetbl.cxx26
-rw-r--r--sw/source/uibase/inc/mergetbl.hxx20
-rw-r--r--sw/source/uibase/shells/tabsh.cxx2
-rw-r--r--sw/uiconfig/swriter/ui/mergetabledialog.ui15
8 files changed, 51 insertions, 39 deletions
diff --git a/sw/inc/swabstdlg.hxx b/sw/inc/swabstdlg.hxx
index aa80546e98f7..d7d95a1fc4fe 100644
--- a/sw/inc/swabstdlg.hxx
+++ b/sw/inc/swabstdlg.hxx
@@ -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,
diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx
index 309a7393ea6a..1d1ad97285a2 100644
--- a/sw/source/ui/dialog/swdlgfact.cxx
+++ b/sw/source/ui/dialog/swdlgfact.cxx
@@ -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,
diff --git a/sw/source/ui/dialog/swdlgfact.hxx b/sw/source/ui/dialog/swdlgfact.hxx
index d2cab9091623..882a5ffb2003 100644
--- a/sw/source/ui/dialog/swdlgfact.hxx
+++ b/sw/source/ui/dialog/swdlgfact.hxx
@@ -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,
diff --git a/sw/source/ui/dialog/swuiexp.cxx b/sw/source/ui/dialog/swuiexp.cxx
index 657801c4af65..c063c8c924cd 100644
--- a/sw/source/ui/dialog/swuiexp.cxx
+++ b/sw/source/ui/dialog/swuiexp.cxx
@@ -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>
diff --git a/sw/source/ui/table/mergetbl.cxx b/sw/source/ui/table/mergetbl.cxx
index b00fca6ca93e..fa51a3b60aa3 100644
--- a/sw/source/ui/table/mergetbl.cxx
+++ b/sw/source/ui/table/mergetbl.cxx
@@ -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: */
diff --git a/sw/source/uibase/inc/mergetbl.hxx b/sw/source/uibase/inc/mergetbl.hxx
index 567cb27cfdd9..986ea3214c75 100644
--- a/sw/source/uibase/inc/mergetbl.hxx
+++ b/sw/source/uibase/inc/mergetbl.hxx
@@ -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
diff --git a/sw/source/uibase/shells/tabsh.cxx b/sw/source/uibase/shells/tabsh.cxx
index 45f4fc36fa83..20e225f61ef5 100644
--- a/sw/source/uibase/shells/tabsh.cxx
+++ b/sw/source/uibase/shells/tabsh.cxx
@@ -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;
diff --git a/sw/uiconfig/swriter/ui/mergetabledialog.ui b/sw/uiconfig/swriter/ui/mergetabledialog.ui
index 0505c7037235..ffecf22b9782 100644
--- a/sw/uiconfig/swriter/ui/mergetabledialog.ui
+++ b/sw/uiconfig/swriter/ui/mergetabledialog.ui
@@ -1,10 +1,14 @@
<?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>