diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2020-03-29 18:51:29 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-03-29 19:38:19 +0200 |
commit | 80948ae6a2100e6ea13306599dd41092fa870884 (patch) | |
tree | a9d838cdf4fd1d01118883e3be6493690a10ecb2 /basctl | |
parent | 1303426c1e796a4f67ebf50eb0d7d1a2a2e292c8 (diff) |
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 <noel.grandin@collabora.co.uk>
Diffstat (limited to 'basctl')
-rw-r--r-- | basctl/source/basicide/baside3.cxx | 29 |
1 files changed, 10 insertions, 19 deletions
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(); |