From 80948ae6a2100e6ea13306599dd41092fa870884 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Sun, 29 Mar 2020 18:51:29 +0200 Subject: OSL_ASSERT->assert in basctl and simplify the surrounding code, assuming the asserts to hold Change-Id: I9152402f267c17a39f4af275a0de79e9529375c6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91331 Tested-by: Jenkins Reviewed-by: Noel Grandin --- basctl/source/basicide/baside3.cxx | 29 ++++++++++------------------- 1 file changed, 10 insertions(+), 19 deletions(-) (limited to 'basctl') diff --git a/basctl/source/basicide/baside3.cxx b/basctl/source/basicide/baside3.cxx index 0409e4c5cae5..ece79057fc58 100644 --- a/basctl/source/basicide/baside3.cxx +++ b/basctl/source/basicide/baside3.cxx @@ -880,22 +880,17 @@ bool implImportDialog(weld::Window* pWin, const OUString& rCurPath, const Script OUString aXmlDlgName; Reference< beans::XPropertySet > xDialogModelPropSet( xDialogModel, UNO_QUERY ); - if( xDialogModelPropSet.is() ) + assert(xDialogModelPropSet.is()); + try { - try - { - Any aXmlDialogNameAny = xDialogModelPropSet->getPropertyValue( DLGED_PROP_NAME ); - OUString aOUXmlDialogName; - aXmlDialogNameAny >>= aOUXmlDialogName; - aXmlDlgName = aOUXmlDialogName; - } - catch(const beans::UnknownPropertyException& ) - {} + Any aXmlDialogNameAny = xDialogModelPropSet->getPropertyValue( DLGED_PROP_NAME ); + aXmlDialogNameAny >>= aXmlDlgName; + } + catch(const beans::UnknownPropertyException& ) + { + TOOLS_WARN_EXCEPTION("basctl", ""); } - bool bValidName = !aXmlDlgName.isEmpty(); - OSL_ASSERT( bValidName ); - if( !bValidName ) - return bDone; + assert( !aXmlDlgName.isEmpty() ); bool bDialogAlreadyExists = rDocument.hasDialog( aLibName, aXmlDlgName ); @@ -934,11 +929,7 @@ bool implImportDialog(weld::Window* pWin, const OUString& rCurPath, const Script } Shell* pShell = GetShell(); - if (!pShell) - { - OSL_ASSERT(pShell); - return bDone; - } + assert(pShell); // Resource? css::lang::Locale aLocale = Application::GetSettings().GetUILanguageTag().getLocale(); -- cgit