Kaydet (Commit) b479e962 authored tarafından Jan Holesovsky's avatar Jan Holesovsky

lokdialog: Convert the Format -> ... -> Area... to async exec.

Change-Id: I3756bd472b4e54db1d1c9da382d5d655f472bdb7
Reviewed-on: https://gerrit.libreoffice.org/48080Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarJan Holesovsky <kendy@collabora.com>
üst cb84fdb3
...@@ -52,19 +52,28 @@ rtl::Reference<FuPoor> FuArea::Create( ViewShell* pViewSh, ::sd::Window* pWin, : ...@@ -52,19 +52,28 @@ rtl::Reference<FuPoor> FuArea::Create( ViewShell* pViewSh, ::sd::Window* pWin, :
void FuArea::DoExecute( SfxRequest& rReq ) void FuArea::DoExecute( SfxRequest& rReq )
{ {
rReq.Ignore ();
const SfxItemSet* pArgs = rReq.GetArgs(); 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() ); mpViewShell->Cancel();
mpView->GetAttributes( aNewAttr ); return;
}
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
ScopedVclPtr<AbstractSvxAreaTabDialog> pDlg(pFact ? pFact->CreateSvxAreaTabDialog( nullptr, pDlg->StartExecuteAsync([=](sal_Int32 nResult){
&aNewAttr, if (nResult == RET_OK)
mpDoc,
true) : nullptr);
if( pDlg && (pDlg->Execute() == RET_OK) )
{ {
mpView->SetAttributes (*(pDlg->GetOutputItemSet ())); mpView->SetAttributes (*(pDlg->GetOutputItemSet ()));
...@@ -81,10 +90,7 @@ void FuArea::DoExecute( SfxRequest& rReq ) ...@@ -81,10 +90,7 @@ void FuArea::DoExecute( SfxRequest& rReq )
mpViewShell->GetViewFrame()->GetBindings().Invalidate( SidArray ); mpViewShell->GetViewFrame()->GetBindings().Invalidate( SidArray );
} }
} }, pDlg);
rReq.Ignore ();
} }
void FuArea::Activate() void FuArea::Activate()
......
...@@ -1374,7 +1374,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) ...@@ -1374,7 +1374,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
case SID_ATTRIBUTES_AREA: // BASIC case SID_ATTRIBUTES_AREA: // BASIC
{ {
SetCurrentFunction( FuArea::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq ) ); SetCurrentFunction( FuArea::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq ) );
Cancel(); // Cancel() called directly in FuTransform::Create()
} }
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment