diff options
Diffstat (limited to 'sd/source/ui/func')
-rw-r--r-- | sd/source/ui/func/futxtatt.cxx | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/sd/source/ui/func/futxtatt.cxx b/sd/source/ui/func/futxtatt.cxx index 56f8c25696e0..9d9ce86fee67 100644 --- a/sd/source/ui/func/futxtatt.cxx +++ b/sd/source/ui/func/futxtatt.cxx @@ -51,28 +51,29 @@ void FuTextAttrDlg::DoExecute( SfxRequest& rReq ) const SfxItemSet* pArgs = rReq.GetArgs(); - if( !pArgs ) + if( pArgs ) { - SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateTextTabDialog(rReq.GetFrameWeld(), &aNewAttr, mpView)); + mpView->SetAttributes( *pArgs ); + return; + } - sal_uInt16 nResult = pDlg->Execute(); + SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); + VclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateTextTabDialog(rReq.GetFrameWeld(), &aNewAttr, mpView)); - switch( nResult ) + auto xRequest = std::make_shared<SfxRequest>(rReq); + rReq.Ignore(); // the 'old' request is not relevant any more + auto pView = mpView; // copy vars we need, FuTextAttrDlg object will be gone by the time the dialog completes + pDlg->StartExecuteAsync( + [pDlg, xRequest, pView] (sal_Int32 nResult)->void { - case RET_OK: + if (nResult == RET_OK) { - rReq.Done( *( pDlg->GetOutputItemSet() ) ); - - pArgs = rReq.GetArgs(); + xRequest->Done( *pDlg->GetOutputItemSet() ); + pView->SetAttributes( *xRequest->GetArgs() ); } - break; - - default: - return; // Cancel + pDlg->disposeOnce(); } - } - mpView->SetAttributes( *pArgs ); + ); } } // end of namespace sd |