sc/inc/scabstdlg.hxx | 7 +++--- sc/source/ui/attrdlg/scdlgfact.cxx | 15 ++++++-------- sc/source/ui/attrdlg/scdlgfact.hxx | 6 ++--- sc/source/ui/view/cellsh1.cxx | 38 +++++++++++++++++++++++++++---------- 4 files changed, 42 insertions(+), 24 deletions(-)
New commits: commit 34b0e97c25a943c2e4ba98750b970bee542f5819 Author: Szymon Kłos <szymon.k...@collabora.com> AuthorDate: Tue Aug 4 16:18:42 2020 +0200 Commit: Szymon Kłos <szymon.k...@collabora.com> CommitDate: Wed Aug 5 09:40:57 2020 +0200 Make Group dialog async Change-Id: I37fd6c44d43b0f0b424bd023e13ffa07f601a08b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100119 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Szymon Kłos <szymon.k...@collabora.com> diff --git a/sc/inc/scabstdlg.hxx b/sc/inc/scabstdlg.hxx index 2991a224f3ea..a72573c808b9 100644 --- a/sc/inc/scabstdlg.hxx +++ b/sc/inc/scabstdlg.hxx @@ -173,12 +173,13 @@ public: virtual void SetEdStartValEnabled(bool bFlag) = 0; }; -class AbstractScGroupDlg : public VclAbstractDialog +class AbstractScGroupDlg { protected: - virtual ~AbstractScGroupDlg() override = default; + virtual ~AbstractScGroupDlg() = default; public: virtual bool GetColsChecked() const = 0; + virtual std::shared_ptr<weld::DialogController> getDialogController() = 0; }; class AbstractScInsertCellDlg : public VclAbstractDialog @@ -445,7 +446,7 @@ public: double fMax, sal_uInt16 nPossDir) = 0; - virtual VclPtr<AbstractScGroupDlg> CreateAbstractScGroupDlg(weld::Window* pParent, bool bUnGroup = false) = 0; + virtual std::shared_ptr<AbstractScGroupDlg> CreateAbstractScGroupDlg(weld::Window* pParent, bool bUnGroup = false) = 0; virtual VclPtr<AbstractScInsertCellDlg> CreateScInsertCellDlg(weld::Window* pParent, bool bDisallowCellMove) = 0; diff --git a/sc/source/ui/attrdlg/scdlgfact.cxx b/sc/source/ui/attrdlg/scdlgfact.cxx index 238a46fb725e..ab717e1ee05e 100644 --- a/sc/source/ui/attrdlg/scdlgfact.cxx +++ b/sc/source/ui/attrdlg/scdlgfact.cxx @@ -148,11 +148,6 @@ short AbstractScFillSeriesDlg_Impl::Execute() return m_xDlg->run(); } -short AbstractScGroupDlg_Impl::Execute() -{ - return m_xDlg->run(); -} - short AbstractScInsertCellDlg_Impl::Execute() { return m_xDlg->run(); @@ -493,7 +488,11 @@ void AbstractScFillSeriesDlg_Impl::SetEdStartValEnabled(bool bFlag) bool AbstractScGroupDlg_Impl::GetColsChecked() const { - return m_xDlg->GetColsChecked(); + ScGroupDlg* pDlg = dynamic_cast<ScGroupDlg*>(m_xDlg.get()); + if (pDlg) + return pDlg->GetColsChecked(); + + return false; } InsCellCmd AbstractScInsertCellDlg_Impl::GetInsCellCmd() const @@ -1034,9 +1033,9 @@ VclPtr<AbstractScFillSeriesDlg> ScAbstractDialogFactory_Impl::CreateScFillSeries return VclPtr<AbstractScFillSeriesDlg_Impl>::Create(std::make_unique<ScFillSeriesDlg>(pParent, rDocument,eFillDir, eFillCmd,eFillDateCmd, aStartStr,fStep,fMax,nPossDir)); } -VclPtr<AbstractScGroupDlg> ScAbstractDialogFactory_Impl::CreateAbstractScGroupDlg(weld::Window* pParent, bool bUnGroup) +std::shared_ptr<AbstractScGroupDlg> ScAbstractDialogFactory_Impl::CreateAbstractScGroupDlg(weld::Window* pParent, bool bUnGroup) { - return VclPtr<AbstractScGroupDlg_Impl>::Create(std::make_unique<ScGroupDlg>(pParent, bUnGroup, true/*bRows*/)); + return std::make_shared<AbstractScGroupDlg_Impl>(std::make_unique<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 aa9c28a35ebb..4f8987bc4e1a 100644 --- a/sc/source/ui/attrdlg/scdlgfact.hxx +++ b/sc/source/ui/attrdlg/scdlgfact.hxx @@ -285,14 +285,14 @@ public: class AbstractScGroupDlg_Impl : public AbstractScGroupDlg { - std::unique_ptr<ScGroupDlg> m_xDlg; + std::shared_ptr<weld::DialogController> m_xDlg; public: explicit AbstractScGroupDlg_Impl(std::unique_ptr<ScGroupDlg> p) : m_xDlg(std::move(p)) { } - virtual short Execute() override; virtual bool GetColsChecked() const override; + virtual std::shared_ptr<weld::DialogController> getDialogController() override { return m_xDlg; } }; class AbstractScInsertCellDlg_Impl : public AbstractScInsertCellDlg @@ -714,7 +714,7 @@ public: double fStep, double fMax, sal_uInt16 nPossDir) override; - virtual VclPtr<AbstractScGroupDlg> CreateAbstractScGroupDlg(weld::Window* pParent, bool bUnGroup = false) override; + virtual std::shared_ptr<AbstractScGroupDlg> CreateAbstractScGroupDlg(weld::Window* pParent, bool bUnGroup = false) override; virtual VclPtr<AbstractScInsertCellDlg> CreateScInsertCellDlg(weld::Window* pParent, bool bDisallowCellMove) override; diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx index 5873272f1dfe..e715c721c721 100644 --- a/sc/source/ui/view/cellsh1.cxx +++ b/sc/source/ui/view/cellsh1.cxx @@ -1160,11 +1160,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; + std::shared_ptr<AbstractScGroupDlg> pDlg(pFact->CreateAbstractScGroupDlg(pTabViewShell->GetFrameWeld())); + std::shared_ptr<weld::DialogController> pDialogController(pDlg->getDialogController()); + + weld::DialogController::runAsync(pDialogController, + [pDlg, pTabViewShell] (sal_Int32 nResult) { + if( RET_OK == nResult ) + { + bool bColumn = pDlg->GetColsChecked(); + pTabViewShell->MakeOutline( bColumn ); + } + } + ); + + bOk = false; } } if (bOk) @@ -1218,11 +1227,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; + std::shared_ptr<AbstractScGroupDlg> pDlg(pFact->CreateAbstractScGroupDlg(pTabViewShell->GetFrameWeld(), true)); + std::shared_ptr<weld::DialogController> pDialogController(pDlg->getDialogController()); + + weld::DialogController::runAsync(pDialogController, + [pDlg, pTabViewShell] (sal_Int32 nResult) { + if( RET_OK == nResult ) + { + bool bColumn = pDlg->GetColsChecked(); + pTabViewShell->RemoveOutline( bColumn ); + } + } + ); + + bOk = false; } else if ( bColPoss ) bColumns = true; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits