From 1d11f80148a3aef22bef2f4a15ddaa75b57a8673 Mon Sep 17 00:00:00 2001 From: Julien Nabet Date: Wed, 4 Oct 2023 08:43:01 +0200 Subject: Replace useless throwNoSuchElementException function by its straightforward and short content. Change-Id: Ic847f12923e71addf00b7b16546c8168cf3952f5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157552 Reviewed-by: Julien Nabet Tested-by: Jenkins --- connectivity/source/manager/mdrivermanager.cxx | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/connectivity/source/manager/mdrivermanager.cxx b/connectivity/source/manager/mdrivermanager.cxx index c4b884cc973b..5c283be5d82d 100644 --- a/connectivity/source/manager/mdrivermanager.cxx +++ b/connectivity/source/manager/mdrivermanager.cxx @@ -51,12 +51,6 @@ using namespace ::osl; constexpr OUStringLiteral SERVICE_SDBC_DRIVER = u"com.sun.star.sdbc.Driver"; -/// @throws NoSuchElementException -static void throwNoSuchElementException() -{ - throw NoSuchElementException(); -} - class ODriverEnumeration : public ::cppu::WeakImplHelper< XEnumeration > { friend class OSDBCDriverManager; @@ -98,7 +92,7 @@ sal_Bool SAL_CALL ODriverEnumeration::hasMoreElements( ) Any SAL_CALL ODriverEnumeration::nextElement( ) { if ( !hasMoreElements() ) - throwNoSuchElementException(); + throw NoSuchElementException(); return Any( *m_aPos++ ); } @@ -518,7 +512,7 @@ Reference< XInterface > SAL_CALL OSDBCDriverManager::getRegisteredObject( const MutexGuard aGuard(m_aMutex); DriverCollection::const_iterator aSearch = m_aDriversRT.find(_rName); if (aSearch == m_aDriversRT.end()) - throwNoSuchElementException(); + throw NoSuchElementException(); return aSearch->second; } @@ -560,7 +554,7 @@ void SAL_CALL OSDBCDriverManager::revokeObject( const OUString& _rName ) DriverCollection::iterator aSearch = m_aDriversRT.find(_rName); if (aSearch == m_aDriversRT.end()) - throwNoSuchElementException(); + throw NoSuchElementException(); m_aDriversRT.erase(aSearch); // we already have the iterator so we could use it -- cgit