From b624b13b3d5a8e573c7de8158cadc66b1982d157 Mon Sep 17 00:00:00 2001 From: Noel Date: Fri, 26 Mar 2021 13:35:54 +0200 Subject: loplugin:flatten Change-Id: Ib7a895fba66f8dc9b6501e61631c02694053b7fc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113157 Tested-by: Jenkins Reviewed-by: Noel Grandin --- basic/source/uno/namecont.cxx | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) (limited to 'basic/source/uno/namecont.cxx') diff --git a/basic/source/uno/namecont.cxx b/basic/source/uno/namecont.cxx index d42b701a5405..25be6ca465af 100644 --- a/basic/source/uno/namecont.cxx +++ b/basic/source/uno/namecont.cxx @@ -2616,25 +2616,24 @@ void SAL_CALL SfxLibraryContainer::initialize( const Sequence< Any >& _rArgument { LibraryContainerMethodGuard aGuard( *this ); sal_Int32 nArgCount = _rArguments.getLength(); - if ( nArgCount == 1 ) + if ( nArgCount != 1 ) + throw IllegalArgumentException("too many args", static_cast(this), -1); + + OUString sInitialDocumentURL; + Reference< XStorageBasedDocument > xDocument; + if ( _rArguments[0] >>= sInitialDocumentURL ) { - OUString sInitialDocumentURL; - Reference< XStorageBasedDocument > xDocument; - if ( _rArguments[0] >>= sInitialDocumentURL ) - { - init( sInitialDocumentURL, nullptr ); - return; - } + init( sInitialDocumentURL, nullptr ); + return; + } - if ( _rArguments[0] >>= xDocument ) - { - initializeFromDocument( xDocument ); - return; - } - throw IllegalArgumentException("arg1 unknown type", static_cast(this), 1); + if ( _rArguments[0] >>= xDocument ) + { + initializeFromDocument( xDocument ); + return; } - else - throw IllegalArgumentException("too many args", static_cast(this), -1); + throw IllegalArgumentException("arg1 unknown type", static_cast(this), 1); + } void SfxLibraryContainer::initializeFromDocument( const Reference< XStorageBasedDocument >& _rxDocument ) -- cgit