sd/source/ui/func/fuarea.cxx | 60 ++++++++++++++++++++++------------------- sd/source/ui/view/drviews2.cxx | 2 - 2 files changed, 34 insertions(+), 28 deletions(-)
New commits: commit 8e1d11a0328c4162241734d2472238b09898d5a1 Author: Jan Holesovsky <ke...@collabora.com> Date: Wed Jan 17 20:15:22 2018 +0100 lokdialog: Convert the Format -> ... -> Area... to async exec. Change-Id: I3756bd472b4e54db1d1c9da382d5d655f472bdb7 Reviewed-on: https://gerrit.libreoffice.org/48119 Reviewed-by: pranavk <pran...@collabora.co.uk> Tested-by: pranavk <pran...@collabora.co.uk> 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; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits