summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2012-09-27 13:43:06 +0200
committerStephan Bergmann <sbergman@redhat.com>2012-09-27 15:03:32 +0200
commita00c4e02acd1b7a3ab126941166aa2d12c7eb3fc (patch)
tree124a0877db6e0921b9a1237261106b63d94c1c9f
parent9c00e38b431b57c3760f6c0aa774424b3239eeda (diff)
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
-rw-r--r--connectivity/source/commontools/dbtools.cxx4
-rw-r--r--cui/source/options/dbregisterednamesconfig.cxx11
-rw-r--r--dbaccess/inc/genericcontroller.hxx4
-rw-r--r--dbaccess/source/core/api/RowSet.cxx2
-rw-r--r--dbaccess/source/core/dataaccess/datasource.cxx2
-rw-r--r--dbaccess/source/filter/xml/dbloader2.cxx3
-rw-r--r--dbaccess/source/ui/browser/genericcontroller.cxx2
-rw-r--r--dbaccess/source/ui/browser/unodatbr.cxx2
-rw-r--r--dbaccess/source/ui/dlg/DbAdminImpl.cxx7
-rw-r--r--dbaccess/source/ui/dlg/DbAdminImpl.hxx10
-rw-r--r--dbaccess/source/ui/dlg/dbwizsetup.cxx3
-rw-r--r--dbaccess/source/ui/misc/TokenWriter.cxx2
-rw-r--r--dbaccess/source/ui/misc/WCopyTable.cxx4
-rw-r--r--dbaccess/source/ui/querydesign/querycontroller.cxx3
-rw-r--r--dbaccess/source/ui/relationdesign/RelationController.cxx4
-rw-r--r--dbaccess/source/ui/tabledesign/TableController.cxx4
-rw-r--r--extensions/source/abpilot/datasourcehandling.cxx14
-rw-r--r--extensions/source/dbpilots/commonpagesdbp.hxx4
-rw-r--r--extensions/source/dbpilots/controlwizard.cxx7
-rw-r--r--extensions/source/dbpilots/wizardcontext.hxx3
-rw-r--r--offapi/com/sun/star/sdb/XDatabaseContext.idl4
-rw-r--r--svtools/source/dialogs/addresstemplate.cxx3
22 files changed, 46 insertions, 56 deletions
diff --git a/connectivity/source/commontools/dbtools.cxx b/connectivity/source/commontools/dbtools.cxx
index 24f29a15729a..4674fe4d2571 100644
--- a/connectivity/source/commontools/dbtools.cxx
+++ b/connectivity/source/commontools/dbtools.cxx
@@ -63,9 +63,9 @@
#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
#include <com/sun/star/util/XNumberFormatTypes.hpp>
-#include <comphelper/componentcontext.hxx>
#include <comphelper/extract.hxx>
#include <comphelper/interaction.hxx>
+#include <comphelper/processfactory.hxx>
#include <comphelper/property.hxx>
#include <connectivity/conncleanup.hxx>
#include <connectivity/dbconversion.hxx>
@@ -281,7 +281,7 @@ Reference< XConnection > getConnection_allowException(
const ::rtl::OUString& _rsPwd,
const Reference< XMultiServiceFactory>& _rxFactory)
{
- Reference< XDataSource> xDataSource( getDataSource_allowException(_rsTitleOrPath, comphelper::ComponentContext(_rxFactory).getUNOContext()) );
+ Reference< XDataSource> xDataSource( getDataSource_allowException(_rsTitleOrPath, comphelper::getComponentContext(_rxFactory)) );
Reference<XConnection> xConnection;
if (xDataSource.is())
{
diff --git a/cui/source/options/dbregisterednamesconfig.cxx b/cui/source/options/dbregisterednamesconfig.cxx
index c2829b16f640..ce06d0c5e3f7 100644
--- a/cui/source/options/dbregisterednamesconfig.cxx
+++ b/cui/source/options/dbregisterednamesconfig.cxx
@@ -32,7 +32,6 @@
#include "svx/svxids.hrc"
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/sdb/DatabaseContext.hpp>
-#include <com/sun/star/sdb/XDatabaseRegistrations.hpp>
#include <comphelper/componentcontext.hxx>
#include <comphelper/extract.hxx>
#include <comphelper/processfactory.hxx>
@@ -63,8 +62,8 @@ namespace svx
try
{
Reference<XComponentContext> xContext( ::comphelper::getProcessComponentContext() );
- Reference< XDatabaseRegistrations > xRegistrations(
- DatabaseContext::create(xContext), UNO_QUERY_THROW );
+ Reference< XDatabaseContext > xRegistrations(
+ DatabaseContext::create(xContext) );
Sequence< ::rtl::OUString > aRegistrationNames( xRegistrations->getRegistrationNames() );
const ::rtl::OUString* pRegistrationName = aRegistrationNames.getConstArray();
@@ -94,9 +93,9 @@ namespace svx
try
{
- ::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() );
- Reference< XDatabaseRegistrations > xRegistrations(
- aContext.createComponent( "com.sun.star.sdb.DatabaseContext" ), UNO_QUERY_THROW );
+ Reference< XDatabaseContext > xRegistrations(
+ DatabaseContext::create(
+ comphelper::getProcessComponentContext()));
const DatabaseRegistrations& rNewRegistrations = pRegistrations->getRegistrations();
for ( DatabaseRegistrations::const_iterator reg = rNewRegistrations.begin();
diff --git a/dbaccess/inc/genericcontroller.hxx b/dbaccess/inc/genericcontroller.hxx
index 86fcd0d5ef1c..2316566ec616 100644
--- a/dbaccess/inc/genericcontroller.hxx
+++ b/dbaccess/inc/genericcontroller.hxx
@@ -25,7 +25,6 @@
#include "dbaccessdllapi.h"
#include "IController.hxx"
-#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/frame/CommandGroup.hpp>
#include <com/sun/star/frame/XController2.hpp>
#include <com/sun/star/frame/XDispatch.hpp>
@@ -37,6 +36,7 @@
#include <com/sun/star/frame/XLayoutManager.hpp>
#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/sdb/XDatabaseContext.hpp>
#include <com/sun/star/sdbc/XConnection.hpp>
#include <com/sun/star/sdbc/XDataSource.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
@@ -242,7 +242,7 @@ namespace dbaui
ControllerFrame m_aCurrentFrame;
::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider > m_xSlaveDispatcher; // for intercepting dispatches
::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider > m_xMasterDispatcher; // dito
- ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > m_xDatabaseContext;
+ ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XDatabaseContext > m_xDatabaseContext;
::com::sun::star::uno::Reference< ::com::sun::star::frame::XTitle > m_xTitleHelper;
sal_Bool m_bPreview;
diff --git a/dbaccess/source/core/api/RowSet.cxx b/dbaccess/source/core/api/RowSet.cxx
index c4ac4ef2f09b..136992e1750d 100644
--- a/dbaccess/source/core/api/RowSet.cxx
+++ b/dbaccess/source/core/api/RowSet.cxx
@@ -2155,7 +2155,7 @@ Reference< XConnection > ORowSet::calcConnection(const Reference< XInteractionH
Reference< XConnection > xNewConn;
if ( !m_aDataSourceName.isEmpty() )
{
- Reference< XNameAccess > xDatabaseContext( DatabaseContext::create(m_aContext.getUNOContext()), UNO_QUERY_THROW );
+ Reference< XDatabaseContext > xDatabaseContext( DatabaseContext::create(m_aContext.getUNOContext()) );
try
{
Reference< XDataSource > xDataSource( xDatabaseContext->getByName( m_aDataSourceName ), UNO_QUERY_THROW );
diff --git a/dbaccess/source/core/dataaccess/datasource.cxx b/dbaccess/source/core/dataaccess/datasource.cxx
index a0480dfeb376..3139e2004498 100644
--- a/dbaccess/source/core/dataaccess/datasource.cxx
+++ b/dbaccess/source/core/dataaccess/datasource.cxx
@@ -601,7 +601,7 @@ Sequence< ::rtl::OUString > ODatabaseSource::getSupportedServiceNames( ) throw
Reference< XInterface > ODatabaseSource::Create( const Reference< XComponentContext >& _rxContext )
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "ODatabaseSource::Create" );
- Reference< XSingleServiceFactory > xDBContext( DatabaseContext::create(_rxContext), UNO_QUERY_THROW );
+ Reference< XDatabaseContext > xDBContext( DatabaseContext::create(_rxContext) );
return xDBContext->createInstance();
}
diff --git a/dbaccess/source/filter/xml/dbloader2.cxx b/dbaccess/source/filter/xml/dbloader2.cxx
index 6441d8d9f46e..8b2d3939b767 100644
--- a/dbaccess/source/filter/xml/dbloader2.cxx
+++ b/dbaccess/source/filter/xml/dbloader2.cxx
@@ -38,7 +38,6 @@
#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/lang/XSingleServiceFactory.hpp>
#include <com/sun/star/registry/XRegistryKey.hpp>
#include <com/sun/star/sdb/DatabaseContext.hpp>
#include <com/sun/star/sdb/XDocumentDataSource.hpp>
@@ -446,7 +445,7 @@ void SAL_CALL DBContentLoader::load(const Reference< XFrame > & rFrame, const ::
sal_Int32 nInitialSelection = -1;
if ( !xModel.is() )
{
- Reference< XSingleServiceFactory > xDatabaseContext( DatabaseContext::create(m_aContext.getUNOContext()), UNO_QUERY_THROW );
+ Reference< XDatabaseContext > xDatabaseContext( DatabaseContext::create(m_aContext.getUNOContext()) );
::rtl::OUString sFactoryName = SvtModuleOptions().GetFactoryEmptyDocumentURL(SvtModuleOptions::E_DATABASE);
bCreateNew = sFactoryName.match(_rURL);
diff --git a/dbaccess/source/ui/browser/genericcontroller.cxx b/dbaccess/source/ui/browser/genericcontroller.cxx
index ed7fadf037f8..3131ad131e3c 100644
--- a/dbaccess/source/ui/browser/genericcontroller.cxx
+++ b/dbaccess/source/ui/browser/genericcontroller.cxx
@@ -256,7 +256,7 @@ sal_Bool OGenericUnoController::Construct(Window* /*pParent*/)
OSL_ENSURE(getORB().is(), "OGenericUnoController::Construct need a service factory!");
try
{
- m_xDatabaseContext = Reference< XNameAccess >( DatabaseContext::create(comphelper::ComponentContext(getORB()).getUNOContext()), UNO_QUERY_THROW );
+ m_xDatabaseContext = DatabaseContext::create(comphelper::getComponentContext(getORB()));
}
catch(Exception&)
{
diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx
index 0be575a803e7..6000c5a49538 100644
--- a/dbaccess/source/ui/browser/unodatbr.cxx
+++ b/dbaccess/source/ui/browser/unodatbr.cxx
@@ -3126,7 +3126,7 @@ void SbaTableQueryBrowser::unloadAndCleanup( sal_Bool _bDisposeConnection )
// -------------------------------------------------------------------------
namespace
{
- Reference< XInterface > lcl_getDataSource( const Reference< XNameAccess >& _rxDatabaseContext,
+ Reference< XInterface > lcl_getDataSource( const Reference< XDatabaseContext >& _rxDatabaseContext,
const ::rtl::OUString& _rDataSourceName, const Reference< XConnection >& _rxConnection )
{
Reference< XDataSource > xDataSource;
diff --git a/dbaccess/source/ui/dlg/DbAdminImpl.cxx b/dbaccess/source/ui/dlg/DbAdminImpl.cxx
index da713f32d1d6..2150c6b283a3 100644
--- a/dbaccess/source/ui/dlg/DbAdminImpl.cxx
+++ b/dbaccess/source/ui/dlg/DbAdminImpl.cxx
@@ -50,9 +50,9 @@
#include <com/sun/star/ucb/XInteractionSupplyAuthentication2.hpp>
#include <com/sun/star/ucb/AuthenticationRequest.hpp>
-#include <comphelper/componentcontext.hxx>
#include <comphelper/guarding.hxx>
#include <comphelper/interaction.hxx>
+#include <comphelper/processfactory.hxx>
#include <comphelper/property.hxx>
#include <comphelper/sequence.hxx>
#include <comphelper/string.hxx>
@@ -208,8 +208,7 @@ ODbDataSourceAdministrationHelper::ODbDataSourceAdministrationHelper(const Refer
try
{
- m_xDatabaseContext = Reference< XNameAccess >( DatabaseContext::create(comphelper::ComponentContext(m_xORB).getUNOContext()), UNO_QUERY_THROW );
- m_xDynamicContext.set(m_xDatabaseContext,UNO_QUERY);
+ m_xDatabaseContext = DatabaseContext::create(comphelper::getComponentContext(m_xORB));
}
catch(Exception&)
{
@@ -219,8 +218,6 @@ ODbDataSourceAdministrationHelper::ODbDataSourceAdministrationHelper(const Refer
{
ShowServiceNotAvailableError(_pParent->GetParent(), String(SERVICE_SDB_DATABASECONTEXT), sal_True);
}
-
- OSL_ENSURE(m_xDynamicContext.is(), "ODbAdminDialog::ODbAdminDialog : no XNamingService interface !");
}
//-------------------------------------------------------------------------
sal_Bool ODbDataSourceAdministrationHelper::getCurrentSettings(Sequence< PropertyValue >& _rDriverParam)
diff --git a/dbaccess/source/ui/dlg/DbAdminImpl.hxx b/dbaccess/source/ui/dlg/DbAdminImpl.hxx
index bdba410f1364..305aa8a7cdbf 100644
--- a/dbaccess/source/ui/dlg/DbAdminImpl.hxx
+++ b/dbaccess/source/ui/dlg/DbAdminImpl.hxx
@@ -21,10 +21,9 @@
#define _DBAUI_DBADMINIMPL_HXX_
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/container/XNameAccess.hpp>
-#include <com/sun/star/uno/XNamingService.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/sdb/XDatabaseContext.hpp>
#include <com/sun/star/sdbc/XConnection.hpp>
#include <com/sun/star/sdbc/XDriver.hpp>
#include <comphelper/stl_types.hxx>
@@ -60,10 +59,8 @@ namespace dbaui
private:
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >
m_xORB; /// service factory
- ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >
+ ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XDatabaseContext >
m_xDatabaseContext; /// database context we're working in
- ::com::sun::star::uno::Reference< ::com::sun::star::uno::XNamingService >
- m_xDynamicContext; /// just another interface of the context ...
::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > m_xDatasource;
::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > m_xModel;
@@ -97,8 +94,7 @@ namespace dbaui
inline ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > getORB() const { return m_xORB; }
- ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > getDatabaseContext() const { return m_xDatabaseContext; }
- ::com::sun::star::uno::Reference< ::com::sun::star::uno::XNamingService > getDynamicContext() const { return m_xDynamicContext; }
+ ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XDatabaseContext > getDatabaseContext() const { return m_xDatabaseContext; }
/** creates a new connection. The caller is responsible to dispose it !!!!
*/
diff --git a/dbaccess/source/ui/dlg/dbwizsetup.cxx b/dbaccess/source/ui/dlg/dbwizsetup.cxx
index 664879d7807f..9f05b4e298d9 100644
--- a/dbaccess/source/ui/dlg/dbwizsetup.cxx
+++ b/dbaccess/source/ui/dlg/dbwizsetup.cxx
@@ -50,7 +50,6 @@
#include <cppuhelper/exc_hlp.hxx>
#include <com/sun/star/frame/XStorable.hpp>
-#include <com/sun/star/uno/XNamingService.hpp>
#include <com/sun/star/sdbcx/XTablesSupplier.hpp>
#include <com/sun/star/sdbc/XDataSource.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
@@ -859,7 +858,7 @@ sal_Bool ODbTypeWizDialogSetup::SaveDatabaseDocument()
void ODbTypeWizDialogSetup::RegisterDataSourceByLocation(const ::rtl::OUString& _sPath)
{
Reference< XPropertySet > xDatasource = m_pImpl->getCurrentDataSource();
- Reference< XNamingService > xDatabaseContext( DatabaseContext::create(comphelper::ComponentContext(getORB()).getUNOContext()), UNO_QUERY_THROW );
+ Reference< XDatabaseContext > xDatabaseContext( DatabaseContext::create(comphelper::getComponentContext(getORB())) );
Reference< XNameAccess > xNameAccessDatabaseContext(xDatabaseContext, UNO_QUERY_THROW );
INetURLObject aURL( _sPath );
::rtl::OUString sFilename = aURL.getBase( INetURLObject::LAST_SEGMENT, true, INetURLObject::DECODE_WITH_CHARSET );
diff --git a/dbaccess/source/ui/misc/TokenWriter.cxx b/dbaccess/source/ui/misc/TokenWriter.cxx
index 9c30b73dbf91..16615e4c478b 100644
--- a/dbaccess/source/ui/misc/TokenWriter.cxx
+++ b/dbaccess/source/ui/misc/TokenWriter.cxx
@@ -277,7 +277,7 @@ void ODatabaseImportExport::initialize()
if ( !m_xConnection.is() )
{ // we need a connection
OSL_ENSURE(!m_sDataSourceName.isEmpty(),"There must be a datsource name!");
- Reference<XNameAccess> xDatabaseContext( DatabaseContext::create(comphelper::ComponentContext(m_xFactory).getUNOContext()), UNO_QUERY_THROW);
+ Reference<XNameAccess> xDatabaseContext( DatabaseContext::create(comphelper::getComponentContext(m_xFactory)), UNO_QUERY_THROW);
Reference< XEventListener> xEvt((::cppu::OWeakObject*)this,UNO_QUERY);
Reference< XConnection > xConnection;
diff --git a/dbaccess/source/ui/misc/WCopyTable.cxx b/dbaccess/source/ui/misc/WCopyTable.cxx
index e7e0ae95ccdf..025e7d14cef1 100644
--- a/dbaccess/source/ui/misc/WCopyTable.cxx
+++ b/dbaccess/source/ui/misc/WCopyTable.cxx
@@ -46,8 +46,8 @@
#include <com/sun/star/sdbcx/XViewsSupplier.hpp>
#include <com/sun/star/sdbc/XResultSetMetaDataSupplier.hpp>
-#include <comphelper/componentcontext.hxx>
#include <comphelper/extract.hxx>
+#include <comphelper/processfactory.hxx>
#include <comphelper/types.hxx>
#include <comphelper/interaction.hxx>
#include <connectivity/dbtools.hxx>
@@ -1338,7 +1338,7 @@ Reference< XPropertySet > OCopyTableWizard::createTable()
{
xSuppDestinationColumns.set( xTable, UNO_QUERY_THROW );
// insert new table name into table filter
- ::dbaui::appendToFilter( m_xDestConnection, m_sName, comphelper::ComponentContext(GetFactory()).getUNOContext(), this );
+ ::dbaui::appendToFilter( m_xDestConnection, m_sName, comphelper::getComponentContext(GetFactory()), this );
// copy ui settings
m_rSourceObject.copyUISettingsTo( xTable );
diff --git a/dbaccess/source/ui/querydesign/querycontroller.cxx b/dbaccess/source/ui/querydesign/querycontroller.cxx
index 6d46ff69c348..9bdd3a7f6208 100644
--- a/dbaccess/source/ui/querydesign/querycontroller.cxx
+++ b/dbaccess/source/ui/querydesign/querycontroller.cxx
@@ -66,6 +66,7 @@
#include <comphelper/basicio.hxx>
#include <comphelper/extract.hxx>
+#include <comphelper/processfactory.hxx>
#include <comphelper/property.hxx>
#include <comphelper/seqstream.hxx>
#include <comphelper/streamsection.hxx>
@@ -1534,7 +1535,7 @@ bool OQueryController::doSaveAsDoc(sal_Bool _bSaveAs)
m_xAlterView.set( xElements->getByName( m_sName ), UNO_QUERY );
// now check if our datasource has set a tablefilter and if so, append the new table name to it
- ::dbaui::appendToFilter( getConnection(), m_sName, comphelper::ComponentContext(getORB()).getUNOContext(), getView() );
+ ::dbaui::appendToFilter( getConnection(), m_sName, comphelper::getComponentContext(getORB()), getView() );
}
Reference< XTitleChangeListener> xEventListener(impl_getTitleHelper_throw(),UNO_QUERY);
if ( xEventListener.is() )
diff --git a/dbaccess/source/ui/relationdesign/RelationController.cxx b/dbaccess/source/ui/relationdesign/RelationController.cxx
index 8a72e9082919..abe665bd88b2 100644
--- a/dbaccess/source/ui/relationdesign/RelationController.cxx
+++ b/dbaccess/source/ui/relationdesign/RelationController.cxx
@@ -26,8 +26,8 @@
#include "dbustrings.hrc"
#include <connectivity/dbtools.hxx>
#include <com/sun/star/frame/FrameSearchFlag.hpp>
-#include <comphelper/componentcontext.hxx>
#include <comphelper/extract.hxx>
+#include <comphelper/processfactory.hxx>
#include <com/sun/star/container/XChild.hpp>
#include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/sdbcx/XDataDescriptorFactory.hpp>
@@ -161,7 +161,7 @@ void ORelationController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue
case ID_BROWSER_SAVEDOC:
{
OSL_ENSURE(isEditable(),"Slot ID_BROWSER_SAVEDOC should not be enabled!");
- if(!::dbaui::checkDataSourceAvailable(::comphelper::getString(getDataSource()->getPropertyValue(PROPERTY_NAME)), comphelper::ComponentContext(getORB()).getUNOContext()))
+ if(!::dbaui::checkDataSourceAvailable(::comphelper::getString(getDataSource()->getPropertyValue(PROPERTY_NAME)), comphelper::getComponentContext(getORB())))
{
String aMessage(ModuleRes(STR_DATASOURCE_DELETED));
OSQLWarningBox( getView(), aMessage ).Execute();
diff --git a/dbaccess/source/ui/tabledesign/TableController.cxx b/dbaccess/source/ui/tabledesign/TableController.cxx
index f7b969f09378..ea9b022653f4 100644
--- a/dbaccess/source/ui/tabledesign/TableController.cxx
+++ b/dbaccess/source/ui/tabledesign/TableController.cxx
@@ -56,8 +56,8 @@
#include <com/sun/star/sdbcx/XTablesSupplier.hpp>
#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
-#include <comphelper/componentcontext.hxx>
#include <comphelper/extract.hxx>
+#include <comphelper/processfactory.hxx>
#include <comphelper/streamsection.hxx>
#include <comphelper/types.hxx>
#include <connectivity/dbexception.hxx>
@@ -406,7 +406,7 @@ sal_Bool OTableController::doSaveDoc(sal_Bool _bSaveAs)
assignTable();
}
// now check if our datasource has set a tablefilter and if append the new table name to it
- ::dbaui::appendToFilter(getConnection(),m_sName,comphelper::ComponentContext(getORB()).getUNOContext(),getView()); // we are not interessted in the return value
+ ::dbaui::appendToFilter(getConnection(),m_sName,comphelper::getComponentContext(getORB()),getView()); // we are not interessted in the return value
Reference< frame::XTitleChangeListener> xEventListener(impl_getTitleHelper_throw(),UNO_QUERY);
if ( xEventListener.is() )
{
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 <com/sun/star/uno/XNamingService.hpp>
#include <comphelper/interaction.hxx>
-#include <comphelper/componentcontext.hxx>
+#include <comphelper/processfactory.hxx>
#include <tools/debug.hxx>
#include <tools/diagnose_ex.h>
#include <unotools/confignode.hxx>
@@ -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<XNameAccess>(
- 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 <vcl/fixed.hxx>
#include <vcl/lstbox.hxx>
-#include <com/sun/star/container/XNameAccess.hpp>
+#include <com/sun/star/sdb/XDatabaseContext.hpp>
//.........................................................................
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 <com/sun/star/sdb/CommandType.hpp>
#include <com/sun/star/sdbc/SQLWarning.hpp>
#include <com/sun/star/sdb/SQLContext.hpp>
-#include <comphelper/componentcontext.hxx>
+#include <comphelper/processfactory.hxx>
#include <comphelper/types.hxx>
#include <connectivity/dbtools.hxx>
#include <vcl/msgbox.hxx>
@@ -446,9 +446,8 @@ namespace dbp
{
DBG_ASSERT(xORB.is(), "OControlWizard::implGetDSContext: invalid service factory!");
- m_aContext.xDatasourceContext = Reference<XNameAccess>(
- 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 <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/sdb/XDatabaseContext.hpp>
#include <com/sun/star/sdbc/XRowSet.hpp>
#include <com/sun/star/uno/Sequence.hxx>
#include <com/sun/star/drawing/XDrawPage.hpp>
@@ -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
diff --git a/offapi/com/sun/star/sdb/XDatabaseContext.idl b/offapi/com/sun/star/sdb/XDatabaseContext.idl
index 9c0394215278..c721a27b5353 100644
--- a/offapi/com/sun/star/sdb/XDatabaseContext.idl
+++ b/offapi/com/sun/star/sdb/XDatabaseContext.idl
@@ -30,6 +30,8 @@ module com { module sun { module star { module sdb {
/**
Provides an interface for the new-style DatabaseContext service to implement.
+
+ @since LibreOffice 3.7
*/
published interface XDatabaseContext
{
@@ -67,7 +69,7 @@ published interface XDatabaseContext
@since OOo 3.3
*/
- [optional] interface XDatabaseRegistrations;
+ interface XDatabaseRegistrations;
};
diff --git a/svtools/source/dialogs/addresstemplate.cxx b/svtools/source/dialogs/addresstemplate.cxx
index 7d362fefff84..49f7ca5204ba 100644
--- a/svtools/source/dialogs/addresstemplate.cxx
+++ b/svtools/source/dialogs/addresstemplate.cxx
@@ -34,7 +34,6 @@
#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>
@@ -801,7 +800,7 @@ void AssignmentPersistentData::Commit()
try
{
- m_xDatabaseContext = DatabaseContext::create(comphelper::ComponentContext(m_xORB).getUNOContext());
+ m_xDatabaseContext = DatabaseContext::create(comphelper::getComponentContext(m_xORB));
}
catch(Exception&) { }
if (!m_xDatabaseContext.is())