diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-01-23 16:01:03 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-01-23 18:16:18 +0100 |
commit | 0e161e5dcbfb1be0d9aa347de42c72b3578d1e00 (patch) | |
tree | 5f0dd3c12be498c8ff89e33dbe93a453b73bd84d | |
parent | MAR update, too big to (not) fail (diff) | |
download | core-0e161e5dcbfb1be0d9aa347de42c72b3578d1e00.tar.gz core-0e161e5dcbfb1be0d9aa347de42c72b3578d1e00.zip |
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.grandin@collabora.co.uk>
-rw-r--r-- | cui/source/factory/dlgfact.cxx | 7 | ||||
-rw-r--r-- | sc/source/ui/view/tabvwshf.cxx | 13 |
2 files changed, 12 insertions, 8 deletions
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: |