From a00c4e02acd1b7a3ab126941166aa2d12c7eb3fc Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Thu, 27 Sep 2012 13:43:06 +0200 Subject: Improvements on previous commit * Made XDatabaseContext inherit XDatabaseRegistrations non-optionally, adapted call-sites to just use XDatabaseContext w/o querying. (The previous commit had inadvertantly effectively removed support for XDatabaseRegistrations from the ODatabaseContext implementation, as an optional UNO super-interface does not lead to a super-class in the corresponding C++ class hierarchy, but making the super-interface non-optional fixes that anyway.) * Adapted some more call-sites to just use XDatabaseContext w/o querying. * Added @since tag. * Replaced new uses of comphelper::ComponentContext::getUNOContext with comphelper::getComponentContext (see 03a9f139bd9ea1a4f9096fc982e6b326def58532 "ComponentContext::getUnoContext -> getComponentContext simplification;" I intend to get rid of comphelper/componentcontext.hxx much sooner than of comphelper/processfactory.hxx). Change-Id: I68d09f2dbe651629f79ed21cd40cdb6d6b32c624 --- extensions/source/abpilot/datasourcehandling.cxx | 14 ++++++-------- extensions/source/dbpilots/commonpagesdbp.hxx | 4 ++-- extensions/source/dbpilots/controlwizard.cxx | 7 +++---- extensions/source/dbpilots/wizardcontext.hxx | 3 ++- 4 files changed, 13 insertions(+), 15 deletions(-) (limited to 'extensions') diff --git a/extensions/source/abpilot/datasourcehandling.cxx b/extensions/source/abpilot/datasourcehandling.cxx index c91b480f53a1..c37139b48e46 100644 --- a/extensions/source/abpilot/datasourcehandling.cxx +++ b/extensions/source/abpilot/datasourcehandling.cxx @@ -49,7 +49,7 @@ #include #include -#include +#include #include #include #include @@ -127,7 +127,7 @@ namespace abp { // create the new data source Reference< XPropertySet > xNewDataSource; - lcl_implCreateAndInsert( comphelper::ComponentContext(_rxORB).getUNOContext(), _rName, xNewDataSource ); + lcl_implCreateAndInsert( comphelper::getComponentContext(_rxORB), _rName, xNewDataSource ); //............................................................. // set the URL property @@ -157,11 +157,9 @@ namespace abp OSL_ENSURE( !_sURL.isEmpty(), "lcl_registerDataSource: invalid URL!" ); try { - - ::comphelper::ComponentContext aContext( _rxORB ); - Reference< XDatabaseRegistrations > xRegistrations( - aContext.createComponent( "com.sun.star.sdb.DatabaseContext" ), UNO_QUERY_THROW ); - + Reference< XDatabaseContext > xRegistrations( + DatabaseContext::create( + comphelper::getComponentContext(_rxORB))); if ( xRegistrations->hasRegisteredDatabase( _sName ) ) xRegistrations->changeDatabaseLocation( _sName, _sURL ); else @@ -201,7 +199,7 @@ namespace abp { // create the UNO context m_pImpl->xContext = Reference( - lcl_getDataSourceContext( comphelper::ComponentContext(_rxORB).getUNOContext() ), + lcl_getDataSourceContext( comphelper::getComponentContext(_rxORB) ), UNO_QUERY_THROW); if (m_pImpl->xContext.is()) diff --git a/extensions/source/dbpilots/commonpagesdbp.hxx b/extensions/source/dbpilots/commonpagesdbp.hxx index 07038717bbcb..3d00eba2076c 100644 --- a/extensions/source/dbpilots/commonpagesdbp.hxx +++ b/extensions/source/dbpilots/commonpagesdbp.hxx @@ -23,7 +23,7 @@ #include "controlwizard.hxx" #include #include -#include +#include //......................................................................... namespace dbp @@ -44,7 +44,7 @@ namespace dbp FixedText m_aTableLabel; ListBox m_aTable; - ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > + ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XDatabaseContext > m_xDSContext; public: diff --git a/extensions/source/dbpilots/controlwizard.cxx b/extensions/source/dbpilots/controlwizard.cxx index ba216b3d4451..47c6bb55ed48 100644 --- a/extensions/source/dbpilots/controlwizard.cxx +++ b/extensions/source/dbpilots/controlwizard.cxx @@ -42,7 +42,7 @@ #include #include #include -#include +#include #include #include #include @@ -446,9 +446,8 @@ namespace dbp { DBG_ASSERT(xORB.is(), "OControlWizard::implGetDSContext: invalid service factory!"); - m_aContext.xDatasourceContext = Reference( - DatabaseContext::create(comphelper::ComponentContext(xORB).getUNOContext()), - UNO_QUERY_THROW); + m_aContext.xDatasourceContext = + DatabaseContext::create(comphelper::getComponentContext(xORB)); } catch(const Exception&) { diff --git a/extensions/source/dbpilots/wizardcontext.hxx b/extensions/source/dbpilots/wizardcontext.hxx index 2e5bb4240f9a..6b77c7877571 100644 --- a/extensions/source/dbpilots/wizardcontext.hxx +++ b/extensions/source/dbpilots/wizardcontext.hxx @@ -22,6 +22,7 @@ #include #include +#include #include #include #include @@ -40,7 +41,7 @@ namespace dbp struct OControlWizardContext { // the global data source context - ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > + ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XDatabaseContext > xDatasourceContext; // the control mode -- cgit