diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-09-27 09:11:35 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-09-27 11:02:56 +0200 |
commit | cc1ed7fbce20f90650f96acc2846b6f232c8ab0f (patch) | |
tree | fcd441cdf9568861363894f63107967adf571f81 /scripting | |
parent | b50f595b34585f2927adfd44b4eaaafb8f600972 (diff) |
loplugin:flatten in various
Change-Id: I42dca691ffadbddad38a7e8f978b1da9d5d9a7b0
Reviewed-on: https://gerrit.libreoffice.org/42842
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'scripting')
-rw-r--r-- | scripting/source/dlgprov/dlgprov.cxx | 64 |
1 files changed, 31 insertions, 33 deletions
diff --git a/scripting/source/dlgprov/dlgprov.cxx b/scripting/source/dlgprov/dlgprov.cxx index 00899e8da5f8..df16f43ffe24 100644 --- a/scripting/source/dlgprov/dlgprov.cxx +++ b/scripting/source/dlgprov/dlgprov.cxx @@ -361,49 +361,47 @@ namespace dlgprov // get input stream provider Reference< io::XInputStreamProvider > xISP; - if ( xLibContainer.is() ) + if ( !xLibContainer.is() ) { - // load dialog library - if ( !xLibContainer->isLibraryLoaded( sLibName ) ) - xLibContainer->loadLibrary( sLibName ); + throw IllegalArgumentException( + "DialogProviderImpl::getDialog: library container not found!", + Reference< XInterface >(), 1 ); + } - // get dialog library - if ( xLibContainer->hasByName( sLibName ) ) - { - Any aElement = xLibContainer->getByName( sLibName ); - aElement >>= xDialogLib; - } + // load dialog library + if ( !xLibContainer->isLibraryLoaded( sLibName ) ) + xLibContainer->loadLibrary( sLibName ); - if ( xDialogLib.is() ) - { - // get input stream provider - if ( xDialogLib->hasByName( sDlgName ) ) - { - Any aElement = xDialogLib->getByName( sDlgName ); - aElement >>= xISP; - } + // get dialog library + if ( xLibContainer->hasByName( sLibName ) ) + { + Any aElement = xLibContainer->getByName( sLibName ); + aElement >>= xDialogLib; + } - if ( !xISP.is() ) - { - throw IllegalArgumentException( - "DialogProviderImpl::getDialogModel: dialog not found!", - Reference< XInterface >(), 1 ); - } - } - else - { - throw IllegalArgumentException( - "DialogProviderImpl::getDialogModel: library not found!", - Reference< XInterface >(), 1 ); - } + if ( !xDialogLib.is() ) + { + throw IllegalArgumentException( + "DialogProviderImpl::getDialogModel: library not found!", + Reference< XInterface >(), 1 ); } - else + + // get input stream provider + if ( xDialogLib->hasByName( sDlgName ) ) + { + Any aElement = xDialogLib->getByName( sDlgName ); + aElement >>= xISP; + } + + if ( !xISP.is() ) { throw IllegalArgumentException( - "DialogProviderImpl::getDialog: library container not found!", + "DialogProviderImpl::getDialogModel: dialog not found!", Reference< XInterface >(), 1 ); } + + if ( xISP.is() ) xInput = xISP->createInputStream(); msDialogLibName = sLibName; |