diff options
author | Noel Grandin <noel@peralex.com> | 2012-09-18 09:46:34 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-09-27 15:03:32 +0200 |
commit | 9c00e38b431b57c3760f6c0aa774424b3239eeda (patch) | |
tree | bfe1bdd57d15eafb617028243cf4ea892016a137 /extensions/source/bibliography/datman.cxx | |
parent | 8c20367a2e6d61f830f6dc336761909e38a6bcca (diff) |
fdo#46808, Adapt sdb::DatabaseContext UNO service to new style
Create a merged XDatabaseContext interface for this service to implement.
Which is backwards-compatible, but does not require creating a new service.
Quite a few IDL files had to be marked as published for this to work.
Change-Id: Ie9a0da88d8c33cc83fc9d2334ff83ab2744c222f
Diffstat (limited to 'extensions/source/bibliography/datman.cxx')
-rw-r--r-- | extensions/source/bibliography/datman.cxx | 7 |
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 |