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>
This commit is contained in:
Jan Holesovsky 2018-01-17 20:15:22 +01:00
parent cb84fdb368
commit b479e96254
2 changed files with 21 additions and 15 deletions

View File

@ -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 )
if (pArgs)
{
SfxItemSet aNewAttr( mpDoc->GetPool() );
mpView->GetAttributes( aNewAttr );
mpViewShell->Cancel();
return;
}
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
ScopedVclPtr<AbstractSvxAreaTabDialog> pDlg(pFact ? pFact->CreateSvxAreaTabDialog( nullptr,
&aNewAttr,
mpDoc,
true) : nullptr);
if( pDlg && (pDlg->Execute() == RET_OK) )
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;
}
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()

View File

@ -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;