summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/func/fuolbull.cxx73
1 files changed, 39 insertions, 34 deletions
diff --git a/sd/source/ui/func/fuolbull.cxx b/sd/source/ui/func/fuolbull.cxx
index 286d95a8cd1a..14dc697e71be 100644
--- a/sd/source/ui/func/fuolbull.cxx
+++ b/sd/source/ui/func/fuolbull.cxx
@@ -70,53 +70,58 @@ void FuOutlineBullet::DoExecute( SfxRequest& rReq )
const SfxItemSet* pArgs = rReq.GetArgs();
const SfxStringItem* pPageItem = SfxItemSet::GetItem<SfxStringItem>(pArgs, FN_PARAM_1, false);
- if ( !pArgs || pPageItem )
+ if ( pArgs && !pPageItem )
{
- // fill ItemSet for Dialog
- SfxItemSet aEditAttr( mpDoc->GetPool() );
- mpView->GetAttributes( aEditAttr );
+ /* not direct to pOlView; therefore, SdDrawView::SetAttributes can catch
+ changes to master page and redirect to a template */
+ mpView->SetAttributes(*pArgs);
+ return;
+ }
- SfxItemSet aNewAttr( mpViewShell->GetPool(),
+ // fill ItemSet for Dialog
+ SfxItemSet aEditAttr( mpDoc->GetPool() );
+ mpView->GetAttributes( aEditAttr );
+
+ SfxItemSet aNewAttr( mpViewShell->GetPool(),
svl::Items<EE_ITEMS_START, EE_ITEMS_END>{} );
- aNewAttr.Put( aEditAttr, false );
+ aNewAttr.Put( aEditAttr, false );
- // create and execute dialog
- SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create();
- ScopedVclPtr<SfxAbstractTabDialog> pDlg( pFact->CreateSdOutlineBulletTabDlg(mpViewShell->GetFrameWeld(), &aNewAttr, mpView) );
- if ( pPageItem )
- pDlg->SetCurPageId( OUStringToOString( pPageItem->GetValue(), RTL_TEXTENCODING_UTF8 ) );
- sal_uInt16 nResult = pDlg->Execute();
+ // create and execute dialog
+ SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create();
+ VclPtr<SfxAbstractTabDialog> pDlg( pFact->CreateSdOutlineBulletTabDlg(mpViewShell->GetFrameWeld(), &aNewAttr, mpView) );
+ if ( pPageItem )
+ pDlg->SetCurPageId( OUStringToOString( pPageItem->GetValue(), RTL_TEXTENCODING_UTF8 ) );
- if( nResult != RET_OK )
- return;
+ std::shared_ptr<SfxRequest> xRequest(new SfxRequest(rReq));
+ rReq.Ignore(); // the 'old' request is not relevant any more
- SfxItemSet aSet( *pDlg->GetOutputItemSet() );
+ pDlg->StartExecuteAsync([this, pDlg, xRequest](sal_Int32 nResult){
- OutlinerView* pOLV = mpView->GetTextEditOutlinerView();
+ if( nResult == RET_OK )
+ {
+ SfxItemSet aSet( *pDlg->GetOutputItemSet() );
- std::unique_ptr<OutlineViewModelChangeGuard, o3tl::default_delete<OutlineViewModelChangeGuard>> aGuard;
+ OutlinerView* pOLV = mpView->GetTextEditOutlinerView();
- if (OutlineView* pView = dynamic_cast<OutlineView*>(mpView))
- {
- pOLV = pView->GetViewByWindow(mpViewShell->GetActiveWindow());
- aGuard.reset(new OutlineViewModelChangeGuard(*pView));
- }
+ std::unique_ptr<OutlineViewModelChangeGuard, o3tl::default_delete<OutlineViewModelChangeGuard>> aGuard;
- if( pOLV )
- pOLV->EnableBullets();
+ if (OutlineView* pView = dynamic_cast<OutlineView*>(mpView))
+ {
+ pOLV = pView->GetViewByWindow(mpViewShell->GetActiveWindow());
+ aGuard.reset(new OutlineViewModelChangeGuard(*pView));
+ }
- rReq.Done( aSet );
- pArgs = rReq.GetArgs();
- }
+ if( pOLV )
+ pOLV->EnableBullets();
- /* not direct to pOlView; therefore, SdDrawView::SetAttributes can catch
- changes to master page and redirect to a template */
- mpView->SetAttributes(*pArgs);
+ xRequest->Done( aSet );
-/* #i35937#
- // invalidate possible affected fields
- mpViewShell->Invalidate( FN_NUM_BULLET_ON );
-*/
+ /* not direct to pOlView; therefore, SdDrawView::SetAttributes can catch
+ changes to master page and redirect to a template */
+ mpView->SetAttributes(*xRequest->GetArgs());
+ }
+ pDlg->disposeOnce();
+ });
}
void FuOutlineBullet::SetCurrentBulletsNumbering(SfxRequest& rReq)