From 51c879d8649c7aad7a0c9be0c7ea042d041254d8 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 31 May 2018 08:29:01 +0200 Subject: simplify calls to *DialogFactory::Create methods we don't need to check for nullptr here, it's never null. Change-Id: I3cc5337a8f4dec6747821679e39ccba3cec20f56 Reviewed-on: https://gerrit.libreoffice.org/55114 Tested-by: Jenkins Reviewed-by: Noel Grandin --- sd/source/ui/func/fuprobjs.cxx | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) (limited to 'sd/source/ui/func/fuprobjs.cxx') diff --git a/sd/source/ui/func/fuprobjs.cxx b/sd/source/ui/func/fuprobjs.cxx index da8032d7f8f8..c9e81ec38c44 100644 --- a/sd/source/ui/func/fuprobjs.cxx +++ b/sd/source/ui/func/fuprobjs.cxx @@ -134,21 +134,18 @@ void FuPresentationObjects::DoExecute( SfxRequest& ) SfxStyleSheetBase& rStyleSheet = *pStyleSheet; SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create(); - if (pFact) + ScopedVclPtr pDlg(pFact->CreateSdPresLayoutTemplateDlg( mpDocSh, mpViewShell->GetActiveWindow(), + false, rStyleSheet, ePO, pStyleSheetPool )); + if( pDlg->Execute() == RET_OK ) { - ScopedVclPtr pDlg(pFact->CreateSdPresLayoutTemplateDlg( mpDocSh, mpViewShell->GetActiveWindow(), - false, rStyleSheet, ePO, pStyleSheetPool )); - if( pDlg->Execute() == RET_OK ) - { - const SfxItemSet* pOutSet = pDlg->GetOutputItemSet(); - // Undo-Action - StyleSheetUndoAction* pAction = new StyleSheetUndoAction - (mpDoc, static_cast(pStyleSheet), pOutSet); - mpDocSh->GetUndoManager()->AddUndoAction(pAction); - - pStyleSheet->GetItemSet().Put( *pOutSet ); - static_cast( pStyleSheet )->Broadcast( SfxHint( SfxHintId::DataChanged ) ); - } + const SfxItemSet* pOutSet = pDlg->GetOutputItemSet(); + // Undo-Action + StyleSheetUndoAction* pAction = new StyleSheetUndoAction + (mpDoc, static_cast(pStyleSheet), pOutSet); + mpDocSh->GetUndoManager()->AddUndoAction(pAction); + + pStyleSheet->GetItemSet().Put( *pOutSet ); + static_cast( pStyleSheet )->Broadcast( SfxHint( SfxHintId::DataChanged ) ); } } } -- cgit