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 --- dbaccess/source/ui/browser/brwctrlr.cxx | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) (limited to 'dbaccess/source') diff --git a/dbaccess/source/ui/browser/brwctrlr.cxx b/dbaccess/source/ui/browser/brwctrlr.cxx index 86e65d809187..075418222a09 100644 --- a/dbaccess/source/ui/browser/brwctrlr.cxx +++ b/dbaccess/source/ui/browser/brwctrlr.cxx @@ -1829,21 +1829,14 @@ void SbaXDataBrowserController::ExecuteSearch() SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); VclPtr pDialog; - if ( pFact ) - { - std::vector< OUString > aContextNames; - aContextNames.emplace_back("Standard" ); - pDialog = pFact->CreateFmSearchDialog(getBrowserView(), sInitialText, aContextNames, 0, LINK(this, SbaXDataBrowserController, OnSearchContextRequest)); - } - OSL_ENSURE( pDialog, "SbaXDataBrowserController::ExecuteSearch: could not get the search dialog!" ); - if ( pDialog ) - { - pDialog->SetActiveField( sActiveField ); - pDialog->SetFoundHandler( LINK( this, SbaXDataBrowserController, OnFoundData ) ); - pDialog->SetCanceledNotFoundHdl( LINK( this, SbaXDataBrowserController, OnCanceledNotFound ) ); - pDialog->Execute(); - pDialog.disposeAndClear(); - } + std::vector< OUString > aContextNames; + aContextNames.emplace_back("Standard" ); + pDialog = pFact->CreateFmSearchDialog(getBrowserView(), sInitialText, aContextNames, 0, LINK(this, SbaXDataBrowserController, OnSearchContextRequest)); + pDialog->SetActiveField( sActiveField ); + pDialog->SetFoundHandler( LINK( this, SbaXDataBrowserController, OnFoundData ) ); + pDialog->SetCanceledNotFoundHdl( LINK( this, SbaXDataBrowserController, OnCanceledNotFound ) ); + pDialog->Execute(); + pDialog.disposeAndClear(); // restore the grid's normal operating state xModelSet->setPropertyValue("DisplayIsSynchron", css::uno::Any(true)); -- cgit