summaryrefslogtreecommitdiff
path: root/extensions/source/bibliography/datman.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'extensions/source/bibliography/datman.cxx')
-rw-r--r--extensions/source/bibliography/datman.cxx7
1 files changed, 4 insertions, 3 deletions
diff --git a/extensions/source/bibliography/datman.cxx b/extensions/source/bibliography/datman.cxx
index 2b04564d3538..05628020b236 100644
--- a/extensions/source/bibliography/datman.cxx
+++ b/extensions/source/bibliography/datman.cxx
@@ -41,6 +41,7 @@
#include <com/sun/star/uno/XNamingService.hpp>
#include <com/sun/star/sdbc/XDataSource.hpp>
#include <com/sun/star/sdb/CommandType.hpp>
+#include <com/sun/star/sdb/DatabaseContext.hpp>
#include <com/sun/star/sdbcx/XTablesSupplier.hpp>
#include <com/sun/star/sdbc/XConnection.hpp>
#include <com/sun/star/sdb/XCompletedConnection.hpp>
@@ -96,9 +97,9 @@ Reference< XConnection > getConnection(const ::rtl::OUString& _rURL)
Reference< XDataSource > xDataSource;
// is it a favorite title ?
Reference< XMultiServiceFactory > xMgr = comphelper::getProcessServiceFactory();
- Reference<XInterface> xNamingContextIfc = xMgr->createInstance(C2U("com.sun.star.sdb.DatabaseContext"));
- Reference< XNameAccess > xNamingContext(xNamingContextIfc, UNO_QUERY);
- if (xNamingContext.is() && xNamingContext->hasByName(_rURL))
+ Reference<XComponentContext> xContext = comphelper::getProcessComponentContext();
+ Reference< XDatabaseContext > xNamingContext = DatabaseContext::create(xContext);
+ if (xNamingContext->hasByName(_rURL))
{
DBG_ASSERT(Reference< XNamingService > (xNamingContext, UNO_QUERY).is(), "::getDataSource : no NamingService interface on the sdb::DatabaseAccessContext !");
try