diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-03-01 16:38:02 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-03-01 22:15:39 +0100 |
commit | a1a0bcc5c4c011c0aa1339ca5dde1c9a2481c91a (patch) | |
tree | d784da8b406a35b60949b1e830ed89add56914a4 /cui/source | |
parent | 6e12191749542d81f9b29f34148cbc8c511748d2 (diff) |
weld insert row/column dialog
Change-Id: Ib035e4ea18e65558e6b7cd7d7ebb643f68241ead
Reviewed-on: https://gerrit.libreoffice.org/50594
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 'cui/source')
-rw-r--r-- | cui/source/dialogs/insrc.cxx | 36 | ||||
-rw-r--r-- | cui/source/factory/dlgfact.cxx | 4 | ||||
-rw-r--r-- | cui/source/factory/dlgfact.hxx | 2 | ||||
-rw-r--r-- | cui/source/inc/insrc.hxx | 22 |
4 files changed, 23 insertions, 41 deletions
diff --git a/cui/source/dialogs/insrc.cxx b/cui/source/dialogs/insrc.cxx index 8bd342152d33..01e2335e6c8f 100644 --- a/cui/source/dialogs/insrc.cxx +++ b/cui/source/dialogs/insrc.cxx @@ -19,49 +19,37 @@ #include <dialmgr.hxx> #include <svx/svxdlg.hxx> +#include <vcl/svapp.hxx> #include <strings.hrc> #include <insrc.hxx> bool SvxInsRowColDlg::isInsertBefore() const { - return !m_pAfterBtn->IsChecked(); + return !m_xAfterBtn->get_active(); } sal_uInt16 SvxInsRowColDlg::getInsertCount() const { - return static_cast< sal_uInt16 >( m_pCountEdit->GetValue() ); + return m_xCountEdit->get_value(); } -SvxInsRowColDlg::SvxInsRowColDlg(vcl::Window* pParent, bool bCol, const OString& sHelpId ) - : m_pDialog(VclPtr<ModalDialog>::Create(pParent, "InsertRowColumnDialog", "cui/ui/insertrowcolumn.ui")) +SvxInsRowColDlg::SvxInsRowColDlg(weld::Window* pParent, bool bCol, const OString& rHelpId) + : m_xBuilder(Application::CreateBuilder(pParent, "cui/ui/insertrowcolumn.ui")) + , m_xDialog(m_xBuilder->weld_dialog("InsertRowColumnDialog")) + , m_xCountEdit(m_xBuilder->weld_spin_button("insert_number")) + , m_xBeforeBtn(m_xBuilder->weld_radio_button("insert_before")) + , m_xAfterBtn(m_xBuilder->weld_radio_button("insert_after")) , aRow(CuiResId(RID_SVXSTR_ROW)) , aCol(CuiResId(RID_SVXSTR_COL)) , bColumn(bCol) { - m_pDialog->get(m_pCountEdit, "insert_number"); - m_pDialog->get(m_pBeforeBtn, "insert_before"); - m_pDialog->get(m_pAfterBtn, "insert_after"); - m_pDialog->SetText( bColumn ? aCol : aRow ); - m_pDialog->SetHelpId( sHelpId ); -} - -SvxInsRowColDlg::~SvxInsRowColDlg() -{ - disposeOnce(); -} - -void SvxInsRowColDlg::dispose() -{ - m_pCountEdit.clear(); - m_pBeforeBtn.clear(); - m_pAfterBtn.clear(); - m_pDialog.disposeAndClear(); - SvxAbstractInsRowColDlg::dispose(); + m_xDialog->set_title(bColumn ? aCol : aRow); + m_xDialog->set_help_id(rHelpId); } short SvxInsRowColDlg::Execute() { - return m_pDialog->Execute(); + return m_xDialog->run(); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx index 863753ce99bd..365fd949c9e9 100644 --- a/cui/source/factory/dlgfact.cxx +++ b/cui/source/factory/dlgfact.cxx @@ -1504,9 +1504,9 @@ VclPtr<VclAbstractDialog> AbstractDialogFactory_Impl::CreateOptionsDialog( return VclPtr<CuiVclAbstractDialog_Impl>::Create( VclPtr<OfaTreeOptionsDialog>::Create( pParent, rExtensionId ) ); } -VclPtr<SvxAbstractInsRowColDlg> AbstractDialogFactory_Impl::CreateSvxInsRowColDlg( vcl::Window* pParent, bool bCol, const OString& sHelpId ) +VclPtr<SvxAbstractInsRowColDlg> AbstractDialogFactory_Impl::CreateSvxInsRowColDlg(weld::Window* pParent, bool bCol, const OString& rHelpId) { - return VclPtr<SvxInsRowColDlg>::Create( pParent, bCol, sHelpId ); + return VclPtr<SvxInsRowColDlg>::Create(pParent, bCol, rHelpId); } VclPtr<AbstractPasswordToOpenModifyDialog> AbstractDialogFactory_Impl::CreatePasswordToOpenModifyDialog( diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx index 800f02f1f27a..ca7273273d50 100644 --- a/cui/source/factory/dlgfact.hxx +++ b/cui/source/factory/dlgfact.hxx @@ -624,7 +624,7 @@ public: virtual VclPtr<VclAbstractDialog> CreateOptionsDialog( vcl::Window* pParent, const OUString& rExtensionId ) override; - virtual VclPtr<SvxAbstractInsRowColDlg> CreateSvxInsRowColDlg( vcl::Window* pParent, bool bCol, const OString& sHelpId ) override; + virtual VclPtr<SvxAbstractInsRowColDlg> CreateSvxInsRowColDlg(weld::Window* pParent, bool bCol, const OString& rHelpId) override; virtual VclPtr<AbstractPasswordToOpenModifyDialog> CreatePasswordToOpenModifyDialog(vcl::Window * pParent, sal_uInt16 nMaxPasswdLen, bool bIsPasswordToModify) override; diff --git a/cui/source/inc/insrc.hxx b/cui/source/inc/insrc.hxx index e6fa2a01b94f..b2e9cb96b70d 100644 --- a/cui/source/inc/insrc.hxx +++ b/cui/source/inc/insrc.hxx @@ -21,21 +21,17 @@ #include <rtl/string.hxx> #include <rtl/ustring.hxx> - #include <svx/stddlg.hxx> - -#include <vcl/fixed.hxx> -#include <vcl/field.hxx> -#include <vcl/group.hxx> -#include <vcl/button.hxx> +#include <vcl/weld.hxx> class SvxInsRowColDlg : public SvxAbstractInsRowColDlg { - VclPtr<ModalDialog> m_pDialog; - VclPtr<NumericField> m_pCountEdit; - - VclPtr<RadioButton> m_pBeforeBtn; - VclPtr<RadioButton> m_pAfterBtn; +private: + std::unique_ptr<weld::Builder> m_xBuilder; + std::unique_ptr<weld::Dialog> m_xDialog; + std::unique_ptr<weld::SpinButton> m_xCountEdit; + std::unique_ptr<weld::RadioButton> m_xBeforeBtn; + std::unique_ptr<weld::RadioButton> m_xAfterBtn; OUString aRow; OUString aCol; @@ -43,9 +39,7 @@ class SvxInsRowColDlg : public SvxAbstractInsRowColDlg bool bColumn; public: - SvxInsRowColDlg( vcl::Window* pParent, bool bCol, const OString& sHelpId ); - virtual ~SvxInsRowColDlg() override; - virtual void dispose() override; + SvxInsRowColDlg(weld::Window* pParent, bool bCol, const OString& rHelpId); virtual short Execute() override; |