summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2020-08-04 16:18:42 +0200
committerSzymon Kłos <szymon.klos@collabora.com>2020-09-18 09:40:10 +0200
commit300378fb4e99584389e1e9287febf77beaf63f75 (patch)
tree972884fc767c0d4740f6f37a9c5b4f78ead91e2e /sc/source
parent681fb06143e6bbb679282bac071aa3113bc1bd8f (diff)
Make Group dialog async
Change-Id: I37fd6c44d43b0f0b424bd023e13ffa07f601a08b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100119 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102876 Tested-by: Jenkins
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/ui/attrdlg/scdlgfact.cxx7
-rw-r--r--sc/source/ui/attrdlg/scdlgfact.hxx5
-rw-r--r--sc/source/ui/view/cellsh1.cxx38
3 files changed, 37 insertions, 13 deletions
diff --git a/sc/source/ui/attrdlg/scdlgfact.cxx b/sc/source/ui/attrdlg/scdlgfact.cxx
index 071e19038590..a9e9ae359993 100644
--- a/sc/source/ui/attrdlg/scdlgfact.cxx
+++ b/sc/source/ui/attrdlg/scdlgfact.cxx
@@ -483,6 +483,11 @@ void AbstractScFillSeriesDlg_Impl::SetEdStartValEnabled(bool bFlag)
m_xDlg->SetEdStartValEnabled(bFlag);
}
+bool AbstractScGroupDlg_Impl::StartExecuteAsync(VclAbstractDialog::AsyncContext &rCtx)
+{
+ return weld::DialogController::runAsync(m_xDlg, rCtx.maEndDialogFn);
+}
+
bool AbstractScGroupDlg_Impl::GetColsChecked() const
{
return m_xDlg->GetColsChecked();
@@ -1024,7 +1029,7 @@ VclPtr<AbstractScFillSeriesDlg> ScAbstractDialogFactory_Impl::CreateScFillSeries
VclPtr<AbstractScGroupDlg> ScAbstractDialogFactory_Impl::CreateAbstractScGroupDlg(weld::Window* pParent, bool bUnGroup)
{
- return VclPtr<AbstractScGroupDlg_Impl>::Create(std::make_unique<ScGroupDlg>(pParent, bUnGroup, true/*bRows*/));
+ return VclPtr<AbstractScGroupDlg_Impl>::Create(std::make_shared<ScGroupDlg>(pParent, bUnGroup, true/*bRows*/));
}
VclPtr<AbstractScInsertCellDlg> ScAbstractDialogFactory_Impl::CreateScInsertCellDlg(weld::Window* pParent,
diff --git a/sc/source/ui/attrdlg/scdlgfact.hxx b/sc/source/ui/attrdlg/scdlgfact.hxx
index f1d26bf8e65c..65853602d8c5 100644
--- a/sc/source/ui/attrdlg/scdlgfact.hxx
+++ b/sc/source/ui/attrdlg/scdlgfact.hxx
@@ -285,13 +285,14 @@ public:
class AbstractScGroupDlg_Impl : public AbstractScGroupDlg
{
- std::unique_ptr<ScGroupDlg> m_xDlg;
+ std::shared_ptr<ScGroupDlg> m_xDlg;
public:
- explicit AbstractScGroupDlg_Impl(std::unique_ptr<ScGroupDlg> p)
+ explicit AbstractScGroupDlg_Impl(std::shared_ptr<ScGroupDlg> p)
: m_xDlg(std::move(p))
{
}
virtual short Execute() override;
+ virtual bool StartExecuteAsync(VclAbstractDialog::AsyncContext &rCtx) override;
virtual bool GetColsChecked() const override;
};
diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx
index df150de2b0cd..f9c1ab975e35 100644
--- a/sc/source/ui/view/cellsh1.cxx
+++ b/sc/source/ui/view/cellsh1.cxx
@@ -1165,11 +1165,20 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
{
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
- ScopedVclPtr<AbstractScGroupDlg> pDlg(pFact->CreateAbstractScGroupDlg(pTabViewShell->GetFrameWeld()));
- if ( pDlg->Execute() == RET_OK )
- bColumns = pDlg->GetColsChecked();
- else
- bOk = false;
+ VclPtr<AbstractScGroupDlg> pDlg(pFact->CreateAbstractScGroupDlg(pTabViewShell->GetFrameWeld()));
+
+ pDlg->StartExecuteAsync(
+ [pDlg, pTabViewShell] (sal_Int32 nResult) {
+ if( RET_OK == nResult )
+ {
+ bool bColumn = pDlg->GetColsChecked();
+ pTabViewShell->MakeOutline( bColumn );
+ }
+ pDlg->disposeOnce();
+ }
+ );
+
+ bOk = false;
}
}
if (bOk)
@@ -1223,11 +1232,20 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
{
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
- ScopedVclPtr<AbstractScGroupDlg> pDlg(pFact->CreateAbstractScGroupDlg(pTabViewShell->GetFrameWeld(), true));
- if ( pDlg->Execute() == RET_OK )
- bColumns = pDlg->GetColsChecked();
- else
- bOk = false;
+ VclPtr<AbstractScGroupDlg> pDlg(pFact->CreateAbstractScGroupDlg(pTabViewShell->GetFrameWeld(), true));
+
+ pDlg->StartExecuteAsync(
+ [pDlg, pTabViewShell] (sal_Int32 nResult) {
+ if( RET_OK == nResult )
+ {
+ bool bColumn = pDlg->GetColsChecked();
+ pTabViewShell->RemoveOutline( bColumn );
+ }
+ pDlg->disposeOnce();
+ }
+ );
+
+ bOk = false;
}
else if ( bColPoss )
bColumns = true;