diff options
author | Jan Holesovsky <kendy@collabora.com> | 2018-01-17 20:15:22 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2018-03-22 16:18:52 +0100 |
commit | bc07afdc5db575ce87374cde1d21f6a09fe528f2 (patch) | |
tree | 999ab5e0e0bb7e3e0dbeda3ad21d71a3e4669802 /sd/source | |
parent | 5663295a16340b7d122991300831388edf45eb18 (diff) |
lokdialog: Convert the Format -> ... -> Area... to async exec.
Change-Id: I3756bd472b4e54db1d1c9da382d5d655f472bdb7
Reviewed-on: https://gerrit.libreoffice.org/48080
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
(cherry picked from commit b479e9625475e87546b7945732a0e66a2a9dbb1f)
Diffstat (limited to 'sd/source')
-rw-r--r-- | sd/source/ui/func/fuarea.cxx | 34 | ||||
-rw-r--r-- | sd/source/ui/view/drviews2.cxx | 2 |
2 files changed, 21 insertions, 15 deletions
diff --git a/sd/source/ui/func/fuarea.cxx b/sd/source/ui/func/fuarea.cxx index 1e891416483a..1d9197871071 100644 --- a/sd/source/ui/func/fuarea.cxx +++ b/sd/source/ui/func/fuarea.cxx @@ -52,19 +52,28 @@ rtl::Reference<FuPoor> FuArea::Create( ViewShell* pViewSh, ::sd::Window* pWin, : void FuArea::DoExecute( SfxRequest& rReq ) { + rReq.Ignore (); + const SfxItemSet* pArgs = rReq.GetArgs(); + if (pArgs) + { + mpViewShell->Cancel(); + return; + } + + SfxItemSet aNewAttr( mpDoc->GetPool() ); + mpView->GetAttributes( aNewAttr ); - if( !pArgs ) + SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); + VclPtr<AbstractSvxAreaTabDialog> pDlg(pFact ? pFact->CreateSvxAreaTabDialog(nullptr, &aNewAttr, mpDoc, true) : nullptr); + if (!pDlg) { - SfxItemSet aNewAttr( mpDoc->GetPool() ); - mpView->GetAttributes( aNewAttr ); - - SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - ScopedVclPtr<AbstractSvxAreaTabDialog> pDlg(pFact ? pFact->CreateSvxAreaTabDialog( nullptr, - &aNewAttr, - mpDoc, - true) : nullptr); - if( pDlg && (pDlg->Execute() == RET_OK) ) + mpViewShell->Cancel(); + return; + } + + pDlg->StartExecuteAsync([=](sal_Int32 nResult){ + if (nResult == RET_OK) { mpView->SetAttributes (*(pDlg->GetOutputItemSet ())); @@ -81,10 +90,7 @@ void FuArea::DoExecute( SfxRequest& rReq ) mpViewShell->GetViewFrame()->GetBindings().Invalidate( SidArray ); } - } - - rReq.Ignore (); - + }, pDlg); } void FuArea::Activate() diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx index a3b1bcc9c355..1979cb91bcb4 100644 --- a/sd/source/ui/view/drviews2.cxx +++ b/sd/source/ui/view/drviews2.cxx @@ -1374,7 +1374,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) case SID_ATTRIBUTES_AREA: // BASIC { SetCurrentFunction( FuArea::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq ) ); - Cancel(); + // Cancel() called directly in FuTransform::Create() } break; |