diff options
author | Noel <noel.grandin@collabora.co.uk> | 2021-03-26 13:35:54 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-03-26 18:02:19 +0100 |
commit | b624b13b3d5a8e573c7de8158cadc66b1982d157 (patch) | |
tree | 56948e6a5e8d7f5a7cbde6328a27f13ecd8a72bc /basic/source/uno/namecont.cxx | |
parent | 8136620ff432bf17815bef1f88c7531edb839d23 (diff) |
loplugin:flatten
Change-Id: Ib7a895fba66f8dc9b6501e61631c02694053b7fc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113157
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'basic/source/uno/namecont.cxx')
-rw-r--r-- | basic/source/uno/namecont.cxx | 31 |
1 files changed, 15 insertions, 16 deletions
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<cppu::OWeakObject*>(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<cppu::OWeakObject*>(this), 1); + if ( _rArguments[0] >>= xDocument ) + { + initializeFromDocument( xDocument ); + return; } - else - throw IllegalArgumentException("too many args", static_cast<cppu::OWeakObject*>(this), -1); + throw IllegalArgumentException("arg1 unknown type", static_cast<cppu::OWeakObject*>(this), 1); + } void SfxLibraryContainer::initializeFromDocument( const Reference< XStorageBasedDocument >& _rxDocument ) |