diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2020-05-20 18:53:39 +0200 |
---|---|---|
committer | Szymon Kłos <szymon.klos@collabora.com> | 2020-05-21 11:19:05 +0200 |
commit | b516387cda854c93af29d270816b8acdb86d4d36 (patch) | |
tree | 438d661a5edb3d1fdae10fb9671013368436e8c9 /cui | |
parent | c0f402da0f3ae8318103fc269e98c25617e83111 (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>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94612
Tested-by: Jenkins
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 | 42 |
4 files changed, 40 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 b4d16c5a92d5..40102bae726a 100644 --- a/cui/source/factory/dlgfact.cxx +++ b/cui/source/factory/dlgfact.cxx @@ -1628,9 +1628,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 38de7db093fc..4f54b03f91d4 100644 --- a/cui/source/factory/dlgfact.hxx +++ b/cui/source/factory/dlgfact.hxx @@ -944,7 +944,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 320b319d315d..9ec717c70ab1 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,44 @@ 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 |