From 2a612907aef4c9987f906c6b98aa9b400f58f617 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 20 Sep 2017 16:14:49 +0200 Subject: loplugin:flatten in connectivity..desktop Change-Id: Iff59d3049ba40b4338ef8eec67d08a96b0834d2b Reviewed-on: https://gerrit.libreoffice.org/42578 Tested-by: Jenkins Reviewed-by: Noel Grandin --- connectivity/source/manager/mdrivermanager.cxx | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'connectivity/source/manager/mdrivermanager.cxx') diff --git a/connectivity/source/manager/mdrivermanager.cxx b/connectivity/source/manager/mdrivermanager.cxx index e32934774d8a..e2a3d0ddf360 100644 --- a/connectivity/source/manager/mdrivermanager.cxx +++ b/connectivity/source/manager/mdrivermanager.cxx @@ -566,16 +566,13 @@ void SAL_CALL OSDBCDriverManager::registerObject( const OUString& _rName, const ); DriverCollection::const_iterator aSearch = m_aDriversRT.find(_rName); - if (aSearch == m_aDriversRT.end()) - { - Reference< XDriver > xNewDriver(_rxObject, UNO_QUERY); - if (xNewDriver.is()) - m_aDriversRT.emplace(_rName, xNewDriver); - else - throw IllegalArgumentException(); - } - else + if (aSearch != m_aDriversRT.end()) throw ElementExistException(); + Reference< XDriver > xNewDriver(_rxObject, UNO_QUERY); + if (!xNewDriver.is()) + throw IllegalArgumentException(); + + m_aDriversRT.emplace(_rName, xNewDriver); m_aEventLogger.log( LogLevel::INFO, "new driver registered for name $1$", -- cgit