summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2024-01-25 10:19:00 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2024-01-25 10:33:21 +0100
commite5d6133283bacb6bced8cdbedaeae6b3bd2f179e (patch)
treee0676dc2bceeb47fd78fe5154e4644ec3d812e0d /cui
parent2aa773c9bdb8fc89225d251ca2662a328a0d5e6f (diff)
make insert row dialog async
Change-Id: Icb6c2fafe2b47989ff2692956890c87780b117e0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162552 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'cui')
-rw-r--r--cui/source/dialogs/insrc.cxx19
-rw-r--r--cui/source/factory/dlgfact.cxx2
-rw-r--r--cui/source/inc/insrc.hxx17
3 files changed, 33 insertions, 5 deletions
diff --git a/cui/source/dialogs/insrc.cxx b/cui/source/dialogs/insrc.cxx
index 1ff1a14411cb..6c09c8ce4560 100644
--- a/cui/source/dialogs/insrc.cxx
+++ b/cui/source/dialogs/insrc.cxx
@@ -51,9 +51,24 @@ SvxInsRowColDlg::SvxInsRowColDlg(weld::Window* pParent, bool bColumn, const OUSt
m_xDialog->set_help_id(rHelpId);
}
-short SvxInsRowColDlg::Execute()
+short SvxAbstractInsRowColDlg_Impl::Execute()
{
- return run();
+ return m_xDlg->run();
+}
+
+bool SvxAbstractInsRowColDlg_Impl::StartExecuteAsync(AsyncContext &rCtx)
+{
+ return weld::GenericDialogController::runAsync(m_xDlg, rCtx.maEndDialogFn);
+}
+
+bool SvxAbstractInsRowColDlg_Impl::isInsertBefore() const
+{
+ return m_xDlg->isInsertBefore();
+}
+
+sal_uInt16 SvxAbstractInsRowColDlg_Impl::getInsertCount() const
+{
+ return m_xDlg->getInsertCount();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx
index 6979167de569..2392fa46edc6 100644
--- a/cui/source/factory/dlgfact.cxx
+++ b/cui/source/factory/dlgfact.cxx
@@ -1475,7 +1475,7 @@ VclPtr<VclAbstractDialog> AbstractDialogFactory_Impl::CreateOptionsDialog(weld::
VclPtr<SvxAbstractInsRowColDlg> AbstractDialogFactory_Impl::CreateSvxInsRowColDlg(weld::Window* pParent, bool bCol, const OUString& rHelpId)
{
- return VclPtr<SvxInsRowColDlg>::Create(pParent, bCol, rHelpId);
+ return VclPtr<SvxAbstractInsRowColDlg_Impl>::Create(std::make_shared<SvxInsRowColDlg>(pParent, bCol, rHelpId));
}
VclPtr<AbstractPasswordToOpenModifyDialog> AbstractDialogFactory_Impl::CreatePasswordToOpenModifyDialog(
diff --git a/cui/source/inc/insrc.hxx b/cui/source/inc/insrc.hxx
index 597ef172c3e9..9ab7f0fed466 100644
--- a/cui/source/inc/insrc.hxx
+++ b/cui/source/inc/insrc.hxx
@@ -22,7 +22,7 @@
#include <svx/svxdlg.hxx>
#include <vcl/weld.hxx>
-class SvxInsRowColDlg : public SvxAbstractInsRowColDlg, public weld::GenericDialogController
+class SvxInsRowColDlg : public weld::GenericDialogController
{
private:
std::unique_ptr<weld::SpinButton> m_xCountEdit;
@@ -32,8 +32,21 @@ private:
public:
SvxInsRowColDlg(weld::Window* pParent, bool bCol, const OUString& rHelpId);
- virtual short Execute() override;
+ bool isInsertBefore() const;
+ sal_uInt16 getInsertCount() const;
+};
+
+class SvxAbstractInsRowColDlg_Impl final : public SvxAbstractInsRowColDlg
+{
+ std::shared_ptr<SvxInsRowColDlg> m_xDlg;
+public:
+ explicit SvxAbstractInsRowColDlg_Impl(std::shared_ptr<SvxInsRowColDlg> p)
+ : m_xDlg(std::move(p))
+ {
+ }
+ virtual short Execute() override;
+ virtual bool StartExecuteAsync(AsyncContext& rCtx) override;
virtual bool isInsertBefore() const override;
virtual sal_uInt16 getInsertCount() const override;
};