diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2020-05-20 18:53:39 +0200 |
---|---|---|
committer | Szymon Kłos <eszkadev@gmail.com> | 2020-05-21 09:16:47 +0200 |
commit | 8eadedd70a5cef10126abd061a02e57501aa0bc0 (patch) | |
tree | e1e0c6793df924dd122f6a72cf0ba6430583c5a7 /cui | |
parent | fbd274a72d995c41bca7c12a9719e6d4e4884324 (diff) |
Make Impress Insert Table dialog async
Change-Id: If8b48cfe983819387c066d3bd81a42dad8947489
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94591
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/dialogs/newtabledlg.cxx | 10 | ||||
-rw-r--r-- | cui/source/factory/dlgfact.cxx | 4 | ||||
-rw-r--r-- | cui/source/factory/dlgfact.hxx | 2 | ||||
-rw-r--r-- | cui/source/inc/newtabledlg.hxx | 41 |
4 files changed, 39 insertions, 18 deletions
diff --git a/cui/source/dialogs/newtabledlg.cxx b/cui/source/dialogs/newtabledlg.cxx index af4d91f1b1c5..16e81f8d90ea 100644 --- a/cui/source/dialogs/newtabledlg.cxx +++ b/cui/source/dialogs/newtabledlg.cxx @@ -26,16 +26,6 @@ SvxNewTableDialog::SvxNewTableDialog(weld::Window* pWindow) { } -SvxNewTableDialog::~SvxNewTableDialog() -{ - disposeOnce(); -} - -short SvxNewTableDialog::Execute() -{ - return m_xDialog->run(); -} - sal_Int32 SvxNewTableDialog::getRows() const { return sal::static_int_cast< sal_Int32 >( mxNumRows->get_value() ); diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx index 80e28b271b63..5c1979943ac3 100644 --- a/cui/source/factory/dlgfact.cxx +++ b/cui/source/factory/dlgfact.cxx @@ -1607,9 +1607,9 @@ VclPtr<SvxAbstractSplitTableDialog> AbstractDialogFactory_Impl::CreateSvxSplitTa return VclPtr<SvxSplitTableDlg>::Create( pParent, bIsTableVertical, nMaxVertical, 99 ); } -VclPtr<SvxAbstractNewTableDialog> AbstractDialogFactory_Impl::CreateSvxNewTableDialog(weld::Window* pParent) +std::shared_ptr<SvxAbstractNewTableDialog> AbstractDialogFactory_Impl::CreateSvxNewTableDialog(weld::Window* pParent) { - return VclPtr<SvxNewTableDialog>::Create(pParent); + return std::make_shared<SvxNewTableDialogWrapper>(pParent); } VclPtr<VclAbstractDialog> AbstractDialogFactory_Impl::CreateOptionsDialog(weld::Window* pParent, const OUString& rExtensionId) diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx index 174417214907..c7e66c44556d 100644 --- a/cui/source/factory/dlgfact.hxx +++ b/cui/source/factory/dlgfact.hxx @@ -926,7 +926,7 @@ public: virtual VclPtr<SvxAbstractSplitTableDialog> CreateSvxSplitTableDialog(weld::Window* pParent, bool bIsTableVertical, long nMaxVertical) override; - virtual VclPtr<SvxAbstractNewTableDialog> CreateSvxNewTableDialog(weld::Window* pParent) override ; + virtual std::shared_ptr<SvxAbstractNewTableDialog> CreateSvxNewTableDialog(weld::Window* pParent) override ; virtual VclPtr<VclAbstractDialog> CreateOptionsDialog( weld::Window* pParent, const OUString& rExtensionId ) override; diff --git a/cui/source/inc/newtabledlg.hxx b/cui/source/inc/newtabledlg.hxx index cad953779b12..9a05f8aa3afe 100644 --- a/cui/source/inc/newtabledlg.hxx +++ b/cui/source/inc/newtabledlg.hxx @@ -22,7 +22,7 @@ #include <svx/svxdlg.hxx> #include <vcl/weld.hxx> -class SvxNewTableDialog : public SvxAbstractNewTableDialog, public weld::GenericDialogController +class SvxNewTableDialog : public weld::GenericDialogController { private: std::unique_ptr<weld::SpinButton> mxNumColumns; @@ -30,12 +30,43 @@ private: public: SvxNewTableDialog(weld::Window* pParent); - virtual ~SvxNewTableDialog() override; - virtual short Execute() override; + virtual sal_Int32 getRows() const; + virtual sal_Int32 getColumns() const; +}; + +class SvxNewTableDialogWrapper : public SvxAbstractNewTableDialog +{ +private: + std::shared_ptr<weld::DialogController> m_xDlg; + +public: + SvxNewTableDialogWrapper(weld::Window* pParent) + : m_xDlg(std::make_shared<SvxNewTableDialog>(pParent)) + {} + + virtual std::shared_ptr<weld::DialogController> getDialogController() override + { + return m_xDlg; + } + + virtual sal_Int32 getRows() const override + { + SvxNewTableDialog* pDlg = dynamic_cast<SvxNewTableDialog*>(m_xDlg.get()); + if (pDlg) + return pDlg->getRows(); + + return 0; + } + + virtual sal_Int32 getColumns() const override + { + SvxNewTableDialog* pDlg = dynamic_cast<SvxNewTableDialog*>(m_xDlg.get()); + if (pDlg) + return pDlg->getColumns(); - virtual sal_Int32 getRows() const override; - virtual sal_Int32 getColumns() const override; + return 0; + } }; #endif // INCLUDED_CUI_SOURCE_INC_NEWTABLEDLG_HXX |