summaryrefslogtreecommitdiff
path: root/connectivity/source/drivers/writer/WDriver.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'connectivity/source/drivers/writer/WDriver.cxx')
-rw-r--r--connectivity/source/drivers/writer/WDriver.cxx16
1 files changed, 6 insertions, 10 deletions
diff --git a/connectivity/source/drivers/writer/WDriver.cxx b/connectivity/source/drivers/writer/WDriver.cxx
index 9bd3bc76c1e8..bbd0f71838c1 100644
--- a/connectivity/source/drivers/writer/WDriver.cxx
+++ b/connectivity/source/drivers/writer/WDriver.cxx
@@ -38,17 +38,14 @@ extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
connectivity_writer_ODriver(css::uno::XComponentContext* context,
css::uno::Sequence<css::uno::Any> const& /*rArguments*/)
{
- rtl::Reference<ODriver> ret;
try
{
- ret = new ODriver(context);
+ return acquire(new ODriver(context));
}
catch (...)
{
}
- if (ret)
- ret->acquire();
- return static_cast<cppu::OWeakObject*>(ret.get());
+ return nullptr;
}
uno::Reference<sdbc::XConnection>
@@ -61,12 +58,11 @@ uno::Reference<sdbc::XConnection>
if (!acceptsURL(url))
return nullptr;
- auto pCon = new OWriterConnection(this);
+ rtl::Reference<OWriterConnection> pCon = new OWriterConnection(this);
pCon->construct(url, info);
- uno::Reference<sdbc::XConnection> xCon = pCon;
- m_xConnections.push_back(uno::WeakReferenceHelper(*pCon));
+ m_xConnections.emplace_back(*pCon);
- return xCon;
+ return pCon;
}
sal_Bool SAL_CALL ODriver::acceptsURL(const OUString& url)
@@ -83,7 +79,7 @@ ODriver::getPropertyInfo(const OUString& url, const uno::Sequence<beans::Propert
const OUString sMessage = aResources.getResourceString(STR_URI_SYNTAX_ERROR);
::dbtools::throwGenericSQLException(sMessage, *this);
}
- return uno::Sequence<sdbc::DriverPropertyInfo>();
+ return {};
}
} // namespace