summaryrefslogtreecommitdiff
path: root/connectivity/source/manager/mdrivermanager.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-09-20 16:14:49 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-09-21 15:41:50 +0200
commit2a612907aef4c9987f906c6b98aa9b400f58f617 (patch)
tree6170f363054cabb1cd33af9208145827b22c83a1 /connectivity/source/manager/mdrivermanager.cxx
parent3a481dde031ba416ec4ef0351130e26e49417418 (diff)
loplugin:flatten in connectivity..desktop
Change-Id: Iff59d3049ba40b4338ef8eec67d08a96b0834d2b Reviewed-on: https://gerrit.libreoffice.org/42578 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'connectivity/source/manager/mdrivermanager.cxx')
-rw-r--r--connectivity/source/manager/mdrivermanager.cxx15
1 files changed, 6 insertions, 9 deletions
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$",