diff options
author | Jan Holesovsky <kendy@collabora.com> | 2018-01-17 20:15:22 +0100 |
---|---|---|
committer | pranavk <pranavk@collabora.co.uk> | 2018-01-18 14:08:03 +0100 |
commit | 8e1d11a0328c4162241734d2472238b09898d5a1 (patch) | |
tree | e1cc93fa136c72c8cf4c2cab47daed2a768a154d /sd | |
parent | 63bdc9b8645803b1d9e486734cd3fdd14ac0c185 (diff) |
lokdialog: Convert the Format -> ... -> Area... to async exec.
Change-Id: I3756bd472b4e54db1d1c9da382d5d655f472bdb7
Reviewed-on: https://gerrit.libreoffice.org/48119
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/ui/func/fuarea.cxx | 60 | ||||
-rw-r--r-- | sd/source/ui/view/drviews2.cxx | 2 |
2 files changed, 34 insertions, 28 deletions
diff --git a/sd/source/ui/func/fuarea.cxx b/sd/source/ui/func/fuarea.cxx index ac4fff67a62d..b7764c4893d4 100644 --- a/sd/source/ui/func/fuarea.cxx +++ b/sd/source/ui/func/fuarea.cxx @@ -52,39 +52,45 @@ rtl::Reference<FuPoor> FuArea::Create( ViewShell* pViewSh, ::sd::Window* pWin, : void FuArea::DoExecute( SfxRequest& rReq ) { - const SfxItemSet* pArgs = rReq.GetArgs(); + rReq.Ignore (); - if( !pArgs ) + const SfxItemSet* pArgs = rReq.GetArgs(); + if (pArgs) { - 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) ) - { - mpView->SetAttributes (*(pDlg->GetOutputItemSet ())); - } + mpViewShell->Cancel(); + return; + } - // attributes changed, update Listboxes in Objectbars - static sal_uInt16 SidArray[] = { - SID_ATTR_FILL_STYLE, - SID_ATTR_FILL_COLOR, - SID_ATTR_FILL_GRADIENT, - SID_ATTR_FILL_HATCH, - SID_ATTR_FILL_BITMAP, - SID_ATTR_FILL_TRANSPARENCE, - SID_ATTR_FILL_FLOATTRANSPARENCE, - 0 }; - - mpViewShell->GetViewFrame()->GetBindings().Invalidate( SidArray ); + SfxItemSet aNewAttr( mpDoc->GetPool() ); + mpView->GetAttributes( aNewAttr ); + + SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); + VclPtr<AbstractSvxAreaTabDialog> pDlg(pFact ? pFact->CreateSvxAreaTabDialog(nullptr, &aNewAttr, mpDoc, true) : nullptr); + if (!pDlg) + { + mpViewShell->Cancel(); + return; } - rReq.Ignore (); + pDlg->StartExecuteAsync([=](sal_Int32 nResult){ + if (nResult == RET_OK) + { + mpView->SetAttributes (*(pDlg->GetOutputItemSet ())); + // attributes changed, update Listboxes in Objectbars + static const sal_uInt16 SidArray[] = { + SID_ATTR_FILL_STYLE, + SID_ATTR_FILL_COLOR, + SID_ATTR_FILL_GRADIENT, + SID_ATTR_FILL_HATCH, + SID_ATTR_FILL_BITMAP, + SID_ATTR_FILL_TRANSPARENCE, + SID_ATTR_FILL_FLOATTRANSPARENCE, + 0 }; + + mpViewShell->GetViewFrame()->GetBindings().Invalidate( SidArray ); + } + }, pDlg); } void FuArea::Activate() diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx index 22a07f8c960a..6e9bc31b03e0 100644 --- a/sd/source/ui/view/drviews2.cxx +++ b/sd/source/ui/view/drviews2.cxx @@ -1018,7 +1018,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; |