cui/source/factory/dlgfact.cxx | 7 ++++--- sc/source/ui/view/tabvwshf.cxx | 13 ++++++++----- 2 files changed, 12 insertions(+), 8 deletions(-)
New commits: commit 0e161e5dcbfb1be0d9aa347de42c72b3578d1e00 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Tue Jan 23 16:01:03 2024 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Tue Jan 23 18:16:18 2024 +0100 make the macro assign dialog async Change-Id: I6a23f648784f61e72e6095b249719d9c8630252f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162444 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx index a856d84c6901..b5e852cbb292 100644 --- a/cui/source/factory/dlgfact.cxx +++ b/cui/source/factory/dlgfact.cxx @@ -1236,17 +1236,18 @@ public: :m_aItems( SfxGetpApp()->GetPool(), svl::Items<SID_ATTR_MACROITEM, SID_ATTR_MACROITEM> ) { m_aItems.Put( SfxBoolItem( SID_ATTR_MACROITEM, _bUnoDialogMode ) ); - m_xDlg.reset(new SvxMacroAssignDlg(_pParent, _rxDocumentFrame, m_aItems, _rxEvents, _nInitiallySelectedEvent)); + m_xDlg = std::make_shared<SvxMacroAssignDlg>(_pParent, _rxDocumentFrame, m_aItems, _rxEvents, _nInitiallySelectedEvent); } virtual short Execute() override; + virtual bool StartExecuteAsync(VclAbstractDialog::AsyncContext &rCtx) override; private: SfxItemSet m_aItems; - std::unique_ptr<SvxMacroAssignDlg> m_xDlg; + std::shared_ptr<SvxMacroAssignDlg> m_xDlg; }; -IMPL_ABSTDLG_CLASS(SvxMacroAssignDialog) +IMPL_ABSTDLG_CLASS_ASYNC(SvxMacroAssignDialog, SvxMacroAssignDlg) } diff --git a/sc/source/ui/view/tabvwshf.cxx b/sc/source/ui/view/tabvwshf.cxx index e3ca4fb5418d..a41840d5d97e 100644 --- a/sc/source/ui/view/tabvwshf.cxx +++ b/sc/source/ui/view/tabvwshf.cxx @@ -1038,12 +1038,15 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq ) uno::Reference<container::XNameReplace> xEvents( new ScSheetEventsObj( pDocSh, nCurrentTab ) ); uno::Reference<frame::XFrame> xFrame = GetViewFrame().GetFrame().GetFrameInterface(); SvxAbstractDialogFactory* pDlgFactory = SvxAbstractDialogFactory::Create(); - ScopedVclPtr<VclAbstractDialog> pDialog( pDlgFactory->CreateSvxMacroAssignDlg( + VclPtr<VclAbstractDialog> pDialog( pDlgFactory->CreateSvxMacroAssignDlg( GetFrameWeld(), xFrame, false, xEvents, 0 ) ); - if ( pDialog->Execute() == RET_OK ) - { - // the dialog modifies the settings directly - } + // the dialog modifies the settings directly + pDialog->StartExecuteAsync( + [pDialog] (sal_Int32 /*nResult*/)->void + { + pDialog->disposeOnce(); + } + ); } break; case FID_TOGGLEHIDDENCOLROW: