[Libreoffice-commits] core.git: basctl/source
Noel Grandin (via logerrit)
logerrit at kemper.freedesktop.org
Sun Mar 29 17:38:54 UTC 2020
basctl/source/basicide/baside3.cxx | 29 ++++++++++-------------------
1 file changed, 10 insertions(+), 19 deletions(-)
New commits:
commit 80948ae6a2100e6ea13306599dd41092fa870884
Author: Noel Grandin <noelgrandin at gmail.com>
AuthorDate: Sun Mar 29 18:51:29 2020 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Sun Mar 29 19:38:19 2020 +0200
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 at collabora.co.uk>
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();
More information about the Libreoffice-commits
mailing list