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 /svtools | |
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 'svtools')
-rw-r--r-- | svtools/inc/svtools/addresstemplate.hxx | 3 | ||||
-rw-r--r-- | svtools/source/dialogs/addresstemplate.cxx | 6 |
2 files changed, 6 insertions, 3 deletions
diff --git a/svtools/inc/svtools/addresstemplate.hxx b/svtools/inc/svtools/addresstemplate.hxx index 790740857156..65462f512da1 100644 --- a/svtools/inc/svtools/addresstemplate.hxx +++ b/svtools/inc/svtools/addresstemplate.hxx @@ -40,6 +40,7 @@ #include <com/sun/star/container/XNameAccess.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/util/AliasProgrammaticPair.hpp> +#include <com/sun/star/sdb/XDatabaseContext.hpp> #include <com/sun/star/sdbc/XDataSource.hpp> #include <unotools/configitem.hxx> @@ -75,7 +76,7 @@ namespace svt const String m_sNoFieldSelection; /// the DatabaseContext for selecting data sources - ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > + ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XDatabaseContext > m_xDatabaseContext; // the ORB for creating objects ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > diff --git a/svtools/source/dialogs/addresstemplate.cxx b/svtools/source/dialogs/addresstemplate.cxx index 67c964ec0bcc..7d362fefff84 100644 --- a/svtools/source/dialogs/addresstemplate.cxx +++ b/svtools/source/dialogs/addresstemplate.cxx @@ -34,6 +34,7 @@ #include <svtools/helpid.hrc> #include <svtools/svtresid.hxx> #include <tools/debug.hxx> +#include <comphelper/componentcontext.hxx> #include <comphelper/extract.hxx> #include <comphelper/interaction.hxx> #include <comphelper/processfactory.hxx> @@ -47,6 +48,7 @@ #include <com/sun/star/awt/XWindow.hpp> #include <com/sun/star/beans/PropertyValue.hpp> #include <com/sun/star/beans/XPropertySet.hpp> +#include <com/sun/star/sdb/DatabaseContext.hpp> #include <com/sun/star/sdb/XCompletedConnection.hpp> #include <com/sun/star/sdb/SQLContext.hpp> #include <com/sun/star/sdbc/SQLWarning.hpp> @@ -797,14 +799,14 @@ void AssignmentPersistentData::Commit() if (!m_xORB.is()) return; - const rtl::OUString sContextServiceName("com.sun.star.sdb.DatabaseContext"); try { - m_xDatabaseContext = Reference< XNameAccess >(m_xORB->createInstance(sContextServiceName), UNO_QUERY); + m_xDatabaseContext = DatabaseContext::create(comphelper::ComponentContext(m_xORB).getUNOContext()); } catch(Exception&) { } if (!m_xDatabaseContext.is()) { + const rtl::OUString sContextServiceName("com.sun.star.sdb.DatabaseContext"); ShowServiceNotAvailableError( this, sContextServiceName, sal_False); return; } |