diff options
author | Noel Grandin <noel@peralex.com> | 2013-03-19 13:08:47 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-03-20 07:32:53 +0200 |
commit | a066525b42a1ab8dc60e10a5d62819c259904f32 (patch) | |
tree | 0c21130ff82a482ab80de0fcc3c73be0125d06f5 /dbaccess/source | |
parent | 6999a50efaaf802ccd4c7eb7957af17cc32602be (diff) |
fdo#46808, Convert a bunch of comphelper::ComponentContext stuff
.. to Reference<XComponentContext>
mostly in the dbaccess module, but it also affected some other
modules.
Change-Id: I09b3f6fe7a9b33498b11d98b5521b5aeeb8882be
Diffstat (limited to 'dbaccess/source')
98 files changed, 415 insertions, 412 deletions
diff --git a/dbaccess/source/core/api/OptimisticSet.cxx b/dbaccess/source/core/api/OptimisticSet.cxx index 816b9d88d24f..8ff2da819b01 100644 --- a/dbaccess/source/core/api/OptimisticSet.cxx +++ b/dbaccess/source/core/api/OptimisticSet.cxx @@ -84,14 +84,14 @@ namespace DBG_NAME(OptimisticSet) -OptimisticSet::OptimisticSet(const ::comphelper::ComponentContext& _rContext, +OptimisticSet::OptimisticSet(const Reference<XComponentContext>& _rContext, const Reference< XConnection>& i_xConnection, const Reference< XSingleSelectQueryAnalyzer >& _xComposer, const ORowSetValueVector& _aParameterValueForCache, sal_Int32 i_nMaxRows, sal_Int32& o_nRowCount) :OKeySet(NULL,NULL,::rtl::OUString(),_xComposer,_aParameterValueForCache,i_nMaxRows,o_nRowCount) - ,m_aSqlParser( _rContext.getUNOContext() ) + ,m_aSqlParser( _rContext ) ,m_aSqlIterator( i_xConnection, Reference<XTablesSupplier>(_xComposer,UNO_QUERY)->getTables(), m_aSqlParser, NULL ) ,m_bResultSetChanged(false) { diff --git a/dbaccess/source/core/api/OptimisticSet.hxx b/dbaccess/source/core/api/OptimisticSet.hxx index 0e9723381d0d..da6c034fdeca 100644 --- a/dbaccess/source/core/api/OptimisticSet.hxx +++ b/dbaccess/source/core/api/OptimisticSet.hxx @@ -29,7 +29,6 @@ #include <com/sun/star/lang/XUnoTunnel.hpp> #include <com/sun/star/sdb/XSingleSelectQueryAnalyzer.hpp> #include <comphelper/stl_types.hxx> -#include <comphelper/componentcontext.hxx> namespace dbaccess { @@ -53,7 +52,7 @@ namespace dbaccess virtual void makeNewStatement( ); virtual ~OptimisticSet(); public: - OptimisticSet(const ::comphelper::ComponentContext& _rContext, + OptimisticSet(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext>& _rContext, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& i_xConnection, const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XSingleSelectQueryAnalyzer >& _xComposer, const ORowSetValueVector& _aParameterValueForCache, diff --git a/dbaccess/source/core/api/RowSet.cxx b/dbaccess/source/core/api/RowSet.cxx index c946f666f141..17437c9d885c 100644 --- a/dbaccess/source/core/api/RowSet.cxx +++ b/dbaccess/source/core/api/RowSet.cxx @@ -56,7 +56,7 @@ #include <com/sun/star/uno/XNamingService.hpp> #include <com/sun/star/util/XNumberFormatsSupplier.hpp> -#include <comphelper/componentcontext.hxx> +#include <comphelper/processfactory.hxx> #include <comphelper/extract.hxx> #include <comphelper/interaction.hxx> #include <comphelper/property.hxx> @@ -130,12 +130,12 @@ namespace dbaccess Reference< XInterface > ORowSet_CreateInstance(const Reference< XMultiServiceFactory >& _rxFactory) { - return *(new ORowSet(_rxFactory)); + return *(new ORowSet( comphelper::getComponentContext(_rxFactory) )); } -ORowSet::ORowSet( const Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB ) +ORowSet::ORowSet( const Reference< ::com::sun::star::uno::XComponentContext >& _rxContext ) :ORowSet_BASE1(m_aMutex) - ,ORowSetBase( _rxORB, ORowSet_BASE1::rBHelper, &m_aMutex ) + ,ORowSetBase( _rxContext, ORowSet_BASE1::rBHelper, &m_aMutex ) ,m_pParameters( NULL ) ,m_aRowsetListeners(*m_pMutex) ,m_aApproveListeners(*m_pMutex) @@ -509,8 +509,7 @@ Sequence< OUString > SAL_CALL ORowSet::getSupportedServiceNames( ) throw(Runtim Reference< XInterface > ORowSet::Create(const Reference< XComponentContext >& _rxContext) { - ::comphelper::ComponentContext aContext( _rxContext ); - return ORowSet_CreateInstance( aContext.getLegacyServiceFactory() ); + return *(new ORowSet( _rxContext )); } // OComponentHelper @@ -1464,7 +1463,7 @@ void SAL_CALL ORowSet::executeWithCompletion( const Reference< XInteractionHandl calcConnection( _rxHandler ); m_bRebuildConnOnExecute = sal_False; - Reference< XSingleSelectQueryComposer > xComposer = getCurrentSettingsComposer( this, m_aContext.getUNOContext() ); + Reference< XSingleSelectQueryComposer > xComposer = getCurrentSettingsComposer( this, m_aContext ); Reference<XParametersSupplier> xParameters(xComposer, UNO_QUERY); Reference<XIndexAccess> xParamsAsIndicies = xParameters.is() ? xParameters->getParameters() : Reference<XIndexAccess>(); @@ -2159,7 +2158,7 @@ Reference< XConnection > ORowSet::calcConnection(const Reference< XInteractionH Reference< XConnection > xNewConn; if ( !m_aDataSourceName.isEmpty() ) { - Reference< XDatabaseContext > xDatabaseContext( DatabaseContext::create(m_aContext.getUNOContext()) ); + Reference< XDatabaseContext > xDatabaseContext( DatabaseContext::create(m_aContext) ); try { Reference< XDataSource > xDataSource( xDatabaseContext->getByName( m_aDataSourceName ), UNO_QUERY_THROW ); @@ -2721,7 +2720,7 @@ void ORowSet::impl_rebuild_throw(::osl::ResettableMutexGuard& _rGuard) // *********************************************************** DBG_NAME(ORowSetClone); -ORowSetClone::ORowSetClone( const ::comphelper::ComponentContext& _rContext, ORowSet& rParent, ::osl::Mutex* _pMutex ) +ORowSetClone::ORowSetClone( const Reference<XComponentContext>& _rContext, ORowSet& rParent, ::osl::Mutex* _pMutex ) :OSubComponent(m_aMutex, rParent) ,ORowSetBase( _rContext, OComponentHelper::rBHelper, _pMutex ) ,m_pParent(&rParent) diff --git a/dbaccess/source/core/api/RowSet.hxx b/dbaccess/source/core/api/RowSet.hxx index 9a0aee6d85e0..0e3558ad6f43 100644 --- a/dbaccess/source/core/api/RowSet.hxx +++ b/dbaccess/source/core/api/RowSet.hxx @@ -243,7 +243,7 @@ namespace dbaccess virtual ~ORowSet(); public: - ORowSet(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >&); + ORowSet(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >&); // com::sun::star::lang::XTypeProvider virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException); @@ -475,7 +475,7 @@ namespace dbaccess virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const ::com::sun::star::uno::Any& rValue) throw (::com::sun::star::uno::Exception); public: - ORowSetClone( const ::comphelper::ComponentContext& _rContext, ORowSet& rParent, ::osl::Mutex* _pMutex ); + ORowSetClone( const css::uno::Reference<css::uno::XComponentContext>& _rContext, ORowSet& rParent, ::osl::Mutex* _pMutex ); virtual ~ORowSetClone(); // com::sun::star::lang::XTypeProvider diff --git a/dbaccess/source/core/api/RowSetBase.cxx b/dbaccess/source/core/api/RowSetBase.cxx index e9a12dad5ff7..80f2c4660c76 100644 --- a/dbaccess/source/core/api/RowSetBase.cxx +++ b/dbaccess/source/core/api/RowSetBase.cxx @@ -83,7 +83,7 @@ connectivity::sdbcx::ObjectType OEmptyCollection::createObject(const ::rtl::OUSt // ========================================================================= DBG_NAME(ORowSetBase) -ORowSetBase::ORowSetBase( const ::comphelper::ComponentContext& _rContext, ::cppu::OBroadcastHelper& _rBHelper, ::osl::Mutex* _pMutex ) +ORowSetBase::ORowSetBase( const Reference<XComponentContext>& _rContext, ::cppu::OBroadcastHelper& _rBHelper, ::osl::Mutex* _pMutex ) :OPropertyStateContainer(_rBHelper) ,m_pMutex(_pMutex) ,m_pCache(NULL) @@ -91,7 +91,7 @@ ORowSetBase::ORowSetBase( const ::comphelper::ComponentContext& _rContext, ::cpp ,m_rBHelper(_rBHelper) ,m_pEmptyCollection( NULL ) ,m_aContext( _rContext ) - ,m_aErrors( _rContext.getUNOContext() ) + ,m_aErrors( _rContext ) ,m_nLastColumnIndex(-1) ,m_nDeletedPosition(-1) ,m_nResultSetType( ResultSetType::FORWARD_ONLY ) diff --git a/dbaccess/source/core/api/RowSetBase.hxx b/dbaccess/source/core/api/RowSetBase.hxx index 898ffd14c13e..31660e9411ab 100644 --- a/dbaccess/source/core/api/RowSetBase.hxx +++ b/dbaccess/source/core/api/RowSetBase.hxx @@ -41,7 +41,6 @@ #include <comphelper/broadcasthelper.hxx> #include "RowSetCacheIterator.hxx" #include "core_resource.hxx" -#include <comphelper/componentcontext.hxx> #include <functional> @@ -97,7 +96,7 @@ namespace dbaccess ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatTypes> m_xNumberFormatTypes; OEmptyCollection* m_pEmptyCollection; - ::comphelper::ComponentContext m_aContext; + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext> m_aContext; ::connectivity::SQLError m_aErrors; sal_Int32 m_nLastColumnIndex; // the last column ask for, used for wasNull() @@ -112,7 +111,7 @@ namespace dbaccess protected: ORowSetBase( - const ::comphelper::ComponentContext& _rContext, + const css::uno::Reference<css::uno::XComponentContext>& _rContext, ::cppu::OBroadcastHelper& _rBHelper, ::osl::Mutex* _pMutex ); diff --git a/dbaccess/source/core/api/RowSetCache.cxx b/dbaccess/source/core/api/RowSetCache.cxx index 34896882182e..f6506fae69f6 100644 --- a/dbaccess/source/core/api/RowSetCache.cxx +++ b/dbaccess/source/core/api/RowSetCache.cxx @@ -82,7 +82,7 @@ DBG_NAME(ORowSetCache) ORowSetCache::ORowSetCache(const Reference< XResultSet >& _xRs, const Reference< XSingleSelectQueryAnalyzer >& _xAnalyzer, - const ::comphelper::ComponentContext& _rContext, + const Reference<XComponentContext>& _rContext, const ::rtl::OUString& _rUpdateTableName, sal_Bool& _bModified, sal_Bool& _bNew, @@ -1580,7 +1580,7 @@ sal_Bool ORowSetCache::checkJoin(const Reference< XConnection>& _xConnection, sal_Bool bOk = sal_False; ::rtl::OUString sSql = _xAnalyzer->getQuery(); ::rtl::OUString sErrorMsg; - ::connectivity::OSQLParser aSqlParser( m_aContext.getUNOContext() ); + ::connectivity::OSQLParser aSqlParser( m_aContext ); SAL_WNODEPRECATED_DECLARATIONS_PUSH ::std::auto_ptr< ::connectivity::OSQLParseNode> pSqlParseNode( aSqlParser.parseTree(sErrorMsg,sSql)); SAL_WNODEPRECATED_DECLARATIONS_POP diff --git a/dbaccess/source/core/api/RowSetCache.hxx b/dbaccess/source/core/api/RowSetCache.hxx index 2a315d94184a..6eabf0df1e09 100644 --- a/dbaccess/source/core/api/RowSetCache.hxx +++ b/dbaccess/source/core/api/RowSetCache.hxx @@ -37,7 +37,6 @@ #include <com/sun/star/sdbcx/XDeleteRows.hpp> #include <cppuhelper/compbase11.hxx> #include <comphelper/propertycontainer.hxx> -#include <comphelper/componentcontext.hxx> #include <cppuhelper/implbase5.hxx> #include <comphelper/proparrhlp.hxx> #include "RowSetRow.hxx" @@ -64,7 +63,7 @@ namespace dbaccess //the set can be static, bookmarkable or keyset ::com::sun::star::uno::WeakReference< ::com::sun::star::sdbc::XResultSet> m_xSet; ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData > m_xMetaData; // must be before m_aInsertRow - ::comphelper::ComponentContext m_aContext; + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext> m_aContext; ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRow> m_xCacheSet; @@ -137,7 +136,7 @@ namespace dbaccess public: ORowSetCache(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet >& _xRs, const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XSingleSelectQueryAnalyzer >& _xAnalyzer, - const ::comphelper::ComponentContext& _rContext, + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rContext, const ::rtl::OUString& _rUpdateTableName, sal_Bool& _bModified, sal_Bool& _bNew, diff --git a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx index f10af6519e72..a6e64291d657 100644 --- a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx +++ b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx @@ -223,10 +223,10 @@ DBG_NAME(OSingleSelectQueryComposer) OSingleSelectQueryComposer::OSingleSelectQueryComposer(const Reference< XNameAccess>& _rxTables, const Reference< XConnection>& _xConnection, - const ::comphelper::ComponentContext& _rContext ) + const Reference<XComponentContext>& _rContext ) :OSubComponent(m_aMutex,_xConnection) ,OPropertyContainer(m_aBHelper) - ,m_aSqlParser( _rContext.getUNOContext() ) + ,m_aSqlParser( _rContext ) ,m_aSqlIterator( _xConnection, _rxTables, m_aSqlParser, NULL ) ,m_aAdditiveIterator( _xConnection, _rxTables, m_aSqlParser, NULL ) ,m_aElementaryParts( (size_t)SQLPartCount ) @@ -249,8 +249,8 @@ OSingleSelectQueryComposer::OSingleSelectQueryComposer(const Reference< XNameAcc m_aCurrentColumns.resize(4); m_aLocale = SvtSysLocale().GetLanguageTag().getLocale(); - m_xNumberFormatsSupplier = dbtools::getNumberFormats( m_xConnection, sal_True, m_aContext.getUNOContext() ); - Reference< XLocaleData4 > xLocaleData( LocaleData::create(m_aContext.getUNOContext()) ); + m_xNumberFormatsSupplier = dbtools::getNumberFormats( m_xConnection, sal_True, m_aContext ); + Reference< XLocaleData4 > xLocaleData( LocaleData::create(m_aContext) ); LocaleDataItem aData = xLocaleData->getLocaleItem(m_aLocale); m_sDecimalSep = aData.decimalSeparator; OSL_ENSURE(m_sDecimalSep.getLength() == 1,"OSingleSelectQueryComposer::OSingleSelectQueryComposer decimal separator is not 1 length"); @@ -1507,14 +1507,14 @@ namespace void SAL_CALL OSingleSelectQueryComposer::setStructuredFilter( const Sequence< Sequence< PropertyValue > >& filter ) throw (SQLException, ::com::sun::star::lang::IllegalArgumentException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OSingleSelectQueryComposer::setStructuredFilter" ); - OPredicateInputController aPredicateInput(m_aContext.getUNOContext(),m_xConnection); + OPredicateInputController aPredicateInput(m_aContext, m_xConnection); setFilter(lcl_getCondition(filter,aPredicateInput,getColumns())); } void SAL_CALL OSingleSelectQueryComposer::setStructuredHavingClause( const Sequence< Sequence< PropertyValue > >& filter ) throw (SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OSingleSelectQueryComposer::setStructuredHavingClause" ); - OPredicateInputController aPredicateInput(m_aContext.getUNOContext(),m_xConnection); + OPredicateInputController aPredicateInput(m_aContext, m_xConnection); setHavingClause(lcl_getCondition(filter,aPredicateInput,getColumns())); } @@ -1583,7 +1583,7 @@ void OSingleSelectQueryComposer::setConditionByColumn( const Reference< XPropert if ( aValue.hasValue() ) { if( !m_xTypeConverter.is() ) - m_xTypeConverter.set( Converter::create(m_aContext.getUNOContext()) ); + m_xTypeConverter.set( Converter::create(m_aContext) ); OSL_ENSURE(m_xTypeConverter.is(),"NO typeconverter!"); if ( nType != DataType::BOOLEAN && DataType::BIT != nType ) @@ -1736,7 +1736,7 @@ Sequence< Sequence< PropertyValue > > OSingleSelectQueryComposer::getStructuredC if ( pCondition ) { ::std::vector< ::std::vector < PropertyValue > > aFilters; - Reference< XNumberFormatter > xFormatter( NumberFormatter::create(m_aContext.getUNOContext()), UNO_QUERY_THROW ); + Reference< XNumberFormatter > xFormatter( NumberFormatter::create(m_aContext), UNO_QUERY_THROW ); xFormatter->attachNumberFormatsSupplier( m_xNumberFormatsSupplier ); if (setORCriteria(pCondition, m_aAdditiveIterator, aFilters, xFormatter)) diff --git a/dbaccess/source/core/api/query.cxx b/dbaccess/source/core/api/query.cxx index 5d78f7ffc88e..ed1f073066ae 100644 --- a/dbaccess/source/core/api/query.cxx +++ b/dbaccess/source/core/api/query.cxx @@ -73,7 +73,7 @@ DBG_NAME(OQuery) OQuery::OQuery( const Reference< XPropertySet >& _rxCommandDefinition ,const Reference< XConnection >& _rxConn - ,const Reference< XMultiServiceFactory >& _xORB) + ,const Reference< XComponentContext >& _xORB) :OContentHelper(_xORB,NULL,TContentPtr(new OContentHelper_Impl)) ,OQueryDescriptor_Base(m_aMutex,*this) ,ODataSettings(OContentHelper::rBHelper,sal_True) diff --git a/dbaccess/source/core/api/query.hxx b/dbaccess/source/core/api/query.hxx index 456454b5656b..7a95a37e902e 100644 --- a/dbaccess/source/core/api/query.hxx +++ b/dbaccess/source/core/api/query.hxx @@ -100,7 +100,7 @@ public: OQuery( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxCommandDefinition, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConn, - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _xORB + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _xORB ); // com::sun::star::lang::XTypeProvider diff --git a/dbaccess/source/core/api/querycontainer.cxx b/dbaccess/source/core/api/querycontainer.cxx index 90961e5efaa5..6ffb4740307b 100644 --- a/dbaccess/source/core/api/querycontainer.cxx +++ b/dbaccess/source/core/api/querycontainer.cxx @@ -66,7 +66,7 @@ DBG_NAME(OQueryContainer) OQueryContainer::OQueryContainer( const Reference< XNameContainer >& _rxCommandDefinitions , const Reference< XConnection >& _rxConn - , const Reference< XMultiServiceFactory >& _rxORB, + , const Reference< XComponentContext >& _rxORB, ::dbtools::IWarningsContainer* _pWarnings) :ODefinitionContainer(_rxORB,NULL,TContentPtr(new ODefinitionContainer_Impl)) ,m_pWarnings( _pWarnings ) @@ -154,7 +154,9 @@ void SAL_CALL OQueryContainer::appendByDescriptor( const Reference< XPropertySet throw DisposedException( ::rtl::OUString(), *this ); // first clone this object's CommandDefinition part - Reference< XPropertySet > xCommandDefinitionPart( m_aContext.createComponent( (::rtl::OUString)SERVICE_SDB_QUERYDEFINITION ), UNO_QUERY_THROW ); + Reference< XPropertySet > xCommandDefinitionPart( + m_aContext->getServiceManager()->createInstanceWithContext( SERVICE_SDB_QUERYDEFINITION, m_aContext), + UNO_QUERY_THROW ); ::comphelper::copyProperties( _rxDesc, xCommandDefinitionPart ); // TODO : the columns part of the descriptor has to be copied @@ -343,11 +345,11 @@ Reference< XContent > OQueryContainer::implCreateWrapper(const Reference< XConte Reference< XContent > xReturn; if ( xContainer .is() ) { - xReturn = new OQueryContainer( xContainer, m_xConnection, m_aContext.getLegacyServiceFactory(), m_pWarnings ); + xReturn = new OQueryContainer( xContainer, m_xConnection, m_aContext, m_pWarnings ); } else { - OQuery* pNewObject = new OQuery( Reference< XPropertySet >( _rxCommandDesc, UNO_QUERY ), m_xConnection, m_aContext.getLegacyServiceFactory() ); + OQuery* pNewObject = new OQuery( Reference< XPropertySet >( _rxCommandDesc, UNO_QUERY ), m_xConnection, m_aContext ); xReturn = pNewObject; pNewObject->setWarningsContainer( m_pWarnings ); diff --git a/dbaccess/source/core/dataaccess/ComponentDefinition.cxx b/dbaccess/source/core/dataaccess/ComponentDefinition.cxx index 384d98dfc578..8266b65b2777 100644 --- a/dbaccess/source/core/dataaccess/ComponentDefinition.cxx +++ b/dbaccess/source/core/dataaccess/ComponentDefinition.cxx @@ -31,7 +31,6 @@ #include <comphelper/property.hxx> #include "definitioncolumn.hxx" #include <cppuhelper/implbase1.hxx> -#include <comphelper/componentcontext.hxx> using namespace ::com::sun::star::uno; using namespace ::com::sun::star::sdbc; @@ -126,7 +125,7 @@ void OComponentDefinition::registerProperties() } } -OComponentDefinition::OComponentDefinition(const Reference< XMultiServiceFactory >& _xORB +OComponentDefinition::OComponentDefinition(const Reference< XComponentContext >& _xORB ,const Reference< XInterface >& _xParentContainer ,const TContentPtr& _pImpl ,sal_Bool _bTable) @@ -146,7 +145,7 @@ OComponentDefinition::~OComponentDefinition() OComponentDefinition::OComponentDefinition( const Reference< XInterface >& _rxContainer ,const ::rtl::OUString& _rElementName - ,const Reference< XMultiServiceFactory >& _xORB + ,const Reference< XComponentContext >& _xORB ,const TContentPtr& _pImpl ,sal_Bool _bTable) :OContentHelper(_xORB,_rxContainer,_pImpl) @@ -190,8 +189,7 @@ Sequence< ::rtl::OUString > SAL_CALL OComponentDefinition::getSupportedServiceNa Reference< XInterface > OComponentDefinition::Create( const Reference< XComponentContext >& _rxContext ) { - ::comphelper::ComponentContext aContext( _rxContext ); - return *(new OComponentDefinition( aContext.getLegacyServiceFactory(), NULL, TContentPtr( new OComponentDefinition_Impl ) ) ); + return *(new OComponentDefinition( _rxContext, NULL, TContentPtr( new OComponentDefinition_Impl ) ) ); } void SAL_CALL OComponentDefinition::disposing() diff --git a/dbaccess/source/core/dataaccess/ComponentDefinition.hxx b/dbaccess/source/core/dataaccess/ComponentDefinition.hxx index fa0901da7b6f..0f9ff09320e6 100644 --- a/dbaccess/source/core/dataaccess/ComponentDefinition.hxx +++ b/dbaccess/source/core/dataaccess/ComponentDefinition.hxx @@ -103,7 +103,7 @@ protected: protected: - OComponentDefinition(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& + OComponentDefinition(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& ,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xParentContainer ,const TContentPtr& _pImpl ,sal_Bool _bTable = sal_True); @@ -115,7 +115,7 @@ public: OComponentDefinition( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxContainer ,const ::rtl::OUString& _rElementName - ,const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& + ,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& ,const TContentPtr& _pImpl ,sal_Bool _bTable = sal_True ); diff --git a/dbaccess/source/core/dataaccess/ContentHelper.cxx b/dbaccess/source/core/dataaccess/ContentHelper.cxx index 87b64807bd63..2fbb2fa7d145 100644 --- a/dbaccess/source/core/dataaccess/ContentHelper.cxx +++ b/dbaccess/source/core/dataaccess/ContentHelper.cxx @@ -61,15 +61,15 @@ OContentHelper_Impl::~OContentHelper_Impl() DBG_DTOR(OContentHelper_Impl,NULL); } -OContentHelper::OContentHelper(const Reference< XMultiServiceFactory >& _xORB +OContentHelper::OContentHelper(const Reference< XComponentContext >& _xORB ,const Reference< XInterface >& _xParentContainer ,const TContentPtr& _pImpl) : OContentHelper_COMPBASE(m_aMutex) ,m_aContentListeners(m_aMutex) ,m_aPropertyChangeListeners(m_aMutex) - ,m_xParentContainer(_xParentContainer) + ,m_xParentContainer( _xParentContainer ) ,m_aContext( _xORB ) - ,m_aErrorHelper( m_aContext.getUNOContext() ) + ,m_aErrorHelper( m_aContext ) ,m_pImpl(_pImpl) ,m_nCommandId(0) { @@ -423,7 +423,7 @@ Reference< XRow > OContentHelper::getPropertyValues( const Sequence< Property >& { // Note: Empty sequence means "get values of all supported properties". - rtl::Reference< ::ucbhelper::PropertyValueSet > xRow = new ::ucbhelper::PropertyValueSet( m_aContext.getUNOContext() ); + rtl::Reference< ::ucbhelper::PropertyValueSet > xRow = new ::ucbhelper::PropertyValueSet( m_aContext ); sal_Int32 nCount = rProperties.getLength(); if ( nCount ) diff --git a/dbaccess/source/core/dataaccess/ModelImpl.cxx b/dbaccess/source/core/dataaccess/ModelImpl.cxx index 2d77fc1a2706..6121644f18a8 100644 --- a/dbaccess/source/core/dataaccess/ModelImpl.cxx +++ b/dbaccess/source/core/dataaccess/ModelImpl.cxx @@ -403,7 +403,7 @@ void SAL_CALL DocumentStorageAccess::disposing( const css::lang::EventObject& So //============================================================ DBG_NAME(ODatabaseModelImpl) -ODatabaseModelImpl::ODatabaseModelImpl( const Reference< XMultiServiceFactory >& _rxFactory, ODatabaseContext& _rDBContext ) +ODatabaseModelImpl::ODatabaseModelImpl( const Reference< XComponentContext >& _rxContext, ODatabaseContext& _rDBContext ) :m_xModel() ,m_xDataSource() ,m_pStorageAccess( NULL ) @@ -417,7 +417,7 @@ ODatabaseModelImpl::ODatabaseModelImpl( const Reference< XMultiServiceFactory >& ,m_aEmbeddedMacros() ,m_bModificationLock( false ) ,m_bDocumentInitialized( false ) - ,m_aContext( _rxFactory ) + ,m_aContext( _rxContext ) ,m_nLoginTimeout(0) ,m_bReadOnly(sal_False) ,m_bPasswordRequired(sal_False) @@ -437,7 +437,7 @@ ODatabaseModelImpl::ODatabaseModelImpl( const Reference< XMultiServiceFactory >& ODatabaseModelImpl::ODatabaseModelImpl( const ::rtl::OUString& _rRegistrationName, - const Reference< XMultiServiceFactory >& _rxFactory, + const Reference< XComponentContext >& _rxContext, ODatabaseContext& _rDBContext ) :m_xModel() @@ -453,7 +453,7 @@ ODatabaseModelImpl::ODatabaseModelImpl( ,m_aEmbeddedMacros() ,m_bModificationLock( false ) ,m_bDocumentInitialized( false ) - ,m_aContext( _rxFactory ) + ,m_aContext( _rxContext ) ,m_sName(_rRegistrationName) ,m_nLoginTimeout(0) ,m_bReadOnly(sal_False) @@ -492,7 +492,7 @@ void ODatabaseModelImpl::impl_construct_nothrow() aInitArgs[0] <<= NamedValue("AutomaticAddition", makeAny( (sal_Bool)sal_True )); aInitArgs[1] <<= NamedValue("AllowedTypes", makeAny( aAllowedTypes )); - m_xSettings.set( m_aContext.createComponentWithArguments( "com.sun.star.beans.PropertyBag", aInitArgs ), UNO_QUERY_THROW ); + m_xSettings.set( m_aContext->getServiceManager()->createInstanceWithArgumentsAndContext("com.sun.star.beans.PropertyBag", aInitArgs, m_aContext), UNO_QUERY_THROW ); // insert the default settings Reference< XPropertyContainer > xContainer( m_xSettings, UNO_QUERY_THROW ); @@ -757,7 +757,7 @@ const Reference< XNumberFormatsSupplier > & ODatabaseModelImpl::getNumberFormats UserInformation aUserInfo; Locale aLocale = aUserInfo.getUserLanguage(); - m_xNumberFormatsSupplier.set( NumberFormatsSupplier::createWithLocale( m_aContext.getUNOContext(), aLocale ) ); + m_xNumberFormatsSupplier.set( NumberFormatsSupplier::createWithLocale( m_aContext, aLocale ) ); } return m_xNumberFormatsSupplier; } @@ -810,7 +810,7 @@ void ODatabaseModelImpl::disposeStorages() SAL_THROW(()) Reference< XSingleServiceFactory > ODatabaseModelImpl::createStorageFactory() const { - return StorageFactory::create( m_aContext.getUNOContext() ); + return StorageFactory::create( m_aContext ); } void ODatabaseModelImpl::commitRootStorage() @@ -828,7 +828,7 @@ Reference< XStorage > ODatabaseModelImpl::getOrCreateRootStorage() { if ( !m_xDocumentStorage.is() ) { - Reference< XSingleServiceFactory> xStorageFactory = StorageFactory::create( m_aContext.getUNOContext() ); + Reference< XSingleServiceFactory> xStorageFactory = StorageFactory::create( m_aContext ); Any aSource; aSource = m_aMediaDescriptor.get( "Stream" ); if ( !aSource.hasValue() ) @@ -965,7 +965,7 @@ Reference< XModel > ODatabaseModelImpl::createNewModel_deliverOwnership( bool _b try { - Reference< XGlobalEventBroadcaster > xModelCollection = GlobalEventBroadcaster::create( m_aContext.getUNOContext() ); + Reference< XGlobalEventBroadcaster > xModelCollection = GlobalEventBroadcaster::create( m_aContext ); xModelCollection->insert( makeAny( xModel ) ); } catch( const Exception& ) @@ -1157,7 +1157,7 @@ Reference< XStorageBasedLibraryContainer > ODatabaseModelImpl::getLibraryContain = _bScript ? &DocumentScriptLibraryContainer::create : &DocumentDialogLibraryContainer::create; rxContainer.set( - (*Factory)( m_aContext.getUNOContext(), xDocument ), + (*Factory)( m_aContext, xDocument ), UNO_QUERY_THROW ); } diff --git a/dbaccess/source/core/dataaccess/ModelImpl.hxx b/dbaccess/source/core/dataaccess/ModelImpl.hxx index ab56f7427a98..194b6a23bd2b 100644 --- a/dbaccess/source/core/dataaccess/ModelImpl.hxx +++ b/dbaccess/source/core/dataaccess/ModelImpl.hxx @@ -39,7 +39,6 @@ #include <com/sun/star/frame/XModel.hpp> #include <com/sun/star/frame/XStorable.hpp> #include <com/sun/star/lang/NotInitializedException.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/sdb/XBookmarksSupplier.hpp> @@ -225,7 +224,7 @@ private: public: OWeakConnectionArray m_aConnections; - const ::comphelper::ComponentContext m_aContext; + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_aContext; public: ::com::sun::star::uno::WeakReference< ::com::sun::star::container::XNameAccess > m_xCommandDefinitions; @@ -277,14 +276,14 @@ public: SAL_THROW(( ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException )); ODatabaseModelImpl( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory, + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext, ODatabaseContext& _pDBContext ); virtual ~ODatabaseModelImpl(); ODatabaseModelImpl( const ::rtl::OUString& _rRegistrationName, - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory, + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext, ODatabaseContext& _rDBContext ); diff --git a/dbaccess/source/core/dataaccess/commandcontainer.cxx b/dbaccess/source/core/dataaccess/commandcontainer.cxx index 245f98b6c4e6..f665df20e53d 100644 --- a/dbaccess/source/core/dataaccess/commandcontainer.cxx +++ b/dbaccess/source/core/dataaccess/commandcontainer.cxx @@ -42,7 +42,7 @@ namespace dbaccess //========================================================================== DBG_NAME(OCommandContainer) -OCommandContainer::OCommandContainer( const Reference< ::com::sun::star::lang::XMultiServiceFactory >& _xORB +OCommandContainer::OCommandContainer( const Reference< ::com::sun::star::uno::XComponentContext >& _xORB ,const Reference< XInterface >& _xParentContainer ,const TContentPtr& _pImpl ,sal_Bool _bTables @@ -68,8 +68,8 @@ Reference< XContent > OCommandContainer::createObject( const ::rtl::OUString& _r const TContentPtr& pElementContent( rDefinitions.find( _rName )->second ); if ( m_bTables ) - return new OComponentDefinition( *this, _rName, m_aContext.getLegacyServiceFactory(), pElementContent, m_bTables ); - return new OCommandDefinition( *this, _rName, m_aContext.getLegacyServiceFactory(), pElementContent ); + return new OComponentDefinition( *this, _rName, m_aContext, pElementContent, m_bTables ); + return new OCommandDefinition( *this, _rName, m_aContext, pElementContent ); } Reference< XInterface > SAL_CALL OCommandContainer::createInstanceWithArguments(const Sequence< Any >& /*aArguments*/ ) throw (Exception, RuntimeException) @@ -80,9 +80,9 @@ Reference< XInterface > SAL_CALL OCommandContainer::createInstanceWithArguments( Reference< XInterface > SAL_CALL OCommandContainer::createInstance( ) throw (Exception, RuntimeException) { if(m_bTables) - return com::sun::star::sdb::TableDefinition::createDefault( m_aContext.getUNOContext() ); + return com::sun::star::sdb::TableDefinition::createDefault( m_aContext ); else - return m_aContext.createComponent( (::rtl::OUString)( SERVICE_SDB_COMMAND_DEFINITION ) ); + return m_aContext->getServiceManager()->createInstanceWithContext(SERVICE_SDB_COMMAND_DEFINITION, m_aContext); } OUString OCommandContainer::determineContentType() const diff --git a/dbaccess/source/core/dataaccess/commandcontainer.hxx b/dbaccess/source/core/dataaccess/commandcontainer.hxx index b270cb13faed..39ddb15c357e 100644 --- a/dbaccess/source/core/dataaccess/commandcontainer.hxx +++ b/dbaccess/source/core/dataaccess/commandcontainer.hxx @@ -44,7 +44,7 @@ public: /** constructs the container.<BR> */ OCommandContainer( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _xORB + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _xORB ,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xParentContainer ,const TContentPtr& _pImpl ,sal_Bool _bTables diff --git a/dbaccess/source/core/dataaccess/commanddefinition.cxx b/dbaccess/source/core/dataaccess/commanddefinition.cxx index a6998f4d642a..560b97738495 100644 --- a/dbaccess/source/core/dataaccess/commanddefinition.cxx +++ b/dbaccess/source/core/dataaccess/commanddefinition.cxx @@ -28,7 +28,6 @@ #include <tools/debug.hxx> #include <comphelper/sequence.hxx> -#include <comphelper/componentcontext.hxx> using namespace ::com::sun::star::uno; using namespace ::com::sun::star::sdbc; @@ -73,7 +72,7 @@ void OCommandDefinition::registerProperties() &rCommandDefinition.m_aLayoutInformation, ::getCppuType(&rCommandDefinition.m_aLayoutInformation)); } -OCommandDefinition::OCommandDefinition(const Reference< XMultiServiceFactory >& _xORB +OCommandDefinition::OCommandDefinition(const Reference< XComponentContext >& _xORB ,const Reference< XInterface >& _rxContainer ,const TContentPtr& _pImpl) :OComponentDefinition(_xORB,_rxContainer,_pImpl,sal_False) @@ -89,7 +88,7 @@ OCommandDefinition::~OCommandDefinition() OCommandDefinition::OCommandDefinition( const Reference< XInterface >& _rxContainer ,const ::rtl::OUString& _rElementName - ,const Reference< XMultiServiceFactory >& _xORB + ,const Reference< XComponentContext >& _xORB ,const TContentPtr& _pImpl) :OComponentDefinition(_rxContainer,_rElementName,_xORB,_pImpl,sal_False) { @@ -128,8 +127,7 @@ Sequence< ::rtl::OUString > SAL_CALL OCommandDefinition::getSupportedServiceName Reference< XInterface > OCommandDefinition::Create(const Reference< XComponentContext >& _rxContext) { - ::comphelper::ComponentContext aContext( _rxContext ); - return *(new OCommandDefinition( aContext.getLegacyServiceFactory(), NULL, TContentPtr( new OCommandDefinition_Impl ) ) ); + return *(new OCommandDefinition( _rxContext, NULL, TContentPtr( new OCommandDefinition_Impl ) ) ); } void SAL_CALL OCommandDefinition::rename( const ::rtl::OUString& newName ) throw (SQLException, ElementExistException, RuntimeException) diff --git a/dbaccess/source/core/dataaccess/commanddefinition.hxx b/dbaccess/source/core/dataaccess/commanddefinition.hxx index 448e1195efc9..f2a469bb7c22 100644 --- a/dbaccess/source/core/dataaccess/commanddefinition.hxx +++ b/dbaccess/source/core/dataaccess/commanddefinition.hxx @@ -60,7 +60,7 @@ class OCommandDefinition :public OComponentDefinition protected: virtual ~OCommandDefinition(); - OCommandDefinition(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& + OCommandDefinition(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& ,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xParentContainer ,const TContentPtr& _pImpl ); @@ -73,7 +73,7 @@ public: OCommandDefinition( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxContainer ,const ::rtl::OUString& _rElementName - ,const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& + ,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& ,const TContentPtr& _pImpl ); diff --git a/dbaccess/source/core/dataaccess/connection.cxx b/dbaccess/source/core/dataaccess/connection.cxx index 12dafb6c99f0..5fa53ae58541 100644 --- a/dbaccess/source/core/dataaccess/connection.cxx +++ b/dbaccess/source/core/dataaccess/connection.cxx @@ -282,7 +282,7 @@ DBG_NAME(OConnection) OConnection::OConnection(ODatabaseSource& _rDB , Reference< XConnection >& _rxMaster - , const Reference< XMultiServiceFactory >& _rxORB) + , const Reference< XComponentContext >& _rxORB) :OSubComponent(m_aMutex, static_cast< OWeakObject* >(&_rDB)) // as the queries reroute their refcounting to us, this m_aMutex is okey. If the queries // container would do it's own refcounting, it would have to aquire m_pMutex @@ -305,8 +305,7 @@ OConnection::OConnection(ODatabaseSource& _rDB try { - Reference< XProxyFactory > xProxyFactory = - ProxyFactory::create( m_aContext.getUNOContext() ); + Reference< XProxyFactory > xProxyFactory = ProxyFactory::create( m_aContext ); Reference<XAggregation> xAgg = xProxyFactory->createProxy(_rxMaster.get()); setDelegation(xAgg,m_refCount); OSL_ENSURE(m_xConnection.is(), "OConnection::OConnection : invalid master connection !"); @@ -320,7 +319,7 @@ OConnection::OConnection(ODatabaseSource& _rDB try { - m_xQueries = new OQueryContainer(Reference< XNameContainer >(_rDB.getQueryDefinitions( ),UNO_QUERY), this,_rxORB, &m_aWarnings); + m_xQueries = new OQueryContainer(Reference< XNameContainer >(_rDB.getQueryDefinitions(), UNO_QUERY), this, _rxORB, &m_aWarnings); sal_Bool bCase = sal_True; Reference<XDatabaseMetaData> xMeta; @@ -685,7 +684,11 @@ Reference< XInterface > SAL_CALL OConnection::createInstance( const OUString& _s Sequence<Any> aArgs(1); Reference<XConnection> xMy(this); aArgs[0] <<= NamedValue("ActiveConnection",makeAny(xMy)); - aFind = m_aSupportServices.insert(TSupportServices::value_type(_sServiceSpecifier,m_aContext.createComponentWithArguments(_sServiceSpecifier,aArgs))).first; + aFind = m_aSupportServices.insert( + TSupportServices::value_type( + _sServiceSpecifier, + m_aContext->getServiceManager()->createInstanceWithArgumentsAndContext(_sServiceSpecifier, aArgs, m_aContext) + )).first; } return aFind->second; } @@ -717,7 +720,7 @@ Reference< XTablesSupplier > OConnection::getMasterTables() { Reference<XDatabaseMetaData> xMeta = getMetaData(); if ( xMeta.is() ) - m_xMasterTables = ::dbtools::getDataDefinitionByURLAndConnection( xMeta->getURL(), m_xMasterConnection, m_aContext.getUNOContext() ); + m_xMasterTables = ::dbtools::getDataDefinitionByURLAndConnection( xMeta->getURL(), m_xMasterConnection, m_aContext ); } catch(const SQLException&) { @@ -753,8 +756,9 @@ void OConnection::impl_loadConnectionTools_throw() Sequence< Any > aArguments( 1 ); aArguments[0] <<= NamedValue( "Connection" , makeAny( Reference< XConnection >( this ) ) ); - if ( !m_aContext.createComponentWithArguments( "com.sun.star.sdb.tools.ConnectionTools", aArguments, m_xConnectionTools ) ) - throw RuntimeException( "service not registered: com.sun.star.sdb.tools.ConnectionTools" , *this ); + m_xConnectionTools.set( + m_aContext->getServiceManager()->createInstanceWithArgumentsAndContext("com.sun.star.sdb.tools.ConnectionTools", aArguments, m_aContext), + UNO_QUERY_THROW ); } Reference< XTableName > SAL_CALL OConnection::createTableName( ) throw (RuntimeException) diff --git a/dbaccess/source/core/dataaccess/connection.hxx b/dbaccess/source/core/dataaccess/connection.hxx index 8a2efc5b16cc..14534241917b 100644 --- a/dbaccess/source/core/dataaccess/connection.hxx +++ b/dbaccess/source/core/dataaccess/connection.hxx @@ -43,7 +43,6 @@ #define COMPHELPER_IMPLBASE_INTERFACE_NUMBER 14 #include <comphelper/implbase_var.hxx> #endif -#include <comphelper/componentcontext.hxx> #include <comphelper/stl_types.hxx> #include <connectivity/ConnectionWrapper.hxx> #include <connectivity/warningscontainer.hxx> @@ -92,7 +91,7 @@ protected: // the filter as set on the parent data link at construction of the connection ::com::sun::star::uno::Sequence< ::rtl::OUString > m_aTableFilter; ::com::sun::star::uno::Sequence< ::rtl::OUString > m_aTableTypeFilter; - ::comphelper::ComponentContext m_aContext; + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_aContext; ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > m_xMasterConnection; ::com::sun::star::uno::Reference< ::com::sun::star::sdb::tools::XConnectionTools > m_xConnectionTools; ::com::sun::star::uno::Reference< ::com::sun::star::sdb::application::XTableUIProvider > m_xTableUIProvider; @@ -116,7 +115,7 @@ protected: public: OConnection(ODatabaseSource& _rDB ,::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxMaster - ,const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB); + ,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxORB); // com::sun::star::lang::XTypeProvider virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException); diff --git a/dbaccess/source/core/dataaccess/dataaccessdescriptor.cxx b/dbaccess/source/core/dataaccess/dataaccessdescriptor.cxx index 197742c339eb..be895d7ad99c 100644 --- a/dbaccess/source/core/dataaccess/dataaccessdescriptor.cxx +++ b/dbaccess/source/core/dataaccess/dataaccessdescriptor.cxx @@ -29,7 +29,6 @@ #include <com/sun/star/sdb/XDataAccessDescriptorFactory.hpp> #include <comphelper/broadcasthelper.hxx> -#include <comphelper/componentcontext.hxx> #include <comphelper/proparrhlp.hxx> #include <comphelper/propertycontainer.hxx> #include <comphelper/uno3.hxx> @@ -83,7 +82,7 @@ namespace dbaccess ,public ::comphelper::OPropertyArrayUsageHelper< DataAccessDescriptor > { public: - DataAccessDescriptor( const ::comphelper::ComponentContext& _rContext ); + DataAccessDescriptor( const Reference<XComponentContext> & _rContext ); // UNO DECLARE_XINTERFACE() @@ -106,7 +105,7 @@ namespace dbaccess virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const; private: - ::comphelper::ComponentContext m_aContext; + Reference<XComponentContext> m_xContext; // </properties> ::rtl::OUString m_sDataSourceName; @@ -132,11 +131,11 @@ namespace dbaccess #define REGISTER_PROPERTY( propname, member ) \ registerProperty( PROPERTY_##propname, PROPERTY_ID_##propname, PropertyAttribute::BOUND, &member, ::getCppuType( &member ) ) - DataAccessDescriptor::DataAccessDescriptor( const ::comphelper::ComponentContext& _rContext ) + DataAccessDescriptor::DataAccessDescriptor( const Reference<XComponentContext> & _rContext ) :DataAccessDescriptor_MutexBase() ,DataAccessDescriptor_TypeBase() ,DataAccessDescriptor_PropertyBase( m_aBHelper ) - ,m_aContext( _rContext ) + ,m_xContext( _rContext ) ,m_sDataSourceName() ,m_sDatabaseLocation() ,m_sConnectionResource() @@ -248,11 +247,11 @@ namespace dbaccess ~DataAccessDescriptorFactory(); private: - ::comphelper::ComponentContext m_aContext; + Reference<XComponentContext> m_xContext; }; DataAccessDescriptorFactory::DataAccessDescriptorFactory( const Reference< XComponentContext >& _rxContext ) - :m_aContext( _rxContext ) + :m_xContext( _rxContext ) { } @@ -302,7 +301,7 @@ namespace dbaccess Reference< XPropertySet > SAL_CALL DataAccessDescriptorFactory::createDataAccessDescriptor( ) throw (RuntimeException) { - return new DataAccessDescriptor( m_aContext ); + return new DataAccessDescriptor( m_xContext ); } } // namespace dbaccess diff --git a/dbaccess/source/core/dataaccess/databasecontext.cxx b/dbaccess/source/core/dataaccess/databasecontext.cxx index e01d432b643e..5211222837d4 100644 --- a/dbaccess/source/core/dataaccess/databasecontext.cxx +++ b/dbaccess/source/core/dataaccess/databasecontext.cxx @@ -238,7 +238,7 @@ Sequence< OUString > ODatabaseContext::getSupportedServiceNames( ) throw (Runti Reference< XInterface > ODatabaseContext::impl_createNewDataSource() { - ::rtl::Reference<ODatabaseModelImpl> pImpl( new ODatabaseModelImpl( m_aContext.getLegacyServiceFactory(), *this ) ); + ::rtl::Reference<ODatabaseModelImpl> pImpl( new ODatabaseModelImpl( m_aContext, *this ) ); Reference< XDataSource > xDataSource( pImpl->getOrCreateDataSource() ); return xDataSource.get(); @@ -352,7 +352,7 @@ Reference< XInterface > ODatabaseContext::loadObjectFromURL(const OUString& _rNa ::rtl::Reference< ODatabaseModelImpl > pModelImpl; { - pModelImpl.set( new ODatabaseModelImpl( _rName, m_aContext.getLegacyServiceFactory(), *this ) ); + pModelImpl.set( new ODatabaseModelImpl( _rName, m_aContext, *this ) ); Reference< XModel > xModel( pModelImpl->createNewModel_deliverOwnership( false ), UNO_SET_THROW ); Reference< XLoadable > xLoad( xModel, UNO_QUERY_THROW ); @@ -360,7 +360,7 @@ Reference< XInterface > ODatabaseContext::loadObjectFromURL(const OUString& _rNa ::comphelper::NamedValueCollection aArgs; aArgs.put( "URL", _sURL ); aArgs.put( "MacroExecutionMode", MacroExecMode::USE_CONFIG ); - aArgs.put( "InteractionHandler", task::InteractionHandler::createWithParent(m_aContext.getUNOContext(), 0) ); + aArgs.put( "InteractionHandler", task::InteractionHandler::createWithParent(m_aContext, 0) ); Sequence< PropertyValue > aResource( aArgs.getPropertyValues() ); xLoad->load( aResource ); diff --git a/dbaccess/source/core/dataaccess/databasecontext.hxx b/dbaccess/source/core/dataaccess/databasecontext.hxx index 7f99ea7b3c50..03fa975240ef 100644 --- a/dbaccess/source/core/dataaccess/databasecontext.hxx +++ b/dbaccess/source/core/dataaccess/databasecontext.hxx @@ -38,7 +38,6 @@ #include <com/sun/star/uno/XAggregation.hpp> #include <basic/basicmanagerrepository.hxx> -#include <comphelper/componentcontext.hxx> #include <comphelper/stl_types.hxx> #include <cppuhelper/compbase3.hxx> #include <cppuhelper/interfacecontainer.hxx> @@ -94,7 +93,8 @@ private: protected: ::osl::Mutex m_aMutex; - ::comphelper::ComponentContext m_aContext; + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > + m_aContext; ::com::sun::star::uno::Reference< ::com::sun::star::uno::XAggregation > m_xDBRegistrationAggregate; diff --git a/dbaccess/source/core/dataaccess/databasedocument.cxx b/dbaccess/source/core/dataaccess/databasedocument.cxx index b1f5308535f3..41ba7dd3c150 100644 --- a/dbaccess/source/core/dataaccess/databasedocument.cxx +++ b/dbaccess/source/core/dataaccess/databasedocument.cxx @@ -487,7 +487,7 @@ void ODatabaseDocument::impl_reset_nothrow() m_pImpl->m_bDocumentReadOnly = sal_False; } -void ODatabaseDocument::impl_import_nolck_throw( const ::comphelper::ComponentContext _rContext, const Reference< XInterface >& _rxTargetComponent, +void ODatabaseDocument::impl_import_nolck_throw( const Reference< XComponentContext >& _rContext, const Reference< XInterface >& _rxTargetComponent, const ::comphelper::NamedValueCollection& _rResource ) { Sequence< Any > aFilterCreationArgs; @@ -510,7 +510,7 @@ void ODatabaseDocument::impl_import_nolck_throw( const ::comphelper::ComponentCo aFilterCreationArgs[nCount] <<= xInfoSet; Reference< XImporter > xImporter( - _rContext.createComponentWithArguments( "com.sun.star.comp.sdb.DBFilter", aFilterCreationArgs ), + _rContext->getServiceManager()->createInstanceWithArgumentsAndContext("com.sun.star.comp.sdb.DBFilter", aFilterCreationArgs, _rContext), UNO_QUERY_THROW ); Reference< XComponent > xComponent( _rxTargetComponent, UNO_QUERY_THROW ); @@ -534,8 +534,7 @@ void SAL_CALL ODatabaseDocument::initNew( ) throw (DoubleInitializationExceptio impl_setInitializing(); // create a temporary storage - Reference< XStorage > xTempStor( ::comphelper::OStorageHelper::GetTemporaryStorage( - m_pImpl->m_aContext.getUNOContext() ) ); + Reference< XStorage > xTempStor( ::comphelper::OStorageHelper::GetTemporaryStorage( m_pImpl->m_aContext ) ); // store therein impl_storeToStorage_throw( xTempStor, Sequence< PropertyValue >(), aGuard ); @@ -1125,7 +1124,7 @@ void ODatabaseDocument::impl_storeAs_throw( const OUString& _rURL, const ::comph Reference< XStorage > ODatabaseDocument::impl_createStorageFor_throw( const OUString& _rURL ) const { - Reference< ucb::XSimpleFileAccess3 > xTempAccess(ucb::SimpleFileAccess::create(m_pImpl->m_aContext.getUNOContext())); + Reference< ucb::XSimpleFileAccess3 > xTempAccess(ucb::SimpleFileAccess::create(m_pImpl->m_aContext)); Reference< io::XStream > xStream = xTempAccess->openFileReadWrite( _rURL ); Reference< io::XTruncate > xTruncate(xStream,UNO_QUERY); if ( xTruncate.is() ) @@ -1415,14 +1414,16 @@ Reference< XNameAccess > ODatabaseDocument::impl_getDocumentContainer_throw( ODa { Sequence<Any> aArgs(1); aArgs[0] <<= NamedValue("DatabaseDocument",makeAny(xMy)); - xContainer.set(m_pImpl->m_aContext.createComponentWithArguments(sSupportService,aArgs),UNO_QUERY); + xContainer.set( + m_pImpl->m_aContext->getServiceManager()->createInstanceWithArgumentsAndContext(sSupportService, aArgs, m_pImpl->m_aContext), + UNO_QUERY); rContainerRef = xContainer; } } if ( !xContainer.is() ) { TContentPtr& rContainerData( m_pImpl->getObjectContainer( _eType ) ); - rContainerRef = xContainer = new ODocumentContainer( m_pImpl->m_aContext.getLegacyServiceFactory(), *this, rContainerData, bFormsContainer ); + rContainerRef = xContainer = new ODocumentContainer( m_pImpl->m_aContext, *this, rContainerData, bFormsContainer ); } impl_reparent_nothrow( xContainer ); } @@ -1582,7 +1583,7 @@ void ODatabaseDocument::WriteThroughComponent( const Reference< XOutputStream >& OSL_ENSURE( NULL != pServiceName, "Need component name!" ); // get component - Reference< XWriter > xSaxWriter = xml::sax::Writer::create( m_pImpl->m_aContext.getUNOContext() ); + Reference< XWriter > xSaxWriter = xml::sax::Writer::create( m_pImpl->m_aContext ); // connect XML writer to output stream xSaxWriter->setOutputStream( xOutputStream ); @@ -1595,10 +1596,7 @@ void ODatabaseDocument::WriteThroughComponent( const Reference< XOutputStream >& aArgs[ i+1 ] = _rArguments[i]; // get filter component - Reference< XExporter > xExporter; - OSL_VERIFY( m_pImpl->m_aContext.createComponentWithArguments( pServiceName, aArgs, xExporter ) ); - if ( !xExporter.is() ) - return; + Reference< XExporter > xExporter( m_pImpl->m_aContext->getServiceManager()->createInstanceWithArgumentsAndContext(OUString::createFromAscii(pServiceName), aArgs, m_pImpl->m_aContext), UNO_QUERY_THROW ); // connect model and filter xExporter->setSourceDocument( xComponent ); @@ -1677,7 +1675,7 @@ void ODatabaseDocument::impl_writeStorage_throw( const Reference< XStorage >& _r if ( xDlgs.is() ) { Reference< XModel > xModel(const_cast< ODatabaseDocument*>(this)); - lcl_uglyHackToStoreDialogeEmbedImages( m_pImpl->getLibraryContainer(false), _rxTargetStorage, xModel, m_pImpl->m_aContext.getUNOContext() ); + lcl_uglyHackToStoreDialogeEmbedImages( m_pImpl->getLibraryContainer(false), _rxTargetStorage, xModel, m_pImpl->m_aContext ); } } catch ( const Exception& ) @@ -1699,7 +1697,7 @@ Reference< XUIConfigurationManager2 > ODatabaseDocument::getUIConfigurationManag if ( !m_xUIConfigurationManager.is() ) { - m_xUIConfigurationManager = UIConfigurationManager::create( m_pImpl->m_aContext.getUNOContext() ); + m_xUIConfigurationManager = UIConfigurationManager::create( m_pImpl->m_aContext ); OUString aUIConfigFolderName( "Configurations2" ); Reference< XStorage > xConfigStorage; @@ -1865,11 +1863,10 @@ Sequence< OUString > ODatabaseDocument::getSupportedServiceNames( ) throw (Runt Reference< XInterface > ODatabaseDocument::Create( const Reference< XComponentContext >& _rxContext ) { - ::comphelper::ComponentContext aContext( _rxContext ); Reference< XUnoTunnel > xDBContextTunnel( DatabaseContext::create(_rxContext), UNO_QUERY_THROW ); ODatabaseContext* pContext = reinterpret_cast< ODatabaseContext* >( xDBContextTunnel->getSomething( ODatabaseContext::getUnoTunnelImplementationId() ) ); - ::rtl::Reference<ODatabaseModelImpl> pImpl( new ODatabaseModelImpl( aContext.getLegacyServiceFactory(), *pContext ) ); + ::rtl::Reference<ODatabaseModelImpl> pImpl( new ODatabaseModelImpl( _rxContext, *pContext ) ); Reference< XModel > xModel( pImpl->createNewModel_deliverOwnership( false ) ); return xModel.get(); } @@ -1969,7 +1966,7 @@ Reference< provider::XScriptProvider > SAL_CALL ODatabaseDocument::getScriptProv if ( !xScriptProvider.is() ) { Reference < XScriptProviderFactory > xFactory = - theMasterScriptProviderFactory::get( m_pImpl->m_aContext.getUNOContext() ); + theMasterScriptProviderFactory::get( m_pImpl->m_aContext ); Any aScriptProviderContext; if ( m_bAllowDocumentScripting ) @@ -2036,11 +2033,11 @@ Reference< XController2 > SAL_CALL ODatabaseDocument::createViewController( cons throw IllegalArgumentException( OUString(), *this, 3 ); DocumentGuard aGuard( *this ); - ::comphelper::ComponentContext aContext( m_pImpl->m_aContext ); aGuard.clear(); - Reference< XController2 > xController; - aContext.createComponent( "org.openoffice.comp.dbu.OApplicationController", xController ); + Reference< XController2 > xController( + m_pImpl->m_aContext->getServiceManager()->createInstanceWithContext("org.openoffice.comp.dbu.OApplicationController", m_pImpl->m_aContext), + UNO_QUERY_THROW ); ::comphelper::NamedValueCollection aInitArgs( _Arguments ); aInitArgs.put( "Frame", _Frame ); @@ -2056,10 +2053,10 @@ Reference< XTitle > ODatabaseDocument::impl_getTitleHelper_throw() { if ( ! m_xTitleHelper.is ()) { - Reference< XUntitledNumbers > xDesktop(Desktop::create(m_pImpl->m_aContext.getUNOContext()), uno::UNO_QUERY_THROW); + Reference< XUntitledNumbers > xDesktop(Desktop::create(m_pImpl->m_aContext), uno::UNO_QUERY_THROW); Reference< frame::XModel > xThis (getThis(), uno::UNO_QUERY_THROW); - ::framework::TitleHelper* pHelper = new ::framework::TitleHelper(m_pImpl->m_aContext.getUNOContext()); + ::framework::TitleHelper* pHelper = new ::framework::TitleHelper(m_pImpl->m_aContext); m_xTitleHelper.set(static_cast< ::cppu::OWeakObject* >(pHelper), uno::UNO_QUERY_THROW); pHelper->setOwner (xThis ); pHelper->connectWithUntitledNumbers (xDesktop); @@ -2071,7 +2068,7 @@ Reference< XTitle > ODatabaseDocument::impl_getTitleHelper_throw() uno::Reference< frame::XUntitledNumbers > ODatabaseDocument::impl_getUntitledHelper_throw(const uno::Reference< uno::XInterface >& _xComponent) { if ( !m_xModuleManager.is() ) - m_xModuleManager.set( ModuleManager::create(m_pImpl->m_aContext.getUNOContext()) ); + m_xModuleManager.set( ModuleManager::create(m_pImpl->m_aContext) ); OUString sModuleId; try diff --git a/dbaccess/source/core/dataaccess/databasedocument.hxx b/dbaccess/source/core/dataaccess/databasedocument.hxx index 56d111149470..a01a901c12e5 100644 --- a/dbaccess/source/core/dataaccess/databasedocument.hxx +++ b/dbaccess/source/core/dataaccess/databasedocument.hxx @@ -541,7 +541,7 @@ private: */ static void impl_import_nolck_throw( - const ::comphelper::ComponentContext _rContext, + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rContext, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxTargetComponent, const ::comphelper::NamedValueCollection& _rResource ); diff --git a/dbaccess/source/core/dataaccess/databaseregistrations.cxx b/dbaccess/source/core/dataaccess/databaseregistrations.cxx index 5886fbd2d492..6eb4656a29af 100644 --- a/dbaccess/source/core/dataaccess/databaseregistrations.cxx +++ b/dbaccess/source/core/dataaccess/databaseregistrations.cxx @@ -20,7 +20,6 @@ #include <com/sun/star/sdb/XDatabaseRegistrations.hpp> -#include <comphelper/componentcontext.hxx> #include <cppuhelper/basemutex.hxx> #include <cppuhelper/interfacecontainer.hxx> #include <cppuhelper/implbase1.hxx> @@ -43,6 +42,7 @@ namespace dbaccess using ::com::sun::star::uno::makeAny; using ::com::sun::star::uno::Sequence; using ::com::sun::star::uno::Type; + using ::com::sun::star::uno::XComponentContext; using ::com::sun::star::container::NoSuchElementException; using ::com::sun::star::lang::IllegalArgumentException; using ::com::sun::star::lang::IllegalAccessException; @@ -80,7 +80,7 @@ namespace dbaccess ,public DatabaseRegistrations_Base { public: - DatabaseRegistrations( const ::comphelper::ComponentContext& _rxContext ); + DatabaseRegistrations( const Reference<XComponentContext>& _rxContext ); protected: ~DatabaseRegistrations(); @@ -125,7 +125,7 @@ namespace dbaccess impl_getNodeForName_nothrow( const ::rtl::OUString& _rName ); private: - ::comphelper::ComponentContext m_aContext; + Reference<XComponentContext> m_aContext; ::utl::OConfigurationTreeRoot m_aConfigurationRoot; ::cppu::OInterfaceContainerHelper m_aRegistrationListeners; }; @@ -133,13 +133,13 @@ namespace dbaccess //==================================================================== //= DatabaseRegistrations - implementation //==================================================================== - DatabaseRegistrations::DatabaseRegistrations( const ::comphelper::ComponentContext& _rxContext ) + DatabaseRegistrations::DatabaseRegistrations( const Reference<XComponentContext> & _rxContext ) :m_aContext( _rxContext ) ,m_aConfigurationRoot() ,m_aRegistrationListeners( m_aMutex ) { m_aConfigurationRoot = ::utl::OConfigurationTreeRoot::createWithComponentContext( - m_aContext.getUNOContext(), getConfigurationRootPath(), -1, ::utl::OConfigurationTreeRoot::CM_UPDATABLE ); + m_aContext, getConfigurationRootPath(), -1, ::utl::OConfigurationTreeRoot::CM_UPDATABLE ); } DatabaseRegistrations::~DatabaseRegistrations() @@ -356,7 +356,7 @@ namespace dbaccess //==================================================================== //= DatabaseRegistrations - factory //==================================================================== - Reference< XAggregation > createDataSourceRegistrations( const ::comphelper::ComponentContext& _rxContext ) + Reference< XAggregation > createDataSourceRegistrations( const Reference<XComponentContext> & _rxContext ) { return new DatabaseRegistrations( _rxContext ); } diff --git a/dbaccess/source/core/dataaccess/databaseregistrations.hxx b/dbaccess/source/core/dataaccess/databaseregistrations.hxx index 064af3867325..48677cff541a 100644 --- a/dbaccess/source/core/dataaccess/databaseregistrations.hxx +++ b/dbaccess/source/core/dataaccess/databaseregistrations.hxx @@ -22,16 +22,11 @@ #include <com/sun/star/uno/XAggregation.hpp> -namespace comphelper -{ - class ComponentContext; -} - namespace dbaccess { ::com::sun::star::uno::Reference< ::com::sun::star::uno::XAggregation > - createDataSourceRegistrations( const ::comphelper::ComponentContext& _rxContext ); + createDataSourceRegistrations( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext ); } // namespace dbaccess diff --git a/dbaccess/source/core/dataaccess/datasource.cxx b/dbaccess/source/core/dataaccess/datasource.cxx index 866e9073ebf4..9e9d4fee411d 100644 --- a/dbaccess/source/core/dataaccess/datasource.cxx +++ b/dbaccess/source/core/dataaccess/datasource.cxx @@ -644,11 +644,11 @@ Reference< XConnection > ODatabaseSource::buildLowLevelConnection(const OUString Reference< XDriverManager > xManager; try { - xManager.set( ConnectionPool::create( m_pImpl->m_aContext.getUNOContext() ), UNO_QUERY_THROW ); + xManager.set( ConnectionPool::create( m_pImpl->m_aContext ), UNO_QUERY_THROW ); } catch( const Exception& ) { } if ( !xManager.is() ) // no connection pool installed, fall back to driver manager - xManager.set( DriverManager::create(m_pImpl->m_aContext.getUNOContext() ), UNO_QUERY_THROW ); + xManager.set( DriverManager::create(m_pImpl->m_aContext ), UNO_QUERY_THROW ); OUString sUser(_rUid); OUString sPwd(_rPwd); @@ -1197,7 +1197,7 @@ Reference< XConnection > ODatabaseSource::buildIsolatedConnection(const OUString if ( xSdbcConn.is() ) { // build a connection server and return it (no stubs) - xConn = new OConnection(*this, xSdbcConn, m_pImpl->m_aContext.getLegacyServiceFactory()); + xConn = new OConnection(*this, xSdbcConn, m_pImpl->m_aContext); } return xConn; } @@ -1216,7 +1216,7 @@ Reference< XConnection > ODatabaseSource::getConnection(const OUString& user, co { // create a new proxy for the connection if ( !m_pImpl->m_xSharedConnectionManager.is() ) { - m_pImpl->m_pSharedConnectionManager = new OSharedConnectionManager( m_pImpl->m_aContext.getUNOContext() ); + m_pImpl->m_pSharedConnectionManager = new OSharedConnectionManager( m_pImpl->m_aContext ); m_pImpl->m_xSharedConnectionManager = m_pImpl->m_pSharedConnectionManager; } xConn = m_pImpl->m_pSharedConnectionManager->getConnection( @@ -1259,13 +1259,13 @@ Reference< XNameAccess > SAL_CALL ODatabaseSource::getQueryDefinitions( ) throw( { Sequence<Any> aArgs(1); aArgs[0] <<= NamedValue("DataSource",makeAny(xMy)); - xContainer.set(m_pImpl->m_aContext.createComponentWithArguments(sSupportService,aArgs),UNO_QUERY); + xContainer.set( m_pImpl->m_aContext->getServiceManager()->createInstanceWithArgumentsAndContext(sSupportService, aArgs, m_pImpl->m_aContext), UNO_QUERY); } } if ( !xContainer.is() ) { TContentPtr& rContainerData( m_pImpl->getObjectContainer( ODatabaseModelImpl::E_QUERY ) ); - xContainer = new OCommandContainer( m_pImpl->m_aContext.getLegacyServiceFactory(), *this, rContainerData, sal_False ); + xContainer = new OCommandContainer( m_pImpl->m_aContext, *this, rContainerData, sal_False ); } m_pImpl->m_xCommandDefinitions = xContainer; } @@ -1282,7 +1282,7 @@ Reference< XNameAccess > ODatabaseSource::getTables() throw( RuntimeException ) if ( !xContainer.is() ) { TContentPtr& rContainerData( m_pImpl->getObjectContainer( ODatabaseModelImpl::E_TABLE ) ); - xContainer = new OCommandContainer( m_pImpl->m_aContext.getLegacyServiceFactory(), *this, rContainerData, sal_True ); + xContainer = new OCommandContainer( m_pImpl->m_aContext, *this, rContainerData, sal_True ); m_pImpl->m_xTableDefinitions = xContainer; } return xContainer; diff --git a/dbaccess/source/core/dataaccess/definitioncontainer.cxx b/dbaccess/source/core/dataaccess/definitioncontainer.cxx index 8c8cd982c56b..181ac55e6c76 100644 --- a/dbaccess/source/core/dataaccess/definitioncontainer.cxx +++ b/dbaccess/source/core/dataaccess/definitioncontainer.cxx @@ -93,7 +93,7 @@ ODefinitionContainer_Impl::iterator ODefinitionContainer_Impl::find( TContentPtr //========================================================================== DBG_NAME(ODefinitionContainer) -ODefinitionContainer::ODefinitionContainer( const Reference< XMultiServiceFactory >& _xORB +ODefinitionContainer::ODefinitionContainer( const Reference< XComponentContext >& _xORB , const Reference< XInterface >& _xParentContainer , const TContentPtr& _pImpl , bool _bCheckSlash diff --git a/dbaccess/source/core/dataaccess/documentcontainer.cxx b/dbaccess/source/core/dataaccess/documentcontainer.cxx index a902640ecfd9..92b2ab75ea65 100644 --- a/dbaccess/source/core/dataaccess/documentcontainer.cxx +++ b/dbaccess/source/core/dataaccess/documentcontainer.cxx @@ -94,7 +94,7 @@ void SAL_CALL LocalNameApproval::approveElement( const OUString& _rName, const R //========================================================================== DBG_NAME(ODocumentContainer) -ODocumentContainer::ODocumentContainer(const Reference< XMultiServiceFactory >& _xORB +ODocumentContainer::ODocumentContainer(const Reference< XComponentContext >& _xORB ,const Reference< XInterface >& _xParentContainer ,const TContentPtr& _pImpl , sal_Bool _bFormsContainer @@ -107,7 +107,7 @@ ODocumentContainer::ODocumentContainer(const Reference< XMultiServiceFactory >& registerProperty(PROPERTY_NAME, PROPERTY_ID_NAME, PropertyAttribute::BOUND | PropertyAttribute::READONLY | PropertyAttribute::CONSTRAINED, &m_pImpl->m_aProps.aTitle, ::getCppuType(&m_pImpl->m_aProps.aTitle)); - setElementApproval( PContainerApprove( new LocalNameApproval ( comphelper::getComponentContext(_xORB) ) ) ); + setElementApproval( PContainerApprove( new LocalNameApproval ( _xORB ) ) ); } ODocumentContainer::~ODocumentContainer() @@ -145,8 +145,8 @@ Reference< XContent > ODocumentContainer::createObject( const OUString& _rName) ODefinitionContainer_Impl::const_iterator aFind = rDefinitions.find( _rName ); OSL_ENSURE( aFind != rDefinitions.end(), "ODocumentContainer::createObject:Invalid entry in map!" ); if ( aFind->second->m_aProps.bIsFolder ) - return new ODocumentContainer( m_aContext.getLegacyServiceFactory(), *this, aFind->second, m_bFormsContainer ); - return new ODocumentDefinition( *this, m_aContext.getLegacyServiceFactory(), aFind->second, m_bFormsContainer ); + return new ODocumentContainer( m_aContext, *this, aFind->second, m_bFormsContainer ); + return new ODocumentDefinition( *this, m_aContext, aFind->second, m_bFormsContainer ); } Reference< XInterface > SAL_CALL ODocumentContainer::createInstance( const OUString& aServiceSpecifier ) throw (Exception, RuntimeException) @@ -254,7 +254,7 @@ Reference< XInterface > SAL_CALL ODocumentContainer::createInstanceWithArguments ODocumentDefinition::GetDocumentServiceFromMediaType( sMediaType, m_aContext, aClassID ); else if ( !sDocServiceName.isEmpty() ) { - ::comphelper::MimeConfigurationHelper aConfigHelper( m_aContext.getUNOContext() ); + ::comphelper::MimeConfigurationHelper aConfigHelper( m_aContext ); const Sequence< NamedValue > aProps( aConfigHelper.GetObjectPropsByDocumentName( sDocServiceName ) ); const ::comphelper::NamedValueCollection aMediaTypeProps( aProps ); aClassID = aMediaTypeProps.getOrDefault( "ClassID", Sequence< sal_Int8 >() ); @@ -278,7 +278,7 @@ Reference< XInterface > SAL_CALL ODocumentContainer::createInstanceWithArguments else pElementImpl = aFind->second; - ::rtl::Reference< ODocumentDefinition > pDocDef = new ODocumentDefinition( *this, m_aContext.getLegacyServiceFactory(), pElementImpl, m_bFormsContainer ); + ::rtl::Reference< ODocumentDefinition > pDocDef = new ODocumentDefinition( *this, m_aContext, pElementImpl, m_bFormsContainer ); if ( aClassID.getLength() ) { pDocDef->initialLoad( aClassID, aCreationArgs, xConnection ); @@ -335,7 +335,7 @@ Reference< XInterface > SAL_CALL ODocumentContainer::createInstanceWithArguments else pElementImpl = aFind->second; OSL_ENSURE( pElementImpl ," Invalid entry in map!"); - xContent = new ODocumentContainer( m_aContext.getLegacyServiceFactory(), *this, pElementImpl, ServiceSpecifier == SERVICE_NAME_FORM_COLLECTION ); + xContent = new ODocumentContainer( m_aContext, *this, pElementImpl, ServiceSpecifier == SERVICE_NAME_FORM_COLLECTION ); // copy children if ( xCopyFrom.is() ) @@ -429,7 +429,7 @@ Any SAL_CALL ODocumentContainer::execute( const Command& aCommand, sal_Int32 Com // open as folder - return result set Reference< XDynamicResultSet > xSet - = new DynamicResultSet( m_aContext.getUNOContext(), + = new DynamicResultSet( m_aContext, this, aOpenCommand, Environment ); diff --git a/dbaccess/source/core/dataaccess/documentcontainer.hxx b/dbaccess/source/core/dataaccess/documentcontainer.hxx index e3af99a7d81c..16dcd22cf8ad 100644 --- a/dbaccess/source/core/dataaccess/documentcontainer.hxx +++ b/dbaccess/source/core/dataaccess/documentcontainer.hxx @@ -53,7 +53,7 @@ public: /** constructs the container.<BR> */ ODocumentContainer( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _xORB + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _xORB , const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xParentContainer ,const TContentPtr& _pImpl , sal_Bool _bFormsContainer diff --git a/dbaccess/source/core/dataaccess/documentdefinition.cxx b/dbaccess/source/core/dataaccess/documentdefinition.cxx index ae467674257b..e64ac434d2d0 100644 --- a/dbaccess/source/core/dataaccess/documentdefinition.cxx +++ b/dbaccess/source/core/dataaccess/documentdefinition.cxx @@ -372,7 +372,7 @@ namespace dbaccess } ::rtl::OUString ODocumentDefinition::GetDocumentServiceFromMediaType( const Reference< XStorage >& _rxContainerStorage, - const ::rtl::OUString& _rEntityName, const ::comphelper::ComponentContext& _rContext, + const ::rtl::OUString& _rEntityName, const Reference< XComponentContext >& _rContext, Sequence< sal_Int8 >& _rClassId ) { return GetDocumentServiceFromMediaType( @@ -381,12 +381,12 @@ namespace dbaccess } ::rtl::OUString ODocumentDefinition::GetDocumentServiceFromMediaType( const ::rtl::OUString& _rMediaType, - const ::comphelper::ComponentContext& _rContext, Sequence< sal_Int8 >& _rClassId ) + const Reference< XComponentContext >& _rContext, Sequence< sal_Int8 >& _rClassId ) { ::rtl::OUString sResult; try { - ::comphelper::MimeConfigurationHelper aConfigHelper( _rContext.getUNOContext() ); + ::comphelper::MimeConfigurationHelper aConfigHelper( _rContext ); sResult = aConfigHelper.GetDocServiceNameFromMediaType( _rMediaType ); _rClassId = aConfigHelper.GetSequenceClassIDRepresentation(aConfigHelper.GetExplicitlyRegisteredObjClassID( _rMediaType )); if ( !_rClassId.getLength() && !sResult.isEmpty() ) @@ -432,7 +432,7 @@ namespace dbaccess //========================================================================== DBG_NAME(ODocumentDefinition) -ODocumentDefinition::ODocumentDefinition( const Reference< XInterface >& _rxContainer, const Reference< XMultiServiceFactory >& _xORB, +ODocumentDefinition::ODocumentDefinition( const Reference< XInterface >& _rxContainer, const Reference< XComponentContext >& _xORB, const TContentPtr& _pImpl, sal_Bool _bForm ) :OContentHelper(_xORB,_rxContainer,_pImpl) ,OPropertyStateContainer(OContentHelper::rBHelper) @@ -631,7 +631,7 @@ void ODocumentDefinition::impl_onActivateEmbeddedObject_nothrow( const bool i_bR xTopWindow->toFront(); // remove the frame from the desktop's frame collection because we need full control of it. - impl_removeFrameFromDesktop_throw( m_aContext.getUNOContext(), xFrame ); + impl_removeFrameFromDesktop_throw( m_aContext, xFrame ); // ensure that we ourself are kept alive as long as the embedded object's frame is // opened @@ -961,7 +961,7 @@ Any ODocumentDefinition::onCommandOpenSomething( const Any& _rOpenArgument, cons { // we are in ReadOnly mode // we would like to open the Writer or Calc with the report direct, without design it. - Reference< report::XReportEngine > xReportEngine( m_aContext.createComponent( "com.sun.star.comp.report.OReportEngineJFree" ), UNO_QUERY_THROW ); + Reference< report::XReportEngine > xReportEngine( m_aContext->getServiceManager()->createInstanceWithContext("com.sun.star.comp.report.OReportEngineJFree", m_aContext), UNO_QUERY_THROW ); xReportEngine->setReportDefinition(xReportDefinition); xReportEngine->setActiveConnection(m_xLastKnownConnection); @@ -1214,7 +1214,7 @@ void ODocumentDefinition::onCommandInsert( const ::rtl::OUString& _sURL, const R Reference< XStorage> xStorage = getContainerStorage(); if ( xStorage.is() ) { - Reference< XEmbeddedObjectCreator> xEmbedFactory = EmbeddedObjectCreator::create(m_aContext.getUNOContext()); + Reference< XEmbeddedObjectCreator> xEmbedFactory = EmbeddedObjectCreator::create(m_aContext); Sequence<PropertyValue> aEmpty,aMediaDesc(1); aMediaDesc[0].Name = PROPERTY_URL; aMediaDesc[0].Value <<= _sURL; @@ -1296,7 +1296,7 @@ sal_Bool ODocumentDefinition::save(sal_Bool _bApprove) pRequest->addContinuation(pAbort); // create the handler, let it handle the request - Reference< XInteractionHandler2 > xHandler( InteractionHandler::createWithParent(m_aContext.getUNOContext(), 0) ); + Reference< XInteractionHandler2 > xHandler( InteractionHandler::createWithParent(m_aContext, 0) ); xHandler->handle(xRequest); if ( pAbort->wasSelected() ) @@ -1370,7 +1370,7 @@ sal_Bool ODocumentDefinition::saveAs() pRequest->addContinuation(pAbort); // create the handler, let it handle the request - Reference< XInteractionHandler2 > xHandler( InteractionHandler::createWithParent(m_aContext.getUNOContext(), 0) ); + Reference< XInteractionHandler2 > xHandler( InteractionHandler::createWithParent(m_aContext, 0) ); xHandler->handle(xRequest); if ( pAbort->wasSelected() ) @@ -1557,7 +1557,7 @@ Sequence< PropertyValue > ODocumentDefinition::fillLoadArgs( const Reference< XC xParentFrame = lcl_getDatabaseDocumentFrame( *m_pImpl->m_pDataSource ); if ( !xParentFrame.is() ) { // i87957 we need a parent frame - Reference< XDesktop2 > xDesktop = Desktop::create( m_aContext.getUNOContext() ); + Reference< XDesktop2 > xDesktop = Desktop::create( m_aContext ); xParentFrame.set( xDesktop, UNO_QUERY_THROW ); Reference<util::XCloseable> xCloseable(m_pImpl->m_pDataSource->getModel_noCreate(),UNO_QUERY); if ( xCloseable.is() ) @@ -1613,7 +1613,7 @@ void ODocumentDefinition::loadEmbeddedObject( const Reference< XConnection >& i_ Reference< XStorage> xStorage = getContainerStorage(); if ( xStorage.is() ) { - Reference< XEmbeddedObjectCreator> xEmbedFactory = OOoEmbeddedObjectFactory::create(m_aContext.getUNOContext()); + Reference< XEmbeddedObjectCreator> xEmbedFactory = OOoEmbeddedObjectFactory::create(m_aContext); ::rtl::OUString sDocumentService; sal_Bool bSetSize = sal_False; sal_Int32 nEntryConnectionMode = EntryInitModes::DEFAULT_INIT; @@ -1631,8 +1631,8 @@ void ODocumentDefinition::loadEmbeddedObject( const Reference< XConnection >& i_ if ( !m_bForm && !(sDocumentService == "com.sun.star.text.TextDocument")) { // we seem to be a "new style" report, check if report extension is present. - Reference< XContentEnumerationAccess > xEnumAccess( m_aContext.getLegacyServiceFactory(), UNO_QUERY ); - const ::rtl::OUString sReportEngineServiceName = ::dbtools::getDefaultReportEngineServiceName(m_aContext.getUNOContext()); + Reference< XContentEnumerationAccess > xEnumAccess( m_aContext->getServiceManager(), UNO_QUERY ); + const ::rtl::OUString sReportEngineServiceName = ::dbtools::getDefaultReportEngineServiceName(m_aContext); Reference< XEnumeration > xEnumDrivers = xEnumAccess->createContentEnumeration(sReportEngineServiceName); if ( !xEnumDrivers.is() || !xEnumDrivers->hasMoreElements() ) { @@ -2077,7 +2077,7 @@ bool ODocumentDefinition::prepareClose() return true; } -void ODocumentDefinition::fillReportData( const ::comphelper::ComponentContext& _rContext, +void ODocumentDefinition::fillReportData( const Reference< XComponentContext >& _rContext, const Reference< util::XCloseable >& _rxComponent, const Reference< XConnection >& _rxActiveConnection ) { @@ -2086,14 +2086,14 @@ void ODocumentDefinition::fillReportData( const ::comphelper::ComponentContext& aValue.Name = "TextDocument"; aValue.Value <<= _rxComponent; aArgs[0] <<= aValue; - aValue.Name = "ActiveConnection"; - aValue.Value <<= _rxActiveConnection; - aArgs[1] <<= aValue; + aValue.Name = "ActiveConnection"; + aValue.Value <<= _rxActiveConnection; + aArgs[1] <<= aValue; try { Reference< XJobExecutor > xExecuteable( - _rContext.createComponentWithArguments( "com.sun.star.wizards.report.CallReportWizard", aArgs ), UNO_QUERY_THROW ); + _rContext->getServiceManager()->createInstanceWithArgumentsAndContext("com.sun.star.wizards.report.CallReportWizard", aArgs, _rContext), UNO_QUERY_THROW ); xExecuteable->trigger( "fill" ); } catch( const Exception& ) diff --git a/dbaccess/source/core/dataaccess/documentdefinition.hxx b/dbaccess/source/core/dataaccess/documentdefinition.hxx index 553a61f28cee..f9e6f71519eb 100644 --- a/dbaccess/source/core/dataaccess/documentdefinition.hxx +++ b/dbaccess/source/core/dataaccess/documentdefinition.hxx @@ -82,7 +82,7 @@ public: ODocumentDefinition( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxContainer, - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >&, + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >&, const TContentPtr& _pImpl, sal_Bool _bForm ); @@ -153,7 +153,7 @@ public: inline sal_Bool isNewReport() const { return !m_bForm && !m_pImpl->m_aProps.bAsTemplate; } static void fillReportData( - const ::comphelper::ComponentContext& _rContext, + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > & _rxContext, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloseable >& _rxComponent, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxActiveConnection ); @@ -175,13 +175,13 @@ public: static ::rtl::OUString GetDocumentServiceFromMediaType( const ::rtl::OUString& _rMediaType, - const ::comphelper::ComponentContext& _rContext, + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > & _rxContext, ::com::sun::star::uno::Sequence< sal_Int8 >& _rClassId ); static ::rtl::OUString GetDocumentServiceFromMediaType( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& _rxContainerStorage, const ::rtl::OUString& _rEntityName, - const ::comphelper::ComponentContext& _rContext, + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > & _rxContext, ::com::sun::star::uno::Sequence< sal_Int8 >& _rClassId ); diff --git a/dbaccess/source/core/dataaccess/documenteventexecutor.cxx b/dbaccess/source/core/dataaccess/documenteventexecutor.cxx index 0d835a0b206f..094006bf494e 100644 --- a/dbaccess/source/core/dataaccess/documenteventexecutor.cxx +++ b/dbaccess/source/core/dataaccess/documenteventexecutor.cxx @@ -26,7 +26,6 @@ #include <com/sun/star/frame/XModel.hpp> #include <com/sun/star/frame/XDispatchProvider.hpp> -#include <comphelper/componentcontext.hxx> #include <comphelper/namedvaluecollection.hxx> #include <cppuhelper/weakref.hxx> #include <tools/diagnose_ex.h> @@ -49,6 +48,7 @@ namespace dbaccess using ::com::sun::star::uno::Sequence; using ::com::sun::star::uno::Type; using ::com::sun::star::uno::WeakReference; + using ::com::sun::star::uno::XComponentContext; using ::com::sun::star::document::XDocumentEventBroadcaster; using ::com::sun::star::document::XEventsSupplier; using ::com::sun::star::container::XNameAccess; @@ -122,7 +122,7 @@ namespace dbaccess //==================================================================== //= DocumentEventExecutor //==================================================================== - DocumentEventExecutor::DocumentEventExecutor( const ::comphelper::ComponentContext& _rContext, + DocumentEventExecutor::DocumentEventExecutor( const Reference<XComponentContext> & _rContext, const Reference< XEventsSupplier >& _rxDocument ) :m_pData( new DocumentEventExecutor_Data( _rxDocument ) ) { @@ -136,7 +136,7 @@ namespace dbaccess try { - m_pData->xURLTransformer = URLTransformer::create(_rContext.getUNOContext()); + m_pData->xURLTransformer = URLTransformer::create(_rContext); } catch( const Exception& ) { diff --git a/dbaccess/source/core/dataaccess/documenteventexecutor.hxx b/dbaccess/source/core/dataaccess/documenteventexecutor.hxx index 3cc3b93a384d..48fbd3b2309a 100644 --- a/dbaccess/source/core/dataaccess/documenteventexecutor.hxx +++ b/dbaccess/source/core/dataaccess/documenteventexecutor.hxx @@ -27,11 +27,6 @@ #include <memory> -namespace comphelper -{ - class ComponentContext; -} - namespace dbaccess { @@ -45,7 +40,7 @@ namespace dbaccess { public: DocumentEventExecutor( - const ::comphelper::ComponentContext& _rContext, + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rContext, const ::com::sun::star::uno::Reference< ::com::sun::star::document::XEventsSupplier >& _rxDocument ); protected: diff --git a/dbaccess/source/core/inc/ContentHelper.hxx b/dbaccess/source/core/inc/ContentHelper.hxx index f35dc147add1..0c352f26ad3e 100644 --- a/dbaccess/source/core/inc/ContentHelper.hxx +++ b/dbaccess/source/core/inc/ContentHelper.hxx @@ -33,7 +33,6 @@ #include <com/sun/star/lang/XUnoTunnel.hpp> #include <cppuhelper/compbase9.hxx> #include <comphelper/broadcasthelper.hxx> -#include <comphelper/componentcontext.hxx> #include <comphelper/uno3.hxx> #include <comphelper/stl_types.hxx> #include <com/sun/star/beans/Property.hpp> @@ -111,7 +110,8 @@ namespace dbaccess PropertyChangeListenerContainer m_aPropertyChangeListeners; ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > m_xParentContainer; - const ::comphelper::ComponentContext m_aContext; + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > + m_aContext; const ::connectivity::SQLError m_aErrorHelper; TContentPtr m_pImpl; sal_uInt32 m_nCommandId; @@ -132,7 +132,7 @@ namespace dbaccess public: - OContentHelper( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _xORB + OContentHelper( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _xORB ,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xParentContainer ,const TContentPtr& _pImpl ); @@ -183,7 +183,7 @@ namespace dbaccess getPropertyValues( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& rProperties ); - const ::comphelper::ComponentContext& getContext() const { return m_aContext; } + const css::uno::Reference< css::uno::XComponentContext >& getContext() const { return m_aContext; } inline TContentPtr getImpl() const { return m_pImpl; } diff --git a/dbaccess/source/core/inc/SingleSelectQueryComposer.hxx b/dbaccess/source/core/inc/SingleSelectQueryComposer.hxx index 34166c26b6b4..b68cbc802854 100644 --- a/dbaccess/source/core/inc/SingleSelectQueryComposer.hxx +++ b/dbaccess/source/core/inc/SingleSelectQueryComposer.hxx @@ -33,7 +33,6 @@ #include <comphelper/uno3.hxx> #include <comphelper/proparrhlp.hxx> #include <comphelper/propertycontainer.hxx> -#include <comphelper/componentcontext.hxx> #include <memory> @@ -92,7 +91,7 @@ namespace dbaccess ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess> m_xConnectionQueries; ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier > m_xNumberFormatsSupplier; ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess> m_xColumns; - ::comphelper::ComponentContext m_aContext; + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext> m_aContext; ::com::sun::star::uno::Reference< ::com::sun::star::script::XTypeConverter > m_xTypeConverter; ::std::vector<OPrivateColumns*> m_aCurrentColumns; @@ -189,7 +188,7 @@ namespace dbaccess OSingleSelectQueryComposer( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess>& _xTableSupplier, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& _xConnection, - const ::comphelper::ComponentContext& _rContext); + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext>& _rContext); void SAL_CALL disposing(void); diff --git a/dbaccess/source/core/inc/definitioncontainer.hxx b/dbaccess/source/core/inc/definitioncontainer.hxx index e908a6fd3181..e1ab72f9d960 100644 --- a/dbaccess/source/core/inc/definitioncontainer.hxx +++ b/dbaccess/source/core/inc/definitioncontainer.hxx @@ -153,7 +153,7 @@ public: /** constructs the container. */ ODefinitionContainer( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _xORB + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _xORB , const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xParentContainer , const TContentPtr& _pImpl , bool _bCheckSlash = true diff --git a/dbaccess/source/core/inc/querycontainer.hxx b/dbaccess/source/core/inc/querycontainer.hxx index 5aa3567e4b1b..dbd1a735287a 100644 --- a/dbaccess/source/core/inc/querycontainer.hxx +++ b/dbaccess/source/core/inc/querycontainer.hxx @@ -112,7 +112,7 @@ namespace dbaccess OQueryContainer( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& _rxCommandDefinitions, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConn, - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB, + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxORB, ::dbtools::IWarningsContainer* _pWarnings ); diff --git a/dbaccess/source/core/inc/recovery/dbdocrecovery.hxx b/dbaccess/source/core/inc/recovery/dbdocrecovery.hxx index e0f70f575bd4..c57d309e6fb9 100644 --- a/dbaccess/source/core/inc/recovery/dbdocrecovery.hxx +++ b/dbaccess/source/core/inc/recovery/dbdocrecovery.hxx @@ -24,15 +24,11 @@ #include <com/sun/star/embed/XStorage.hpp> #include <com/sun/star/frame/XController.hpp> +#include <com/sun/star/uno/XComponentContext.hpp> #include <vector> #include <memory> -namespace comphelper -{ - class ComponentContext; -} - namespace dbaccess { @@ -44,7 +40,7 @@ namespace dbaccess { public: DatabaseDocumentRecovery( - const ::comphelper::ComponentContext& i_rContext + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& i_rContext ); ~DatabaseDocumentRecovery(); diff --git a/dbaccess/source/core/inc/sdbcoretools.hxx b/dbaccess/source/core/inc/sdbcoretools.hxx index cd8a9a93ebc4..94b258976a78 100644 --- a/dbaccess/source/core/inc/sdbcoretools.hxx +++ b/dbaccess/source/core/inc/sdbcoretools.hxx @@ -26,11 +26,7 @@ #include <com/sun/star/io/IOException.hpp> #include <com/sun/star/lang/WrappedTargetException.hpp> #include <com/sun/star/uno/RuntimeException.hpp> - -namespace comphelper -{ - class ComponentContext; -} +#include <com/sun/star/uno/XComponentContext.hpp> namespace dbaccess { @@ -42,7 +38,7 @@ namespace dbaccess /** retrieves a to-be-displayed string for a given caught exception; */ - ::rtl::OUString extractExceptionMessage( const ::comphelper::ComponentContext& _rContext, const ::com::sun::star::uno::Any& _rError ); + ::rtl::OUString extractExceptionMessage( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rContext, const ::com::sun::star::uno::Any& _rError ); namespace tools { diff --git a/dbaccess/source/core/misc/sdbcoretools.cxx b/dbaccess/source/core/misc/sdbcoretools.cxx index 6fd8507b3b46..edee7a59faa3 100644 --- a/dbaccess/source/core/misc/sdbcoretools.cxx +++ b/dbaccess/source/core/misc/sdbcoretools.cxx @@ -32,7 +32,6 @@ #include <tools/diagnose_ex.h> #include <tools/debug.hxx> -#include <comphelper/componentcontext.hxx> #include <comphelper/interaction.hxx> #include <rtl/ref.hxx> #include <rtl/ustrbuf.hxx> @@ -81,14 +80,16 @@ namespace dbaccess } // ----------------------------------------------------------------------------- - ::rtl::OUString extractExceptionMessage( const ::comphelper::ComponentContext& _rContext, const Any& _rError ) + ::rtl::OUString extractExceptionMessage( const Reference<XComponentContext> & _rContext, const Any& _rError ) { ::rtl::OUString sDisplayMessage; try { - Reference< XInteractionRequestStringResolver > xStringResolver; - if ( _rContext.createComponent( "com.sun.star.task.InteractionRequestStringResolver", xStringResolver ) ) + Reference< XInteractionRequestStringResolver > xStringResolver( + _rContext->getServiceManager()->createInstanceWithContext("com.sun.star.task.InteractionRequestStringResolver", _rContext), + UNO_QUERY ); + if ( xStringResolver.is() ) { ::rtl::Reference< ::comphelper::OInteractionRequest > pRequest( new ::comphelper::OInteractionRequest( _rError ) ); ::rtl::Reference< ::comphelper::OInteractionApprove > pApprove( new ::comphelper::OInteractionApprove ); diff --git a/dbaccess/source/core/recovery/dbdocrecovery.cxx b/dbaccess/source/core/recovery/dbdocrecovery.cxx index e10dc3688af5..67988f86f88c 100644 --- a/dbaccess/source/core/recovery/dbdocrecovery.cxx +++ b/dbaccess/source/core/recovery/dbdocrecovery.cxx @@ -35,7 +35,6 @@ #include <com/sun/star/util/XModifiable.hpp> #include <com/sun/star/beans/XPropertySet.hpp> -#include <comphelper/componentcontext.hxx> #include <comphelper/namedvaluecollection.hxx> #include <rtl/ustrbuf.hxx> #include <tools/diagnose_ex.h> @@ -75,7 +74,6 @@ namespace dbaccess using ::com::sun::star::frame::XModel; using ::com::sun::star::util::XModifiable; using ::com::sun::star::beans::XPropertySet; - using ::com::sun::star::lang::XMultiServiceFactory; /** === end UNO using === **/ namespace ElementModes = ::com::sun::star::embed::ElementModes; @@ -135,7 +133,7 @@ namespace dbaccess return s_sMapStreamEncodingName; } - static void lcl_writeObjectMap_throw( const ::comphelper::ComponentContext& i_rContext, const Reference< XStorage >& i_rStorage, + static void lcl_writeObjectMap_throw( const Reference<XComponentContext> & i_rContext, const Reference< XStorage >& i_rStorage, const MapStringToCompDesc& i_mapStorageToCompDesc ) { if ( i_mapStorageToCompDesc.empty() ) @@ -251,9 +249,9 @@ namespace dbaccess //==================================================================== struct DBACCESS_DLLPRIVATE DatabaseDocumentRecovery_Data { - const ::comphelper::ComponentContext aContext; + const Reference<XComponentContext> aContext; - DatabaseDocumentRecovery_Data( const ::comphelper::ComponentContext& i_rContext ) + DatabaseDocumentRecovery_Data( const Reference<XComponentContext> & i_rContext ) :aContext( i_rContext ) { } @@ -263,7 +261,7 @@ namespace dbaccess //= DatabaseDocumentRecovery //==================================================================== //-------------------------------------------------------------------- - DatabaseDocumentRecovery::DatabaseDocumentRecovery( const ::comphelper::ComponentContext& i_rContext ) + DatabaseDocumentRecovery::DatabaseDocumentRecovery( const Reference<XComponentContext> & i_rContext ) :m_pData( new DatabaseDocumentRecovery_Data( i_rContext ) ) { } @@ -352,7 +350,7 @@ namespace dbaccess Reference< XStorage > xComponentsStor( xRecoveryStorage->openStorageElement( SubComponentRecovery::getComponentsStorageName( aKnownTypes[i] ), ElementModes::READ ) ); - lcl_readObjectMap_throw( m_pData->aContext.getUNOContext(), xComponentsStor, aMapCompDescs[ aKnownTypes[i] ] ); + lcl_readObjectMap_throw( m_pData->aContext, xComponentsStor, aMapCompDescs[ aKnownTypes[i] ] ); xComponentsStor->dispose(); } diff --git a/dbaccess/source/core/recovery/storagestream.cxx b/dbaccess/source/core/recovery/storagestream.cxx index 0c4d1165d1fb..900fc39e3f4d 100644 --- a/dbaccess/source/core/recovery/storagestream.cxx +++ b/dbaccess/source/core/recovery/storagestream.cxx @@ -41,6 +41,7 @@ namespace dbaccess using ::com::sun::star::uno::makeAny; using ::com::sun::star::uno::Sequence; using ::com::sun::star::uno::Type; + using ::com::sun::star::uno::XComponentContext; using ::com::sun::star::embed::XStorage; using ::com::sun::star::io::XStream; /** === end UNO using === **/ @@ -50,7 +51,7 @@ namespace dbaccess //= StorageOutputStream //==================================================================== //-------------------------------------------------------------------- - StorageOutputStream::StorageOutputStream( const ::comphelper::ComponentContext& i_rContext, + StorageOutputStream::StorageOutputStream( const Reference<XComponentContext>& i_rContext, const Reference< XStorage >& i_rParentStorage, const ::rtl::OUString& i_rStreamName ) @@ -83,7 +84,7 @@ namespace dbaccess //= StorageInputStream //==================================================================== //-------------------------------------------------------------------- - StorageInputStream::StorageInputStream( const ::comphelper::ComponentContext& i_rContext, + StorageInputStream::StorageInputStream( const Reference<XComponentContext>& i_rContext, const Reference< XStorage >& i_rParentStorage, const ::rtl::OUString& i_rStreamName ) diff --git a/dbaccess/source/core/recovery/storagestream.hxx b/dbaccess/source/core/recovery/storagestream.hxx index c4a4849aef0f..9f9fb0f013b1 100644 --- a/dbaccess/source/core/recovery/storagestream.hxx +++ b/dbaccess/source/core/recovery/storagestream.hxx @@ -23,11 +23,7 @@ #include "dbaccessdllapi.h" #include <com/sun/star/embed/XStorage.hpp> - -namespace comphelper -{ - class ComponentContext; -} +#include <com/sun/star/uno/XComponentContext.hpp> //........................................................................ namespace dbaccess @@ -43,7 +39,7 @@ namespace dbaccess { public: StorageOutputStream( - const ::comphelper::ComponentContext& i_rContext, + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& i_rContext, const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& i_rParentStorage, const ::rtl::OUString& i_rStreamName ); @@ -54,12 +50,14 @@ namespace dbaccess virtual void close(); protected: - const ::comphelper::ComponentContext& getContext() const { return m_rContext; } + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& + getContext() const { return m_rContext; } const ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >& getOutputStream() const { return m_xOutputStream; } private: - const ::comphelper::ComponentContext& m_rContext; + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& + m_rContext; ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream > m_xOutputStream; }; @@ -73,7 +71,7 @@ namespace dbaccess { public: StorageInputStream( - const ::comphelper::ComponentContext& i_rContext, + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& i_rContext, const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& i_rParentStorage, const ::rtl::OUString& i_rStreamName ); @@ -84,12 +82,14 @@ namespace dbaccess virtual void close(); protected: - const ::comphelper::ComponentContext& getContext() const { return m_rContext; } + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& + getContext() const { return m_rContext; } const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& getInputStream() const { return m_xInputStream; } private: - const ::comphelper::ComponentContext& m_rContext; + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& + m_rContext; ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > m_xInputStream; }; diff --git a/dbaccess/source/core/recovery/storagetextstream.cxx b/dbaccess/source/core/recovery/storagetextstream.cxx index 7251ddb54f72..8c8cbb37b410 100644 --- a/dbaccess/source/core/recovery/storagetextstream.cxx +++ b/dbaccess/source/core/recovery/storagetextstream.cxx @@ -22,7 +22,6 @@ #include <com/sun/star/io/TextOutputStream.hpp> -#include <comphelper/componentcontext.hxx> #include <tools/diagnose_ex.h> //...................................................................................................................... @@ -42,6 +41,7 @@ namespace dbaccess using ::com::sun::star::uno::makeAny; using ::com::sun::star::uno::Sequence; using ::com::sun::star::uno::Type; + using ::com::sun::star::uno::XComponentContext; using ::com::sun::star::embed::XStorage; using ::com::sun::star::io::TextOutputStream; using ::com::sun::star::io::XTextOutputStream2; @@ -80,14 +80,14 @@ namespace dbaccess //= StorageTextOutputStream //================================================================================================================== //------------------------------------------------------------------------------------------------------------------ - StorageTextOutputStream::StorageTextOutputStream( const ::comphelper::ComponentContext& i_rContext, + StorageTextOutputStream::StorageTextOutputStream( const Reference<XComponentContext>& i_rContext, const Reference< XStorage >& i_rParentStorage, const ::rtl::OUString& i_rStreamName ) :StorageOutputStream( i_rContext, i_rParentStorage, i_rStreamName ) ,m_pData( new StorageTextOutputStream_Data ) { - m_pData->xTextOutput = TextOutputStream::create( i_rContext.getUNOContext() ); + m_pData->xTextOutput = TextOutputStream::create( i_rContext ); m_pData->xTextOutput->setEncoding( lcl_getTextStreamEncodingName() ); m_pData->xTextOutput->setOutputStream( getOutputStream() ); } diff --git a/dbaccess/source/core/recovery/storagetextstream.hxx b/dbaccess/source/core/recovery/storagetextstream.hxx index 46924f36fd46..37119d264afa 100644 --- a/dbaccess/source/core/recovery/storagetextstream.hxx +++ b/dbaccess/source/core/recovery/storagetextstream.hxx @@ -37,7 +37,7 @@ namespace dbaccess { public: StorageTextOutputStream( - const ::comphelper::ComponentContext& i_rContext, + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& i_rContext, const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& i_rParentStorage, const ::rtl::OUString& i_rStreamName ); diff --git a/dbaccess/source/core/recovery/storagexmlstream.cxx b/dbaccess/source/core/recovery/storagexmlstream.cxx index 28f3a17ff1b5..e2f17222895e 100644 --- a/dbaccess/source/core/recovery/storagexmlstream.cxx +++ b/dbaccess/source/core/recovery/storagexmlstream.cxx @@ -25,7 +25,6 @@ #include <com/sun/star/xml/sax/Parser.hpp> #include <com/sun/star/xml/sax/Writer.hpp> -#include <comphelper/componentcontext.hxx> #include <cppuhelper/implbase1.hxx> #include <rtl/ref.hxx> #include <tools/diagnose_ex.h> @@ -50,6 +49,7 @@ namespace dbaccess using ::com::sun::star::uno::makeAny; using ::com::sun::star::uno::Sequence; using ::com::sun::star::uno::Type; + using ::com::sun::star::uno::XComponentContext; using ::com::sun::star::embed::XStorage; using ::com::sun::star::xml::sax::XDocumentHandler; using ::com::sun::star::xml::sax::XAttributeList; @@ -77,13 +77,13 @@ namespace dbaccess //= StorageXMLOutputStream //================================================================================================================== //------------------------------------------------------------------------------------------------------------------ - StorageXMLOutputStream::StorageXMLOutputStream( const ::comphelper::ComponentContext& i_rContext, + StorageXMLOutputStream::StorageXMLOutputStream( const Reference<XComponentContext>& i_rContext, const Reference< XStorage >& i_rParentStorage, const ::rtl::OUString& i_rStreamName ) :StorageOutputStream( i_rContext, i_rParentStorage, i_rStreamName ) ,m_pData( new StorageXMLOutputStream_Data ) { - const Reference< XWriter > xSaxWriter = Writer::create( i_rContext.getUNOContext() ); + const Reference< XWriter > xSaxWriter = Writer::create( i_rContext ); xSaxWriter->setOutputStream( getOutputStream() ); m_pData->xHandler.set( xSaxWriter, UNO_QUERY_THROW ); @@ -161,13 +161,13 @@ namespace dbaccess //= StorageXMLInputStream //================================================================================================================== //------------------------------------------------------------------------------------------------------------------ - StorageXMLInputStream::StorageXMLInputStream( const ::comphelper::ComponentContext& i_rContext, + StorageXMLInputStream::StorageXMLInputStream( const Reference<XComponentContext>& i_rContext, const Reference< XStorage >& i_rParentStorage, const ::rtl::OUString& i_rStreamName ) :StorageInputStream( i_rContext, i_rParentStorage, i_rStreamName ) ,m_pData( new StorageXMLInputStream_Data ) { - m_pData->xParser.set( Parser::create(i_rContext.getUNOContext()) ); + m_pData->xParser.set( Parser::create(i_rContext) ); } //------------------------------------------------------------------------------------------------------------------ diff --git a/dbaccess/source/core/recovery/storagexmlstream.hxx b/dbaccess/source/core/recovery/storagexmlstream.hxx index 5f4faf5a76f9..a850b225b4fd 100644 --- a/dbaccess/source/core/recovery/storagexmlstream.hxx +++ b/dbaccess/source/core/recovery/storagexmlstream.hxx @@ -27,11 +27,6 @@ #include <memory> -namespace comphelper -{ - class ComponentContext; -} - //........................................................................ namespace dbaccess { @@ -45,7 +40,7 @@ namespace dbaccess { public: StorageXMLOutputStream( - const ::comphelper::ComponentContext& i_rContext, + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& i_rContext, const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& i_rParentStorage, const ::rtl::OUString& i_rStreamName ); @@ -79,7 +74,7 @@ namespace dbaccess { public: StorageXMLInputStream( - const ::comphelper::ComponentContext& i_rContext, + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& i_rContext, const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& i_rParentStorage, const ::rtl::OUString& i_rStreamName ); diff --git a/dbaccess/source/core/recovery/subcomponentrecovery.cxx b/dbaccess/source/core/recovery/subcomponentrecovery.cxx index 951f47604145..58942d810c9b 100644 --- a/dbaccess/source/core/recovery/subcomponentrecovery.cxx +++ b/dbaccess/source/core/recovery/subcomponentrecovery.cxx @@ -57,6 +57,7 @@ namespace dbaccess using ::com::sun::star::uno::makeAny; using ::com::sun::star::uno::Sequence; using ::com::sun::star::uno::Type; + using ::com::sun::star::uno::XComponentContext; using ::com::sun::star::lang::XMultiServiceFactory; using ::com::sun::star::embed::XStorage; using ::com::sun::star::sdb::application::XDatabaseDocumentUI; @@ -195,7 +196,7 @@ namespace dbaccess class DBACCESS_DLLPRIVATE SettingsExportContext : public ::xmloff::XMLSettingsExportContext { public: - SettingsExportContext( const ::comphelper::ComponentContext& i_rContext, const StorageXMLOutputStream& i_rDelegator ) + SettingsExportContext( const Reference<XComponentContext>& i_rContext, const StorageXMLOutputStream& i_rDelegator ) :m_rContext( i_rContext ) ,m_rDelegator( i_rDelegator ) ,m_aNamespace( ::xmloff::token::GetXMLToken( ::xmloff::token::XML_NP_CONFIG ) ) @@ -226,7 +227,7 @@ namespace dbaccess } private: - const ::comphelper::ComponentContext& m_rContext; + const Reference<XComponentContext>& m_rContext; const StorageXMLOutputStream& m_rDelegator; const ::rtl::OUStringBuffer m_aNamespace; }; @@ -269,7 +270,7 @@ namespace dbaccess //-------------------------------------------------------------------- Reference< com::sun::star::uno::XComponentContext > SettingsExportContext::GetComponentContext() const { - return m_rContext.getUNOContext(); + return m_rContext; } //================================================================================================================== @@ -479,7 +480,7 @@ namespace dbaccess m_aCompDesc.sName = aComponentIdentity.Second; // what the controller didn't give us is the information whether this is in edit mode or not ... - Reference< XModuleManager2 > xModuleManager( ModuleManager::create(m_rContext.getUNOContext()) ); + Reference< XModuleManager2 > xModuleManager( ModuleManager::create(m_rContext) ); const ::rtl::OUString sModuleIdentifier = xModuleManager->identify( m_xComponent ); switch ( m_eType ) diff --git a/dbaccess/source/core/recovery/subcomponentrecovery.hxx b/dbaccess/source/core/recovery/subcomponentrecovery.hxx index 68f75eb1fa43..8e70be04efca 100644 --- a/dbaccess/source/core/recovery/subcomponentrecovery.hxx +++ b/dbaccess/source/core/recovery/subcomponentrecovery.hxx @@ -24,8 +24,7 @@ #include <com/sun/star/sdb/application/XDatabaseDocumentUI.hpp> #include <com/sun/star/embed/XStorage.hpp> - -#include <comphelper/componentcontext.hxx> +#include <com/sun/star/uno/XComponentContext.hpp> //........................................................................ namespace dbaccess @@ -38,7 +37,9 @@ namespace dbaccess class DBACCESS_DLLPRIVATE SubComponentRecovery { public: - SubComponentRecovery( const ::comphelper::ComponentContext& i_rContext, const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::application::XDatabaseDocumentUI >& i_rController, + SubComponentRecovery( + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& i_rContext, + const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::application::XDatabaseDocumentUI >& i_rController, const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& i_rComponent ) :m_rContext( i_rContext ) ,m_xDocumentUI( i_rController, ::com::sun::star::uno::UNO_SET_THROW ) @@ -49,7 +50,9 @@ namespace dbaccess impl_identifyComponent_throw(); } - SubComponentRecovery( const ::comphelper::ComponentContext& i_rContext, const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::application::XDatabaseDocumentUI >& i_rController, + SubComponentRecovery( + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& i_rContext, + const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::application::XDatabaseDocumentUI >& i_rController, const SubComponentType i_eType ) :m_rContext( i_rContext ) ,m_xDocumentUI( i_rController, ::com::sun::star::uno::UNO_SET_THROW ) @@ -101,7 +104,8 @@ namespace dbaccess void impl_identifyComponent_throw(); private: - const ::comphelper::ComponentContext& m_rContext; + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& + m_rContext; ::com::sun::star::uno::Reference< ::com::sun::star::sdb::application::XDatabaseDocumentUI > m_xDocumentUI; const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > diff --git a/dbaccess/source/ext/macromigration/docinteraction.cxx b/dbaccess/source/ext/macromigration/docinteraction.cxx index a83deb852006..9468a9c4453e 100644 --- a/dbaccess/source/ext/macromigration/docinteraction.cxx +++ b/dbaccess/source/ext/macromigration/docinteraction.cxx @@ -24,7 +24,6 @@ #include <com/sun/star/task/InteractionHandler.hpp> #include <com/sun/star/task/DocumentPasswordRequest.hpp> -#include <comphelper/componentcontext.hxx> #include <comphelper/namedvaluecollection.hxx> #include <comphelper/interaction.hxx> #include <rtl/ref.hxx> @@ -45,6 +44,7 @@ namespace dbmm using ::com::sun::star::uno::RuntimeException; using ::com::sun::star::uno::Any; using ::com::sun::star::uno::makeAny; + using ::com::sun::star::uno::XComponentContext; using ::com::sun::star::task::XInteractionHandler; using ::com::sun::star::frame::XModel; using ::com::sun::star::task::DocumentPasswordRequest; @@ -65,8 +65,8 @@ namespace dbmm { } - InteractionHandler_Data( const ::comphelper::ComponentContext& _rContext ) - :xHandler( ::com::sun::star::task::InteractionHandler::createWithParent(_rContext.getUNOContext(), 0), UNO_QUERY ) + InteractionHandler_Data( const Reference<XComponentContext>& _rContext ) + :xHandler( ::com::sun::star::task::InteractionHandler::createWithParent(_rContext, 0), UNO_QUERY ) { } }; @@ -75,7 +75,7 @@ namespace dbmm //= InteractionHandler //==================================================================== //-------------------------------------------------------------------- - InteractionHandler::InteractionHandler( const ::comphelper::ComponentContext& _rContext, const Reference< XModel >& _rxDocument ) + InteractionHandler::InteractionHandler( const Reference<XComponentContext>& _rContext, const Reference< XModel >& _rxDocument ) :m_pData( new InteractionHandler_Data( _rContext ) ) { // check whether the doumentc has an own interaction handler set diff --git a/dbaccess/source/ext/macromigration/docinteraction.hxx b/dbaccess/source/ext/macromigration/docinteraction.hxx index 3291bcaeda2d..895bf0e785de 100644 --- a/dbaccess/source/ext/macromigration/docinteraction.hxx +++ b/dbaccess/source/ext/macromigration/docinteraction.hxx @@ -22,10 +22,7 @@ #include <com/sun/star/frame/XModel.hpp> #include <com/sun/star/task/XInteractionHandler.hpp> - -namespace comphelper { - class ComponentContext; -} +#include <com/sun/star/uno/XComponentContext.hpp> #include <memory> @@ -47,7 +44,9 @@ namespace dbmm component at the given component context, or using the given document's interaction handler, if one is specified in the document's media descriptor. */ - InteractionHandler( const ::comphelper::ComponentContext& _rContext, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& _rxDocument ); + InteractionHandler( + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rContext, + const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& _rxDocument ); /** destructor */ diff --git a/dbaccess/source/ext/macromigration/macromigrationdialog.cxx b/dbaccess/source/ext/macromigration/macromigrationdialog.cxx index 0eb2da076992..01c1dd2ff542 100644 --- a/dbaccess/source/ext/macromigration/macromigrationdialog.cxx +++ b/dbaccess/source/ext/macromigration/macromigrationdialog.cxx @@ -112,7 +112,7 @@ namespace dbmm //==================================================================== struct MacroMigrationDialog_Data { - ::comphelper::ComponentContext aContext; + Reference<XComponentContext> aContext; MigrationLog aLogger; Reference< XOfficeDatabaseDocument > xDocument; Reference< XModel2 > xDocumentModel; @@ -122,7 +122,7 @@ namespace dbmm bool bMigrationSuccess; MacroMigrationDialog_Data( - const ::comphelper::ComponentContext& _rContext, + const Reference<XComponentContext>& _rContext, const Reference< XOfficeDatabaseDocument >& _rxDocument ) :aContext( _rContext ) ,aLogger() @@ -139,7 +139,7 @@ namespace dbmm //= MacroMigrationDialog //==================================================================== //-------------------------------------------------------------------- - MacroMigrationDialog::MacroMigrationDialog( Window* _pParent, const ::comphelper::ComponentContext& _rContext, + MacroMigrationDialog::MacroMigrationDialog( Window* _pParent, const Reference<XComponentContext>& _rContext, const Reference< XOfficeDatabaseDocument >& _rxDocument ) :MacroMigrationDialog_Base( _pParent, MacroMigrationResId( DLG_MACRO_MIGRATION ) ) ,m_pData( new MacroMigrationDialog_Data( _rContext, _rxDocument ) ) @@ -174,7 +174,7 @@ namespace dbmm } //-------------------------------------------------------------------- - const ::comphelper::ComponentContext& MacroMigrationDialog::getComponentContext() const + const Reference<XComponentContext>& MacroMigrationDialog::getComponentContext() const { return m_pData->aContext; } @@ -438,7 +438,7 @@ namespace dbmm try { // check that the backup location isn't the same as the document itself - if ( lcl_equalURLs_nothrow( m_pData->aContext.getUNOContext(), sBackupLocation, m_pData->xDocumentModel->getURL() ) ) + if ( lcl_equalURLs_nothrow( m_pData->aContext, sBackupLocation, m_pData->xDocumentModel->getURL() ) ) { ErrorBox aErrorBox( const_cast< MacroMigrationDialog* >( this ), MacroMigrationResId( ERR_INVALID_BACKUP_LOCATION ) ); aErrorBox.Execute(); diff --git a/dbaccess/source/ext/macromigration/macromigrationdialog.hxx b/dbaccess/source/ext/macromigration/macromigrationdialog.hxx index 72cdc57532f9..51e04e4204c2 100644 --- a/dbaccess/source/ext/macromigration/macromigrationdialog.hxx +++ b/dbaccess/source/ext/macromigration/macromigrationdialog.hxx @@ -22,7 +22,6 @@ #include <com/sun/star/sdb/XOfficeDatabaseDocument.hpp> -#include <comphelper/componentcontext.hxx> #include <svtools/roadmapwizard.hxx> #include <memory> @@ -42,12 +41,12 @@ namespace dbmm public: MacroMigrationDialog( Window* _pParent, - const ::comphelper::ComponentContext& _rContext, + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rContext, const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XOfficeDatabaseDocument >& _rxDocument ); virtual ~MacroMigrationDialog(); - const ::comphelper::ComponentContext& + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& getComponentContext() const; const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XOfficeDatabaseDocument >& getDocument() const; diff --git a/dbaccess/source/ext/macromigration/macromigrationpages.cxx b/dbaccess/source/ext/macromigration/macromigrationpages.cxx index ebf8936584c5..0e824f3cc216 100644 --- a/dbaccess/source/ext/macromigration/macromigrationpages.cxx +++ b/dbaccess/source/ext/macromigration/macromigrationpages.cxx @@ -27,6 +27,7 @@ #include <com/sun/star/frame/XModel.hpp> +#include <comphelper/componentcontext.hxx> #include <tools/urlobj.hxx> #include <tools/diagnose_ex.h> #include <vcl/metric.hxx> diff --git a/dbaccess/source/ext/macromigration/macromigrationwizard.cxx b/dbaccess/source/ext/macromigration/macromigrationwizard.cxx index 5c95ec717b61..7b0f64747b0e 100644 --- a/dbaccess/source/ext/macromigration/macromigrationwizard.cxx +++ b/dbaccess/source/ext/macromigration/macromigrationwizard.cxx @@ -26,7 +26,6 @@ #include <com/sun/star/sdb/XOfficeDatabaseDocument.hpp> #include <com/sun/star/frame/XStorable.hpp> -#include <comphelper/componentcontext.hxx> #include <svtools/genericunodialog.hxx> //........................................................................ @@ -99,7 +98,7 @@ namespace dbmm virtual void destroyDialog(); private: - ::comphelper::ComponentContext m_aContext; + Reference<XComponentContext> m_aContext; Reference< XOfficeDatabaseDocument > m_xDocument; }; diff --git a/dbaccess/source/ext/macromigration/migrationengine.cxx b/dbaccess/source/ext/macromigration/migrationengine.cxx index d4e84d61db31..705c47189857 100644 --- a/dbaccess/source/ext/macromigration/migrationengine.cxx +++ b/dbaccess/source/ext/macromigration/migrationengine.cxx @@ -90,6 +90,7 @@ namespace dbmm using ::com::sun::star::uno::RuntimeException; using ::com::sun::star::uno::Any; using ::com::sun::star::uno::makeAny; + using ::com::sun::star::uno::XComponentContext; using ::com::sun::star::sdb::XOfficeDatabaseDocument; using ::com::sun::star::sdb::XFormDocumentsSupplier; using ::com::sun::star::sdb::XReportDocumentsSupplier; @@ -857,7 +858,7 @@ namespace dbmm { public: MigrationEngine_Impl( - const ::comphelper::ComponentContext& _rContext, + const Reference<XComponentContext>& _rContext, const Reference< XOfficeDatabaseDocument >& _rxDocument, IMigrationProgress& _rProgress, MigrationLog& _rLogger @@ -869,7 +870,7 @@ namespace dbmm bool migrateAll(); private: - ::comphelper::ComponentContext m_aContext; + Reference<XComponentContext> m_aContext; const Reference< XOfficeDatabaseDocument > m_xDocument; const Reference< XModel > m_xDocumentModel; IMigrationProgress& m_rProgress; @@ -983,7 +984,7 @@ namespace dbmm //= MigrationEngine_Impl - implementation //==================================================================== //-------------------------------------------------------------------- - MigrationEngine_Impl::MigrationEngine_Impl( const ::comphelper::ComponentContext& _rContext, + MigrationEngine_Impl::MigrationEngine_Impl( const Reference<XComponentContext>& _rContext, const Reference< XOfficeDatabaseDocument >& _rxDocument, IMigrationProgress& _rProgress, MigrationLog& _rLogger ) :m_aContext( _rContext ) ,m_xDocument( _rxDocument ) @@ -1497,12 +1498,12 @@ namespace dbmm if ( _eScriptType == eBasic ) { xTargetLibraries.set( DocumentScriptLibraryContainer::create( - m_aContext.getUNOContext(), xStorageDoc ), UNO_QUERY_THROW ); + m_aContext, xStorageDoc ), UNO_QUERY_THROW ); } else { xTargetLibraries.set( DocumentDialogLibraryContainer::create( - m_aContext.getUNOContext(), xStorageDoc ), UNO_QUERY_THROW ); + m_aContext, xStorageDoc ), UNO_QUERY_THROW ); } // copy all libs to the target, with potentially renaming them @@ -1637,7 +1638,7 @@ namespace dbmm } // analyze the script URI - Reference< XUriReferenceFactory > xUriRefFac = UriReferenceFactory::create( m_aContext.getUNOContext() ); + Reference< XUriReferenceFactory > xUriRefFac = UriReferenceFactory::create( m_aContext ); Reference< XVndSunStarScriptUrlReference > xUri( xUriRefFac->parse( _inout_rScriptCode ), UNO_QUERY_THROW ); OUString sScriptLanguage = xUri->getParameter( OUString( "language" ) ); @@ -1821,8 +1822,8 @@ namespace dbmm Reference< XInputStreamProvider > xISP( _inout_rDialogLibraryElement, UNO_QUERY_THROW ); Reference< XInputStream > xInput( xISP->createInputStream(), UNO_QUERY_THROW ); - Reference< XNameContainer > xDialogModel( m_aContext.createComponent( "com.sun.star.awt.UnoControlDialogModel" ), UNO_QUERY_THROW ); - ::xmlscript::importDialogModel( xInput, xDialogModel, m_aContext.getUNOContext(), m_xDocumentModel ); + Reference< XNameContainer > xDialogModel( m_aContext->getServiceManager()->createInstanceWithContext("com.sun.star.awt.UnoControlDialogModel", m_aContext), UNO_QUERY_THROW ); + ::xmlscript::importDialogModel( xInput, xDialogModel, m_aContext, m_xDocumentModel ); // adjust the events of the dialog impl_adjustDialogElementEvents_throw( xDialogModel ); @@ -1837,7 +1838,7 @@ namespace dbmm } // export dialog model - xISP = ::xmlscript::exportDialogModel( xDialogModel, m_aContext.getUNOContext(), m_xDocumentModel ); + xISP = ::xmlscript::exportDialogModel( xDialogModel, m_aContext, m_xDocumentModel ); _inout_rDialogLibraryElement <<= xISP; } catch( const Exception& ) @@ -1944,7 +1945,7 @@ namespace dbmm //= MigrationEngine //==================================================================== //-------------------------------------------------------------------- - MigrationEngine::MigrationEngine( const ::comphelper::ComponentContext& _rContext, + MigrationEngine::MigrationEngine( const Reference<XComponentContext>& _rContext, const Reference< XOfficeDatabaseDocument >& _rxDocument, IMigrationProgress& _rProgress, MigrationLog& _rLogger ) :m_pImpl( new MigrationEngine_Impl( _rContext, _rxDocument, _rProgress, _rLogger ) ) diff --git a/dbaccess/source/ext/macromigration/migrationengine.hxx b/dbaccess/source/ext/macromigration/migrationengine.hxx index 262a1fca1ffc..01f1116b699a 100644 --- a/dbaccess/source/ext/macromigration/migrationengine.hxx +++ b/dbaccess/source/ext/macromigration/migrationengine.hxx @@ -22,14 +22,8 @@ #include <com/sun/star/sdb/XOfficeDatabaseDocument.hpp> -#include <comphelper/componentcontext.hxx> - #include <memory> -namespace comphelper { - class ComponentContext; -} - //........................................................................ namespace dbmm { @@ -53,7 +47,7 @@ namespace dbmm passed herein as reference, must live as long as the engine instance lives. */ MigrationEngine( - const ::comphelper::ComponentContext& _rContext, + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rContext, const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XOfficeDatabaseDocument >& _rxDocument, IMigrationProgress& _rProgress, MigrationLog& _rLogger diff --git a/dbaccess/source/filter/xml/dbloader2.cxx b/dbaccess/source/filter/xml/dbloader2.cxx index bca2b1a919de..dde2f9a63fb4 100644 --- a/dbaccess/source/filter/xml/dbloader2.cxx +++ b/dbaccess/source/filter/xml/dbloader2.cxx @@ -52,7 +52,6 @@ #include <com/sun/star/sdb/application/NamedDatabaseObject.hpp> #include <com/sun/star/frame/XLoadable.hpp> -#include <comphelper/componentcontext.hxx> #include <comphelper/documentconstants.hxx> #include <comphelper/namedvaluecollection.hxx> #include <comphelper/processfactory.hxx> @@ -96,10 +95,10 @@ namespace dbaxml class DBTypeDetection : public ::cppu::WeakImplHelper2< XExtendedFilterDetection, XServiceInfo> { - ::comphelper::ComponentContext m_aContext; + const Reference< XComponentContext > m_aContext; public: - DBTypeDetection(const Reference< XMultiServiceFactory >&); + DBTypeDetection(const Reference< XComponentContext >&); // XServiceInfo OUString SAL_CALL getImplementationName() throw( ); @@ -118,8 +117,8 @@ public: virtual OUString SAL_CALL detect( ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& Descriptor ) throw (::com::sun::star::uno::RuntimeException); }; // ------------------------------------------------------------------------- -DBTypeDetection::DBTypeDetection(const Reference< XMultiServiceFactory >& _rxFactory) - :m_aContext( _rxFactory ) +DBTypeDetection::DBTypeDetection(const Reference< XComponentContext >& _rxContext) + :m_aContext( _rxContext ) { } // ------------------------------------------------------------------------- @@ -137,7 +136,7 @@ OUString SAL_CALL DBTypeDetection::detect( ::com::sun::star::uno::Sequence< ::co { bStreamFromDescr = sal_True; xStorageProperties.set( ::comphelper::OStorageHelper::GetStorageFromInputStream( - xInStream, m_aContext.getUNOContext() ), UNO_QUERY ); + xInStream, m_aContext ), UNO_QUERY ); } else { @@ -147,7 +146,7 @@ OUString SAL_CALL DBTypeDetection::detect( ::com::sun::star::uno::Sequence< ::co if ( !sFileLocation.isEmpty() ) { xStorageProperties.set( ::comphelper::OStorageHelper::GetStorageFromURL( - sFileLocation, ElementModes::READ, m_aContext.getUNOContext() ), UNO_QUERY ); + sFileLocation, ElementModes::READ, m_aContext ), UNO_QUERY ); } } @@ -186,7 +185,7 @@ OUString SAL_CALL DBTypeDetection::detect( ::com::sun::star::uno::Sequence< ::co // ------------------------------------------------------------------------- Reference< XInterface > SAL_CALL DBTypeDetection::Create( const Reference< XMultiServiceFactory > & rSMgr ) { - return *(new DBTypeDetection(rSMgr)); + return *(new DBTypeDetection( comphelper::getComponentContext(rSMgr) )); } // ------------------------------------------------------------------------- // XServiceInfo @@ -231,14 +230,14 @@ extern "C" void SAL_CALL createRegistryInfo_DBTypeDetection() class DBContentLoader : public ::cppu::WeakImplHelper2< XFrameLoader, XServiceInfo> { private: - ::comphelper::ComponentContext m_aContext; + const Reference< XComponentContext > m_aContext; Reference< XFrameLoader > m_xMySelf; OUString m_sCurrentURL; sal_uLong m_nStartWizard; DECL_LINK( OnStartTableWizard, void* ); public: - DBContentLoader(const Reference< XMultiServiceFactory >&); + DBContentLoader(const Reference< XComponentContext >&); ~DBContentLoader(); // XServiceInfo @@ -266,7 +265,7 @@ private: }; DBG_NAME(DBContentLoader) -DBContentLoader::DBContentLoader(const Reference< XMultiServiceFactory >& _rxFactory) +DBContentLoader::DBContentLoader(const Reference< XComponentContext >& _rxFactory) :m_aContext( _rxFactory ) ,m_nStartWizard(0) { @@ -285,7 +284,7 @@ DBContentLoader::~DBContentLoader() // ------------------------------------------------------------------------- Reference< XInterface > SAL_CALL DBContentLoader::Create( const Reference< XMultiServiceFactory > & rSMgr ) { - return *(new DBContentLoader(rSMgr)); + return *(new DBContentLoader( comphelper::getComponentContext(rSMgr) )); } // ------------------------------------------------------------------------- // XServiceInfo @@ -325,12 +324,12 @@ Sequence< OUString > DBContentLoader::getSupportedServiceNames_Static(void) thro namespace { // ................................................................... - sal_Bool lcl_urlAllowsInteraction( const ::comphelper::ComponentContext& _rContext, const OUString& _rURL ) + sal_Bool lcl_urlAllowsInteraction( const Reference<XComponentContext> & _rContext, const OUString& _rURL ) { bool bDoesAllow = sal_False; try { - Reference< XURLTransformer > xTransformer( URLTransformer::create(_rContext.getUNOContext()) ); + Reference< XURLTransformer > xTransformer( URLTransformer::create(_rContext) ); URL aURL; aURL.Complete = _rURL; xTransformer->parseStrict( aURL ); @@ -371,7 +370,7 @@ sal_Bool DBContentLoader::impl_executeNewDatabaseWizard( Reference< XModel >& _r aWizardArgs[0] <<= PropertyValue( OUString("ParentWindow"), 0, - makeAny( lcl_getTopMostWindow( m_aContext.getUNOContext() ) ), + makeAny( lcl_getTopMostWindow( m_aContext ) ), PropertyState_DIRECT_VALUE); aWizardArgs[1] <<= PropertyValue( @@ -381,11 +380,10 @@ sal_Bool DBContentLoader::impl_executeNewDatabaseWizard( Reference< XModel >& _r PropertyState_DIRECT_VALUE); // create the dialog - Reference< XExecutableDialog > xAdminDialog; - OSL_VERIFY( m_aContext.createComponentWithArguments( "com.sun.star.sdb.DatabaseWizardDialog", aWizardArgs, xAdminDialog ) ); + Reference< XExecutableDialog > xAdminDialog( m_aContext->getServiceManager()->createInstanceWithArgumentsAndContext("com.sun.star.sdb.DatabaseWizardDialog", aWizardArgs, m_aContext), UNO_QUERY_THROW); // execute it - if ( !xAdminDialog.is() || ( RET_OK != xAdminDialog->execute() ) ) + if ( RET_OK != xAdminDialog->execute() ) return sal_False; Reference<XPropertySet> xProp(xAdminDialog,UNO_QUERY); @@ -426,7 +424,7 @@ void SAL_CALL DBContentLoader::load(const Reference< XFrame > & rFrame, const OU // not touch it. if ( !aMediaDesc.has( "InteractionHandler" ) ) { - Reference< XInteractionHandler2 > xHandler( InteractionHandler::createWithParent(m_aContext.getUNOContext(), 0) ); + Reference< XInteractionHandler2 > xHandler( InteractionHandler::createWithParent(m_aContext, 0) ); aMediaDesc.put( "InteractionHandler", xHandler ); } @@ -442,7 +440,7 @@ void SAL_CALL DBContentLoader::load(const Reference< XFrame > & rFrame, const OU sal_Int32 nInitialSelection = -1; if ( !xModel.is() ) { - Reference< XDatabaseContext > xDatabaseContext( DatabaseContext::create(m_aContext.getUNOContext()) ); + Reference< XDatabaseContext > xDatabaseContext( DatabaseContext::create(m_aContext) ); OUString sFactoryName = SvtModuleOptions().GetFactoryEmptyDocumentURL(SvtModuleOptions::E_DATABASE); bCreateNew = sFactoryName.match(_rURL); @@ -598,8 +596,8 @@ IMPL_LINK( DBContentLoader, OnStartTableWizard, void*, /*NOTINTERESTEDIN*/ ) aWizArgs[0] <<= aValue; SolarMutexGuard aGuard; - Reference< XJobExecutor > xTableWizard; - if ( m_aContext.createComponentWithArguments( "com.sun.star.wizards.table.CallTableWizard", aWizArgs, xTableWizard ) ) + Reference< XJobExecutor > xTableWizard( m_aContext->getServiceManager()->createInstanceWithArgumentsAndContext("com.sun.star.wizards.table.CallTableWizard", aWizArgs, m_aContext), UNO_QUERY); + if ( xTableWizard.is() ) xTableWizard->trigger(OUString("start")); } catch(const Exception&) diff --git a/dbaccess/source/sdbtools/connection/connectiondependent.hxx b/dbaccess/source/sdbtools/connection/connectiondependent.hxx index 54d1eaff9a9b..4533520095d4 100644 --- a/dbaccess/source/sdbtools/connection/connectiondependent.hxx +++ b/dbaccess/source/sdbtools/connection/connectiondependent.hxx @@ -22,8 +22,8 @@ #include <com/sun/star/sdbc/XConnection.hpp> #include <com/sun/star/lang/DisposedException.hpp> +#include <com/sun/star/uno/XComponentContext.hpp> -#include <comphelper/componentcontext.hxx> #include <cppuhelper/weakref.hxx> #include <osl/mutex.hxx> @@ -41,7 +41,7 @@ namespace sdbtools mutable ::osl::Mutex m_aMutex; ::com::sun::star::uno::WeakReference< ::com::sun::star::sdbc::XConnection > m_aConnection; - ::comphelper::ComponentContext + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_aContext; /** a hard reference to the connection we're working for @@ -56,14 +56,14 @@ namespace sdbtools protected: ::osl::Mutex& getMutex() const { return m_aMutex; } - const ::comphelper::ComponentContext& + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& getContext() const { return m_aContext; } protected: class EntryGuard; protected: - ConnectionDependentComponent( const ::comphelper::ComponentContext& _rContext ) + ConnectionDependentComponent( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > & _rContext ) :m_aContext( _rContext ) { } diff --git a/dbaccess/source/sdbtools/connection/connectiontools.cxx b/dbaccess/source/sdbtools/connection/connectiontools.cxx index 29798eea5769..55b6c0229dd2 100644 --- a/dbaccess/source/sdbtools/connection/connectiontools.cxx +++ b/dbaccess/source/sdbtools/connection/connectiontools.cxx @@ -59,7 +59,7 @@ namespace sdbtools //= ConnectionTools //==================================================================== //-------------------------------------------------------------------- - ConnectionTools::ConnectionTools( const ::comphelper::ComponentContext& _rContext ) + ConnectionTools::ConnectionTools( const Reference<XComponentContext>& _rContext ) :ConnectionDependentComponent( _rContext ) { } @@ -146,7 +146,7 @@ namespace sdbtools //-------------------------------------------------------------------- Reference< XInterface > SAL_CALL ConnectionTools::Create(const Reference< XComponentContext >& _rxContext ) { - return *( new ConnectionTools( ::comphelper::ComponentContext( _rxContext ) ) ); + return *( new ConnectionTools( Reference<XComponentContext>( _rxContext ) ) ); } //-------------------------------------------------------------------- diff --git a/dbaccess/source/sdbtools/connection/connectiontools.hxx b/dbaccess/source/sdbtools/connection/connectiontools.hxx index 087460e9b730..504944cb14ae 100644 --- a/dbaccess/source/sdbtools/connection/connectiontools.hxx +++ b/dbaccess/source/sdbtools/connection/connectiontools.hxx @@ -31,8 +31,6 @@ #include <cppuhelper/implbase3.hxx> -#include <comphelper/componentcontext.hxx> - //........................................................................ namespace sdbtools { @@ -59,7 +57,7 @@ namespace sdbtools @param _rxContext the context of the component */ - ConnectionTools( const ::comphelper::ComponentContext& _rContext ); + ConnectionTools( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rContext ); // XConnectionTools virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdb::tools::XTableName > SAL_CALL createTableName() throw (::com::sun::star::uno::RuntimeException); diff --git a/dbaccess/source/sdbtools/connection/datasourcemetadata.cxx b/dbaccess/source/sdbtools/connection/datasourcemetadata.cxx index 6b6d2798ec16..f5e2d0ecbfc1 100644 --- a/dbaccess/source/sdbtools/connection/datasourcemetadata.cxx +++ b/dbaccess/source/sdbtools/connection/datasourcemetadata.cxx @@ -34,6 +34,7 @@ namespace sdbtools using ::com::sun::star::sdbc::XConnection; using ::com::sun::star::lang::NullPointerException; using ::com::sun::star::uno::RuntimeException; + using ::com::sun::star::uno::XComponentContext; /** === end UNO using === **/ //==================================================================== @@ -47,7 +48,7 @@ namespace sdbtools //= DataSourceMetaData //==================================================================== //-------------------------------------------------------------------- - DataSourceMetaData::DataSourceMetaData( const ::comphelper::ComponentContext& _rContext, const Reference< XConnection >& _rxConnection ) + DataSourceMetaData::DataSourceMetaData( const Reference<XComponentContext>& _rContext, const Reference< XConnection >& _rxConnection ) :ConnectionDependentComponent( _rContext ) ,m_pImpl( new DataSourceMetaData_Impl ) { diff --git a/dbaccess/source/sdbtools/connection/datasourcemetadata.hxx b/dbaccess/source/sdbtools/connection/datasourcemetadata.hxx index 7cddf4efd79e..fda74aa478b1 100644 --- a/dbaccess/source/sdbtools/connection/datasourcemetadata.hxx +++ b/dbaccess/source/sdbtools/connection/datasourcemetadata.hxx @@ -57,7 +57,7 @@ namespace sdbtools if _rxConnection is <NULL/> */ DataSourceMetaData( - const ::comphelper::ComponentContext& _rContext, + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rContext, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection ); diff --git a/dbaccess/source/sdbtools/connection/objectnames.cxx b/dbaccess/source/sdbtools/connection/objectnames.cxx index 73e305bfb675..f9cb51372f17 100644 --- a/dbaccess/source/sdbtools/connection/objectnames.cxx +++ b/dbaccess/source/sdbtools/connection/objectnames.cxx @@ -59,6 +59,7 @@ namespace sdbtools using ::com::sun::star::uno::Exception; using ::com::sun::star::uno::makeAny; using ::com::sun::star::uno::Any; + using ::com::sun::star::uno::XComponentContext; /** === end UNO using === **/ namespace CommandType = ::com::sun::star::sdb::CommandType; @@ -83,12 +84,12 @@ namespace sdbtools class PlainExistenceCheck : public INameValidation { private: - const ::comphelper::ComponentContext m_aContext; + const Reference<XComponentContext> m_aContext; Reference< XConnection > m_xConnection; Reference< XNameAccess > m_xContainer; public: - PlainExistenceCheck( const ::comphelper::ComponentContext& _rContext, const Reference< XConnection >& _rxConnection, const Reference< XNameAccess >& _rxContainer ) + PlainExistenceCheck( const Reference<XComponentContext>& _rContext, const Reference< XConnection >& _rxConnection, const Reference< XNameAccess >& _rxContainer ) :m_aContext( _rContext ) ,m_xConnection( _rxConnection ) ,m_xContainer( _rxContainer ) @@ -107,7 +108,7 @@ namespace sdbtools if ( validateName( _rName ) ) return; - ::connectivity::SQLError aErrors( m_aContext.getUNOContext() ); + ::connectivity::SQLError aErrors( m_aContext ); SQLException aError( aErrors.getSQLException( ErrorCondition::DB_OBJECT_NAME_IS_USED, m_xConnection, _rName ) ); ::dbtools::DatabaseMetaData aMeta( m_xConnection ); @@ -126,11 +127,11 @@ namespace sdbtools //==================================================================== class TableValidityCheck : public INameValidation { - const ::comphelper::ComponentContext m_aContext; + const Reference<XComponentContext> m_aContext; const Reference< XConnection > m_xConnection; public: - TableValidityCheck( const ::comphelper::ComponentContext& _rContext, const Reference< XConnection >& _rxConnection ) + TableValidityCheck( const Reference<XComponentContext>& _rContext, const Reference< XConnection >& _rxConnection ) :m_aContext( _rContext ) ,m_xConnection( _rxConnection ) { @@ -161,7 +162,7 @@ namespace sdbtools if ( validateName( _rName ) ) return; - ::connectivity::SQLError aErrors( m_aContext.getUNOContext() ); + ::connectivity::SQLError aErrors( m_aContext ); aErrors.raiseException( ErrorCondition::DB_INVALID_SQL_NAME, m_xConnection, _rName ); } }; @@ -171,11 +172,11 @@ namespace sdbtools //==================================================================== class QueryValidityCheck : public INameValidation { - const ::comphelper::ComponentContext m_aContext; + const Reference<XComponentContext> m_aContext; const Reference< XConnection > m_xConnection; public: - QueryValidityCheck( const ::comphelper::ComponentContext& _rContext, const Reference< XConnection >& _rxConnection ) + QueryValidityCheck( const Reference<XComponentContext>& _rContext, const Reference< XConnection >& _rxConnection ) :m_aContext( _rContext ) ,m_xConnection( _rxConnection ) { @@ -210,7 +211,7 @@ namespace sdbtools ::connectivity::ErrorCondition nErrorCondition = validateName_getErrorCondition( _rName ); if ( nErrorCondition != 0 ) { - ::connectivity::SQLError aErrors( m_aContext.getUNOContext() ); + ::connectivity::SQLError aErrors( m_aContext ); aErrors.raiseException( nErrorCondition, m_xConnection ); } } @@ -270,7 +271,7 @@ namespace sdbtools if the given command type is neither CommandType::TABLE or CommandType::QUERY */ static PNameValidation createExistenceCheck( - const ::comphelper::ComponentContext& _rContext, + const Reference<XComponentContext>& _rContext, sal_Int32 _nCommandType, const Reference< XConnection >& _rxConnection ); @@ -293,7 +294,7 @@ namespace sdbtools if the given command type is neither CommandType::TABLE or CommandType::QUERY */ static PNameValidation createValidityCheck( - const ::comphelper::ComponentContext& _rContext, + const Reference<XComponentContext>& _rContext, const sal_Int32 _nCommandType, const Reference< XConnection >& _rxConnection ); @@ -319,7 +320,7 @@ namespace sdbtools } //-------------------------------------------------------------------- - PNameValidation NameCheckFactory::createExistenceCheck( const ::comphelper::ComponentContext& _rContext, sal_Int32 _nCommandType, const Reference< XConnection >& _rxConnection ) + PNameValidation NameCheckFactory::createExistenceCheck( const Reference<XComponentContext>& _rContext, sal_Int32 _nCommandType, const Reference< XConnection >& _rxConnection ) { verifyCommandType( _nCommandType ); @@ -356,7 +357,7 @@ namespace sdbtools } //-------------------------------------------------------------------- - PNameValidation NameCheckFactory::createValidityCheck( const ::comphelper::ComponentContext& _rContext, sal_Int32 _nCommandType, const Reference< XConnection >& _rxConnection ) + PNameValidation NameCheckFactory::createValidityCheck( const Reference<XComponentContext>& _rContext, sal_Int32 _nCommandType, const Reference< XConnection >& _rxConnection ) { verifyCommandType( _nCommandType ); @@ -391,7 +392,7 @@ namespace sdbtools //= ObjectNames //==================================================================== //-------------------------------------------------------------------- - ObjectNames::ObjectNames( const ::comphelper::ComponentContext& _rContext, const Reference< XConnection >& _rxConnection ) + ObjectNames::ObjectNames( const Reference<XComponentContext>& _rContext, const Reference< XConnection >& _rxConnection ) :ConnectionDependentComponent( _rContext ) ,m_pImpl( new ObjectNames_Impl ) { diff --git a/dbaccess/source/sdbtools/connection/objectnames.hxx b/dbaccess/source/sdbtools/connection/objectnames.hxx index 7faab22d3658..714156a9fafd 100644 --- a/dbaccess/source/sdbtools/connection/objectnames.hxx +++ b/dbaccess/source/sdbtools/connection/objectnames.hxx @@ -24,7 +24,6 @@ #include <com/sun/star/sdb/tools/XObjectNames.hpp> -#include <comphelper/componentcontext.hxx> #include <cppuhelper/implbase1.hxx> #include <memory> @@ -60,7 +59,7 @@ namespace sdbtools if _rxConnection is <NULL/> */ ObjectNames( - const ::comphelper::ComponentContext& _rContext, + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rContext, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection ); diff --git a/dbaccess/source/sdbtools/connection/tablename.cxx b/dbaccess/source/sdbtools/connection/tablename.cxx index 2c32044a4760..0bf1a31741be 100644 --- a/dbaccess/source/sdbtools/connection/tablename.cxx +++ b/dbaccess/source/sdbtools/connection/tablename.cxx @@ -51,6 +51,7 @@ namespace sdbtools using ::com::sun::star::uno::Exception; using ::com::sun::star::uno::UNO_QUERY; using ::com::sun::star::beans::XPropertySetInfo; + using ::com::sun::star::uno::XComponentContext; /** === end UNO using === **/ namespace CompositionType = ::com::sun::star::sdb::tools::CompositionType; @@ -73,7 +74,7 @@ namespace sdbtools //= TableName //==================================================================== //-------------------------------------------------------------------- - TableName::TableName( const ::comphelper::ComponentContext& _rContext, const Reference< XConnection >& _rxConnection ) + TableName::TableName( const Reference<XComponentContext>& _rContext, const Reference< XConnection >& _rxConnection ) :ConnectionDependentComponent( _rContext ) ,m_pImpl( new TableName_Impl ) { diff --git a/dbaccess/source/sdbtools/connection/tablename.hxx b/dbaccess/source/sdbtools/connection/tablename.hxx index 81ec29e34302..63c394a49402 100644 --- a/dbaccess/source/sdbtools/connection/tablename.hxx +++ b/dbaccess/source/sdbtools/connection/tablename.hxx @@ -59,7 +59,7 @@ namespace sdbtools if _rxConnection is <NULL/> */ TableName( - const ::comphelper::ComponentContext& _rContext, + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rContext, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection ); diff --git a/dbaccess/source/ui/app/AppController.cxx b/dbaccess/source/ui/app/AppController.cxx index a08ac0b23b82..2a41aa082998 100644 --- a/dbaccess/source/ui/app/AppController.cxx +++ b/dbaccess/source/ui/app/AppController.cxx @@ -77,7 +77,6 @@ #include <comphelper/uno3.hxx> #include <comphelper/types.hxx> #include <comphelper/interaction.hxx> -#include <comphelper/componentcontext.hxx> #include <comphelper/processfactory.hxx> #include <vcl/msgbox.hxx> @@ -3010,11 +3009,11 @@ void OApplicationController::impl_migrateScripts_nothrow() try { OUString sDialogService("com.sun.star.sdb.application.MacroMigrationWizard"); - ::comphelper::ComponentContext aContext( getORB() ); + Reference<XComponentContext> aContext( getORB() ); Sequence< Any > aDialogArgs(1); aDialogArgs[0] <<= Reference< XOfficeDatabaseDocument >( m_xModel, UNO_QUERY_THROW ); Reference< XExecutableDialog > xDialog( - aContext.createComponentWithArguments( sDialogService, aDialogArgs ), + aContext->getServiceManager()->createInstanceWithArgumentsAndContext(sDialogService, aDialogArgs, aContext), UNO_QUERY ); if ( !xDialog.is() ) diff --git a/dbaccess/source/ui/browser/dbloader.cxx b/dbaccess/source/ui/browser/dbloader.cxx index ad7cbb12a210..7e0383eb4ecf 100644 --- a/dbaccess/source/ui/browser/dbloader.cxx +++ b/dbaccess/source/ui/browser/dbloader.cxx @@ -41,7 +41,6 @@ #include <com/sun/star/sdbc/XDataSource.hpp> #include <comphelper/namedvaluecollection.hxx> -#include <comphelper/componentcontext.hxx> #include <comphelper/processfactory.hxx> #include <cppuhelper/implbase2.hxx> #include <toolkit/awt/vclxwindow.hxx> diff --git a/dbaccess/source/ui/dlg/ConnectionHelper.cxx b/dbaccess/source/ui/dlg/ConnectionHelper.cxx index 5b1cebced880..442eac5ee225 100644 --- a/dbaccess/source/ui/dlg/ConnectionHelper.cxx +++ b/dbaccess/source/ui/dlg/ConnectionHelper.cxx @@ -72,7 +72,6 @@ #endif //_ADO_DATALINK_BROWSE_ #include <com/sun/star/mozilla/XMozillaBootstrap.hpp> -#include <comphelper/componentcontext.hxx> #include <comphelper/processfactory.hxx> diff --git a/dbaccess/source/ui/inc/unoadmin.hxx b/dbaccess/source/ui/inc/unoadmin.hxx index 4f7664fec371..8364fa57c5b6 100644 --- a/dbaccess/source/ui/inc/unoadmin.hxx +++ b/dbaccess/source/ui/inc/unoadmin.hxx @@ -53,7 +53,7 @@ protected: ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > m_xActiveConnection; protected: - ODatabaseAdministrationDialog(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB); + ODatabaseAdministrationDialog(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxORB); virtual ~ODatabaseAdministrationDialog(); protected: // OGenericUnoDialog overridables diff --git a/dbaccess/source/ui/inc/unosqlmessage.hxx b/dbaccess/source/ui/inc/unosqlmessage.hxx index f8b4bf21e491..dedbf4da9830 100644 --- a/dbaccess/source/ui/inc/unosqlmessage.hxx +++ b/dbaccess/source/ui/inc/unosqlmessage.hxx @@ -40,7 +40,7 @@ protected: // </properties> protected: - OSQLMessageDialog(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB); + OSQLMessageDialog(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxORB); public: // XTypeProvider diff --git a/dbaccess/source/ui/misc/TableCopyHelper.cxx b/dbaccess/source/ui/misc/TableCopyHelper.cxx index 1405204dda8a..d77b76251e92 100644 --- a/dbaccess/source/ui/misc/TableCopyHelper.cxx +++ b/dbaccess/source/ui/misc/TableCopyHelper.cxx @@ -39,7 +39,6 @@ #include <unotools/ucbhelper.hxx> #include <tools/urlobj.hxx> #include <tools/diagnose_ex.h> -#include <comphelper/componentcontext.hxx> #include <comphelper/processfactory.hxx> #include <com/sun/star/sdbcx/XTablesSupplier.hpp> #include <com/sun/star/sdbcx/XViewsSupplier.hpp> @@ -105,9 +104,9 @@ void OTableCopyHelper::insertTable( const ::rtl::OUString& i_rSourceDataSource, return; } - ::comphelper::ComponentContext aContext( m_pController->getORB() ); + Reference<XComponentContext> aContext( m_pController->getORB() ); - Reference< XDataAccessDescriptorFactory > xFactory( DataAccessDescriptorFactory::get( aContext.getUNOContext() ) ); + Reference< XDataAccessDescriptorFactory > xFactory( DataAccessDescriptorFactory::get( aContext ) ); Reference< XPropertySet > xSource( xFactory->createDataAccessDescriptor(), UNO_SET_THROW ); xSource->setPropertyValue( PROPERTY_COMMAND_TYPE, makeAny( i_nCommandType ) ); @@ -120,7 +119,7 @@ void OTableCopyHelper::insertTable( const ::rtl::OUString& i_rSourceDataSource, Reference< XPropertySet > xDest( xFactory->createDataAccessDescriptor(), UNO_SET_THROW ); xDest->setPropertyValue( PROPERTY_ACTIVE_CONNECTION, makeAny( i_rDestConnection ) ); - Reference< XCopyTableWizard > xWizard( CopyTableWizard::create( aContext.getUNOContext(), xSource, xDest ), UNO_SET_THROW ); + Reference< XCopyTableWizard > xWizard( CopyTableWizard::create( aContext, xSource, xDest ), UNO_SET_THROW ); ::rtl::OUString sTableNameForAppend( GetTableNameForAppend() ); xWizard->setDestinationTableName( GetTableNameForAppend() ); diff --git a/dbaccess/source/ui/misc/UITools.cxx b/dbaccess/source/ui/misc/UITools.cxx index 98be0f40c77c..58668ca16864 100644 --- a/dbaccess/source/ui/misc/UITools.cxx +++ b/dbaccess/source/ui/misc/UITools.cxx @@ -71,7 +71,6 @@ #include "FieldDescriptions.hxx" #include <comphelper/processfactory.hxx> #include <comphelper/stl_types.hxx> -#include <comphelper/componentcontext.hxx> #include <svx/svxids.hrc> diff --git a/dbaccess/source/ui/uno/AdvancedSettingsDlg.cxx b/dbaccess/source/ui/uno/AdvancedSettingsDlg.cxx index 41c2e7ce9299..45e69977fe9e 100644 --- a/dbaccess/source/ui/uno/AdvancedSettingsDlg.cxx +++ b/dbaccess/source/ui/uno/AdvancedSettingsDlg.cxx @@ -21,6 +21,7 @@ #include "unoadmin.hxx" #include "dbu_reghelper.hxx" #include "advancedsettingsdlg.hxx" +#include <comphelper/processfactory.hxx> //......................................................................... namespace dbaui @@ -40,7 +41,7 @@ namespace dbaui { protected: - OAdvancedSettingsDialog(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB); + OAdvancedSettingsDialog(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxORB); public: // XTypeProvider @@ -69,7 +70,7 @@ namespace dbaui //========================================================================= //------------------------------------------------------------------------- - OAdvancedSettingsDialog::OAdvancedSettingsDialog(const Reference< XMultiServiceFactory >& _rxORB) + OAdvancedSettingsDialog::OAdvancedSettingsDialog(const Reference< XComponentContext >& _rxORB) :ODatabaseAdministrationDialog(_rxORB) { } @@ -83,7 +84,7 @@ namespace dbaui //------------------------------------------------------------------------- Reference< XInterface > SAL_CALL OAdvancedSettingsDialog::Create(const Reference< XMultiServiceFactory >& _rxFactory) { - return *(new OAdvancedSettingsDialog(_rxFactory)); + return *(new OAdvancedSettingsDialog( comphelper::getComponentContext(_rxFactory) )); } //------------------------------------------------------------------------- @@ -135,7 +136,7 @@ namespace dbaui //------------------------------------------------------------------------------ Dialog* OAdvancedSettingsDialog::createDialog(Window* _pParent) { - AdvancedSettingsDialog* pDlg = new AdvancedSettingsDialog(_pParent, m_pDatasourceItems, m_aContext.getUNOContext(),m_aInitialSelection); + AdvancedSettingsDialog* pDlg = new AdvancedSettingsDialog(_pParent, m_pDatasourceItems, m_aContext, m_aInitialSelection); return pDlg; } diff --git a/dbaccess/source/ui/uno/DBTypeWizDlg.cxx b/dbaccess/source/ui/uno/DBTypeWizDlg.cxx index a18510f0ef5b..77fb2f87724b 100644 --- a/dbaccess/source/ui/uno/DBTypeWizDlg.cxx +++ b/dbaccess/source/ui/uno/DBTypeWizDlg.cxx @@ -21,6 +21,7 @@ #include "dbu_reghelper.hxx" #include "DBTypeWizDlg.hxx" #include "dbwiz.hxx" +#include <comphelper/processfactory.hxx> using namespace dbaui; @@ -40,7 +41,7 @@ namespace dbaui //========================================================================= //------------------------------------------------------------------------- -ODBTypeWizDialog::ODBTypeWizDialog(const Reference< XMultiServiceFactory >& _rxORB) +ODBTypeWizDialog::ODBTypeWizDialog(const Reference< XComponentContext >& _rxORB) :ODatabaseAdministrationDialog(_rxORB) { } @@ -54,7 +55,7 @@ Sequence<sal_Int8> SAL_CALL ODBTypeWizDialog::getImplementationId( ) throw(Runt //------------------------------------------------------------------------- Reference< XInterface > SAL_CALL ODBTypeWizDialog::Create(const Reference< XMultiServiceFactory >& _rxFactory) { - return *(new ODBTypeWizDialog(_rxFactory)); + return *(new ODBTypeWizDialog( comphelper::getComponentContext(_rxFactory) )); } //------------------------------------------------------------------------- @@ -106,7 +107,7 @@ Reference<XPropertySetInfo> SAL_CALL ODBTypeWizDialog::getPropertySetInfo() thr //------------------------------------------------------------------------------ Dialog* ODBTypeWizDialog::createDialog(Window* _pParent) { - ODbTypeWizDialog* pDlg = new ODbTypeWizDialog(_pParent, m_pDatasourceItems, m_aContext.getUNOContext(),m_aInitialSelection); + ODbTypeWizDialog* pDlg = new ODbTypeWizDialog(_pParent, m_pDatasourceItems, m_aContext, m_aInitialSelection); return pDlg; } diff --git a/dbaccess/source/ui/uno/DBTypeWizDlg.hxx b/dbaccess/source/ui/uno/DBTypeWizDlg.hxx index c70b5bc25846..77f93d7891dd 100644 --- a/dbaccess/source/ui/uno/DBTypeWizDlg.hxx +++ b/dbaccess/source/ui/uno/DBTypeWizDlg.hxx @@ -37,7 +37,7 @@ class ODBTypeWizDialog { protected: - ODBTypeWizDialog(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB); + ODBTypeWizDialog(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxORB); public: // XTypeProvider diff --git a/dbaccess/source/ui/uno/DBTypeWizDlgSetup.cxx b/dbaccess/source/ui/uno/DBTypeWizDlgSetup.cxx index 31d30112d6be..a6d83ea78a71 100644 --- a/dbaccess/source/ui/uno/DBTypeWizDlgSetup.cxx +++ b/dbaccess/source/ui/uno/DBTypeWizDlgSetup.cxx @@ -26,6 +26,7 @@ #include <com/sun/star/sdb/XOfficeDatabaseDocument.hpp> #include <com/sun/star/sdbc/XDataSource.hpp> #include <vcl/msgbox.hxx> +#include <comphelper/processfactory.hxx> using namespace dbaui; @@ -47,7 +48,7 @@ namespace dbaui //========================================================================= //------------------------------------------------------------------------- -ODBTypeWizDialogSetup::ODBTypeWizDialogSetup(const Reference< XMultiServiceFactory >& _rxORB) +ODBTypeWizDialogSetup::ODBTypeWizDialogSetup(const Reference< XComponentContext >& _rxORB) :ODatabaseAdministrationDialog(_rxORB) ,m_bOpenDatabase(sal_True) ,m_bStartTableWizard(sal_False) @@ -68,7 +69,7 @@ Sequence<sal_Int8> SAL_CALL ODBTypeWizDialogSetup::getImplementationId( ) throw //------------------------------------------------------------------------- Reference< XInterface > SAL_CALL ODBTypeWizDialogSetup::Create(const Reference< XMultiServiceFactory >& _rxFactory) { - Reference < XInterface > xDBWizard = *(new ODBTypeWizDialogSetup(_rxFactory)); + Reference < XInterface > xDBWizard = *(new ODBTypeWizDialogSetup( comphelper::getComponentContext(_rxFactory) )); return xDBWizard; } @@ -120,7 +121,7 @@ Reference<XPropertySetInfo> SAL_CALL ODBTypeWizDialogSetup::getPropertySetInfo( //------------------------------------------------------------------------------ Dialog* ODBTypeWizDialogSetup::createDialog(Window* _pParent) { - return new ODbTypeWizDialogSetup(_pParent, m_pDatasourceItems, m_aContext.getUNOContext(), m_aInitialSelection); + return new ODbTypeWizDialogSetup(_pParent, m_pDatasourceItems, m_aContext, m_aInitialSelection); } // ----------------------------------------------------------------------------- void ODBTypeWizDialogSetup::executedDialog(sal_Int16 _nExecutionResult) diff --git a/dbaccess/source/ui/uno/DBTypeWizDlgSetup.hxx b/dbaccess/source/ui/uno/DBTypeWizDlgSetup.hxx index daec5c9c93ac..fc9eb22bdf3d 100644 --- a/dbaccess/source/ui/uno/DBTypeWizDlgSetup.hxx +++ b/dbaccess/source/ui/uno/DBTypeWizDlgSetup.hxx @@ -40,7 +40,7 @@ class ODBTypeWizDialogSetup sal_Bool m_bStartTableWizard; protected: - ODBTypeWizDialogSetup(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB); + ODBTypeWizDialogSetup(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxORB); public: // XTypeProvider diff --git a/dbaccess/source/ui/uno/TableFilterDlg.cxx b/dbaccess/source/ui/uno/TableFilterDlg.cxx index 7538e8e44448..a4411a77a4dc 100644 --- a/dbaccess/source/ui/uno/TableFilterDlg.cxx +++ b/dbaccess/source/ui/uno/TableFilterDlg.cxx @@ -21,6 +21,7 @@ #include "dbu_reghelper.hxx" #include "TableFilterDlg.hxx" #include "TablesSingleDlg.hxx" +#include <comphelper/processfactory.hxx> using namespace dbaui; @@ -41,7 +42,7 @@ namespace dbaui //========================================================================= //------------------------------------------------------------------------- -OTableFilterDialog::OTableFilterDialog(const Reference< XMultiServiceFactory >& _rxORB) +OTableFilterDialog::OTableFilterDialog(const Reference< XComponentContext >& _rxORB) :ODatabaseAdministrationDialog(_rxORB) { } @@ -55,7 +56,7 @@ Sequence<sal_Int8> SAL_CALL OTableFilterDialog::getImplementationId( ) throw(Ru //------------------------------------------------------------------------- Reference< XInterface > SAL_CALL OTableFilterDialog::Create(const Reference< XMultiServiceFactory >& _rxFactory) { - return *(new OTableFilterDialog(_rxFactory)); + return *(new OTableFilterDialog( comphelper::getComponentContext(_rxFactory) )); } //------------------------------------------------------------------------- @@ -107,7 +108,7 @@ Reference<XPropertySetInfo> SAL_CALL OTableFilterDialog::getPropertySetInfo() t //------------------------------------------------------------------------------ Dialog* OTableFilterDialog::createDialog(Window* _pParent) { - OTableSubscriptionDialog* pDlg = new OTableSubscriptionDialog(_pParent, m_pDatasourceItems, m_aContext.getUNOContext(), m_aInitialSelection); + OTableSubscriptionDialog* pDlg = new OTableSubscriptionDialog(_pParent, m_pDatasourceItems, m_aContext, m_aInitialSelection); return pDlg; } diff --git a/dbaccess/source/ui/uno/TableFilterDlg.hxx b/dbaccess/source/ui/uno/TableFilterDlg.hxx index bc07c8d3c700..4982c5d1f229 100644 --- a/dbaccess/source/ui/uno/TableFilterDlg.hxx +++ b/dbaccess/source/ui/uno/TableFilterDlg.hxx @@ -37,7 +37,7 @@ class OTableFilterDialog { protected: - OTableFilterDialog(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB); + OTableFilterDialog(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxORB); public: // XTypeProvider diff --git a/dbaccess/source/ui/uno/UserSettingsDlg.cxx b/dbaccess/source/ui/uno/UserSettingsDlg.cxx index 0ccace7fd67f..7fa2a8ee8035 100644 --- a/dbaccess/source/ui/uno/UserSettingsDlg.cxx +++ b/dbaccess/source/ui/uno/UserSettingsDlg.cxx @@ -21,6 +21,7 @@ #include "dbu_reghelper.hxx" #include "UserSettingsDlg.hxx" #include "UserAdminDlg.hxx" +#include <comphelper/processfactory.hxx> using namespace dbaui; @@ -41,7 +42,7 @@ namespace dbaui //========================================================================= //------------------------------------------------------------------------- -OUserSettingsDialog::OUserSettingsDialog(const Reference< XMultiServiceFactory >& _rxORB) +OUserSettingsDialog::OUserSettingsDialog(const Reference< XComponentContext >& _rxORB) :ODatabaseAdministrationDialog(_rxORB) { } @@ -55,7 +56,7 @@ Sequence<sal_Int8> SAL_CALL OUserSettingsDialog::getImplementationId( ) throw(R //------------------------------------------------------------------------- Reference< XInterface > SAL_CALL OUserSettingsDialog::Create(const Reference< XMultiServiceFactory >& _rxFactory) { - return *(new OUserSettingsDialog(_rxFactory)); + return *(new OUserSettingsDialog( comphelper::getComponentContext(_rxFactory) )); } //------------------------------------------------------------------------- @@ -107,7 +108,7 @@ Reference<XPropertySetInfo> SAL_CALL OUserSettingsDialog::getPropertySetInfo() //------------------------------------------------------------------------------ Dialog* OUserSettingsDialog::createDialog(Window* _pParent) { - OUserAdminDlg* pDlg = new OUserAdminDlg(_pParent, m_pDatasourceItems, m_aContext.getUNOContext(),m_aInitialSelection,m_xActiveConnection); + OUserAdminDlg* pDlg = new OUserAdminDlg(_pParent, m_pDatasourceItems, m_aContext, m_aInitialSelection, m_xActiveConnection); return pDlg; } diff --git a/dbaccess/source/ui/uno/UserSettingsDlg.hxx b/dbaccess/source/ui/uno/UserSettingsDlg.hxx index 0f5ab97a8492..7e3e05ed82f3 100644 --- a/dbaccess/source/ui/uno/UserSettingsDlg.hxx +++ b/dbaccess/source/ui/uno/UserSettingsDlg.hxx @@ -37,7 +37,7 @@ class OUserSettingsDialog { protected: - OUserSettingsDialog(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB); + OUserSettingsDialog(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxORB); public: // XTypeProvider diff --git a/dbaccess/source/ui/uno/admindlg.cxx b/dbaccess/source/ui/uno/admindlg.cxx index 613a2822d548..6d6acb79eccf 100644 --- a/dbaccess/source/ui/uno/admindlg.cxx +++ b/dbaccess/source/ui/uno/admindlg.cxx @@ -21,6 +21,7 @@ #include "dbu_reghelper.hxx" #include "admindlg.hxx" #include "dbadmin.hxx" +#include <comphelper/processfactory.hxx> using namespace dbaui; @@ -41,7 +42,7 @@ namespace dbaui //========================================================================= //------------------------------------------------------------------------- -ODataSourcePropertyDialog::ODataSourcePropertyDialog(const Reference< XMultiServiceFactory >& _rxORB) +ODataSourcePropertyDialog::ODataSourcePropertyDialog(const Reference< XComponentContext >& _rxORB) :ODatabaseAdministrationDialog(_rxORB) { } @@ -55,7 +56,7 @@ Sequence<sal_Int8> SAL_CALL ODataSourcePropertyDialog::getImplementationId( ) t //------------------------------------------------------------------------- Reference< XInterface > SAL_CALL ODataSourcePropertyDialog::Create(const Reference< XMultiServiceFactory >& _rxFactory) { - return *(new ODataSourcePropertyDialog(_rxFactory)); + return *(new ODataSourcePropertyDialog( comphelper::getComponentContext(_rxFactory) )); } //------------------------------------------------------------------------- @@ -108,7 +109,7 @@ Reference<XPropertySetInfo> SAL_CALL ODataSourcePropertyDialog::getPropertySetI Dialog* ODataSourcePropertyDialog::createDialog(Window* _pParent) { - ODbAdminDialog* pDialog = new ODbAdminDialog(_pParent, m_pDatasourceItems, m_aContext.getUNOContext()); + ODbAdminDialog* pDialog = new ODbAdminDialog(_pParent, m_pDatasourceItems, m_aContext); // the initial selection if ( m_aInitialSelection.hasValue() ) diff --git a/dbaccess/source/ui/uno/admindlg.hxx b/dbaccess/source/ui/uno/admindlg.hxx index 087a9a67afa5..0c63cf34efcc 100644 --- a/dbaccess/source/ui/uno/admindlg.hxx +++ b/dbaccess/source/ui/uno/admindlg.hxx @@ -37,7 +37,7 @@ class ODataSourcePropertyDialog { protected: - ODataSourcePropertyDialog(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB); + ODataSourcePropertyDialog(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxORB); public: // XTypeProvider diff --git a/dbaccess/source/ui/uno/composerdialogs.cxx b/dbaccess/source/ui/uno/composerdialogs.cxx index 418e52e8388b..b6a3b0db03f7 100644 --- a/dbaccess/source/ui/uno/composerdialogs.cxx +++ b/dbaccess/source/ui/uno/composerdialogs.cxx @@ -25,6 +25,7 @@ #include "dbustrings.hrc" #include "queryfilter.hxx" #include "queryorder.hxx" +#include <comphelper/processfactory.hxx> #include <connectivity/dbtools.hxx> #include <tools/diagnose_ex.h> #include <osl/diagnose.h> @@ -59,7 +60,7 @@ namespace dbaui //===================================================================== DBG_NAME(ComposerDialog) //--------------------------------------------------------------------- - ComposerDialog::ComposerDialog(const Reference< XMultiServiceFactory >& _rxORB) + ComposerDialog::ComposerDialog(const Reference< XComponentContext >& _rxORB) :OGenericUnoDialog( _rxORB ) { DBG_CTOR(ComposerDialog,NULL); @@ -101,7 +102,7 @@ namespace dbaui // fallback: if there is a connection and thus a row set, but no composer, create one if ( xConnection.is() && !m_xComposer.is() ) - m_xComposer = ::dbtools::getCurrentSettingsComposer( Reference< XPropertySet >( m_xRowSet, UNO_QUERY ), m_aContext.getUNOContext() ); + m_xComposer = ::dbtools::getCurrentSettingsComposer( Reference< XPropertySet >( m_xRowSet, UNO_QUERY ), m_aContext ); // the columns of the row set Reference< XColumnsSupplier > xSuppColumns( m_xRowSet, UNO_QUERY ); @@ -135,18 +136,27 @@ namespace dbaui //= RowsetFilterDialog //===================================================================== //--------------------------------------------------------------------- - RowsetFilterDialog::RowsetFilterDialog( const Reference< XMultiServiceFactory >& _rxORB ) + RowsetFilterDialog::RowsetFilterDialog( const Reference< XComponentContext >& _rxORB ) :ComposerDialog( _rxORB ) { } //--------------------------------------------------------------------- - IMPLEMENT_SERVICE_INFO1_STATIC( RowsetFilterDialog, "com.sun.star.uno.comp.sdb.RowsetFilterDialog", "com.sun.star.sdb.FilterDialog" ) + IMPLEMENT_SERVICE_INFO_IMPLNAME_STATIC(RowsetFilterDialog, "com.sun.star.uno.comp.sdb.RowsetFilterDialog") + IMPLEMENT_SERVICE_INFO_SUPPORTS(RowsetFilterDialog) + IMPLEMENT_SERVICE_INFO_GETSUPPORTED1_STATIC(RowsetFilterDialog, "com.sun.star.sdb.FilterDialog") + + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > + SAL_CALL RowsetFilterDialog::Create(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB) + { + return static_cast< XServiceInfo* >(new RowsetFilterDialog( comphelper::getComponentContext(_rxORB))); + } + //--------------------------------------------------------------------- Dialog* RowsetFilterDialog::createComposerDialog( Window* _pParent, const Reference< XConnection >& _rxConnection, const Reference< XNameAccess >& _rxColumns ) { - return new DlgFilterCrit( _pParent, m_aContext.getUNOContext(), _rxConnection, m_xComposer, _rxColumns ); + return new DlgFilterCrit( _pParent, m_aContext, _rxConnection, m_xComposer, _rxColumns ); } void SAL_CALL RowsetFilterDialog::initialize( const Sequence< Any >& aArguments ) throw (Exception, RuntimeException) @@ -181,13 +191,21 @@ namespace dbaui //= RowsetOrderDialog //===================================================================== //--------------------------------------------------------------------- - RowsetOrderDialog::RowsetOrderDialog( const Reference< XMultiServiceFactory >& _rxORB ) + RowsetOrderDialog::RowsetOrderDialog( const Reference< XComponentContext >& _rxORB ) :ComposerDialog( _rxORB ) { } //--------------------------------------------------------------------- - IMPLEMENT_SERVICE_INFO1_STATIC( RowsetOrderDialog, "com.sun.star.uno.comp.sdb.RowsetOrderDialog", "com.sun.star.sdb.OrderDialog" ) + IMPLEMENT_SERVICE_INFO_IMPLNAME_STATIC(RowsetOrderDialog, "com.sun.star.uno.comp.sdb.RowsetOrderDialog") + IMPLEMENT_SERVICE_INFO_SUPPORTS(RowsetOrderDialog) + IMPLEMENT_SERVICE_INFO_GETSUPPORTED1_STATIC(RowsetOrderDialog, "com.sun.star.sdb.OrderDialog") + + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > + SAL_CALL RowsetOrderDialog::Create(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB) + { + return static_cast< XServiceInfo* >(new RowsetOrderDialog( comphelper::getComponentContext(_rxORB))); + } //--------------------------------------------------------------------- Dialog* RowsetOrderDialog::createComposerDialog( Window* _pParent, const Reference< XConnection >& _rxConnection, const Reference< XNameAccess >& _rxColumns ) diff --git a/dbaccess/source/ui/uno/composerdialogs.hxx b/dbaccess/source/ui/uno/composerdialogs.hxx index 618eacfd902f..846ec80275cb 100644 --- a/dbaccess/source/ui/uno/composerdialogs.hxx +++ b/dbaccess/source/ui/uno/composerdialogs.hxx @@ -55,7 +55,7 @@ namespace dbaui // </properties> protected: - ComposerDialog(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB); + ComposerDialog(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxORB); ~ComposerDialog(); public: @@ -83,7 +83,7 @@ namespace dbaui { public: RowsetFilterDialog( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxORB ); DECLARE_SERVICE_INFO_STATIC( ); @@ -110,7 +110,7 @@ namespace dbaui { public: RowsetOrderDialog( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxORB ); DECLARE_SERVICE_INFO_STATIC( ); diff --git a/dbaccess/source/ui/uno/copytablewizard.cxx b/dbaccess/source/ui/uno/copytablewizard.cxx index f10d5b2ee8dd..758b4e5c525d 100644 --- a/dbaccess/source/ui/uno/copytablewizard.cxx +++ b/dbaccess/source/ui/uno/copytablewizard.cxx @@ -55,7 +55,7 @@ #include <com/sun/star/sdbc/DriverManager.hpp> #include <com/sun/star/sdbc/ConnectionPool.hpp> -#include <comphelper/componentcontext.hxx> +#include <comphelper/processfactory.hxx> #include <comphelper/interaction.hxx> #include <comphelper/namedvaluecollection.hxx> #include <comphelper/proparrhlp.hxx> @@ -87,6 +87,7 @@ namespace dbaui using ::com::sun::star::uno::Any; using ::com::sun::star::uno::makeAny; using ::com::sun::star::uno::Sequence; + using ::com::sun::star::uno::XComponentContext; using ::com::sun::star::beans::XPropertySetInfo; using ::com::sun::star::lang::XMultiServiceFactory; using ::com::sun::star::beans::Property; @@ -193,7 +194,7 @@ namespace dbaui bool isInitialized() const { return m_xSourceConnection.is() && m_pSourceObject.get() && m_xDestConnection.is(); } protected: - CopyTableWizard( const Reference< XMultiServiceFactory >& _rxORB ); + CopyTableWizard( const Reference< XComponentContext >& _rxORB ); ~CopyTableWizard(); // OGenericUnoDialog overridables @@ -338,7 +339,7 @@ namespace dbaui const CopyTableRowEvent& _rEvent ); private: - ::comphelper::ComponentContext m_aContext; + Reference<XComponentContext> m_xContext; // attributes sal_Int16 m_nOperation; @@ -392,9 +393,9 @@ private: //========================================================================= //------------------------------------------------------------------------- -CopyTableWizard::CopyTableWizard( const Reference< XMultiServiceFactory >& _rxORB ) +CopyTableWizard::CopyTableWizard( const Reference< XComponentContext >& _rxORB ) :CopyTableWizard_Base( _rxORB ) - ,m_aContext( _rxORB ) + ,m_xContext( _rxORB ) ,m_nOperation( CopyTableOperation::CopyDefinitionAndData ) ,m_sDestinationTable() ,m_aPrimaryKeyName( sal_False, "ID" ) @@ -432,7 +433,7 @@ CopyTableWizard::~CopyTableWizard() //------------------------------------------------------------------------- Reference< XInterface > CopyTableWizard::Create( const Reference< XMultiServiceFactory >& _rxFactory ) { - return *( new CopyTableWizard( _rxFactory ) ); + return *( new CopyTableWizard( comphelper::getComponentContext(_rxFactory) ) ); } //------------------------------------------------------------------------- @@ -911,7 +912,7 @@ SharedConnection CopyTableWizard::impl_extractConnection_throw( const Reference< OSL_VERIFY( _rxDataSourceDescriptor->getPropertyValue( PROPERTY_DATABASE_LOCATION ) >>= sDatabaseLocation ); // need a DatabaseContext for loading the data source - Reference< XDatabaseContext > xDatabaseContext = DatabaseContext::create( m_aContext.getUNOContext() ); + Reference< XDatabaseContext > xDatabaseContext = DatabaseContext::create( m_xContext ); Reference< XDataSource > xDataSource; if ( !sDataSource.isEmpty() ) xDataSource.set( xDatabaseContext->getByName( sDataSource ), UNO_QUERY_THROW ); @@ -950,11 +951,11 @@ SharedConnection CopyTableWizard::impl_extractConnection_throw( const Reference< Reference< XDriverManager > xDriverManager; try { - xDriverManager.set( ConnectionPool::create( m_aContext.getUNOContext() ), UNO_QUERY_THROW ); + xDriverManager.set( ConnectionPool::create( m_xContext ), UNO_QUERY_THROW ); } catch( const Exception& ) { } if ( !xDriverManager.is() ) // no connection pool installed - xDriverManager.set( DriverManager::create(m_aContext.getUNOContext() ), UNO_QUERY_THROW ); + xDriverManager.set( DriverManager::create( m_xContext ), UNO_QUERY_THROW ); if ( aConnectionInfo.getLength() ) xConnection.set( xDriverManager->getConnectionWithInfo( sConnectionResource, aConnectionInfo ), UNO_SET_THROW ); @@ -1540,7 +1541,7 @@ void SAL_CALL CopyTableWizard::initialize( const Sequence< Any >& _rArguments ) ); } if ( !m_xInteractionHandler.is() ) - m_xInteractionHandler.set( InteractionHandler::createWithParent(m_aContext.getUNOContext(), 0), UNO_QUERY ); + m_xInteractionHandler.set( InteractionHandler::createWithParent(m_xContext, 0), UNO_QUERY ); Reference< XInteractionHandler > xSourceDocHandler; Reference< XPropertySet > xSourceDescriptor( impl_ensureDataAccessDescriptor_throw( _rArguments, 0, m_xSourceConnection, xSourceDocHandler ) ); @@ -1593,7 +1594,7 @@ Dialog* CopyTableWizard::createDialog( Window* _pParent ) *m_pSourceObject, m_xSourceConnection.getTyped(), m_xDestConnection.getTyped(), - m_aContext.getUNOContext(), + m_xContext, m_xInteractionHandler ); diff --git a/dbaccess/source/ui/uno/textconnectionsettings_uno.cxx b/dbaccess/source/ui/uno/textconnectionsettings_uno.cxx index 1db5b7a12460..572126dcc215 100644 --- a/dbaccess/source/ui/uno/textconnectionsettings_uno.cxx +++ b/dbaccess/source/ui/uno/textconnectionsettings_uno.cxx @@ -30,7 +30,7 @@ #include <com/sun/star/beans/PropertyAttribute.hpp> #include <com/sun/star/sdb/XTextConnectionSettings.hpp> -#include <comphelper/componentcontext.hxx> +#include <comphelper/processfactory.hxx> #include <svtools/genericunodialog.hxx> #include <cppuhelper/implbase1.hxx> @@ -48,6 +48,7 @@ namespace dbaui using ::com::sun::star::uno::RuntimeException; using ::com::sun::star::uno::Any; using ::com::sun::star::uno::makeAny; + using ::com::sun::star::uno::XComponentContext; using ::com::sun::star::beans::XPropertySetInfo; using ::com::sun::star::uno::Sequence; using ::com::sun::star::beans::Property; @@ -74,7 +75,7 @@ namespace dbaui PropertyValues m_aPropertyValues; protected: - OTextConnectionSettingsDialog( const ::comphelper::ComponentContext& _rContext ); + OTextConnectionSettingsDialog( const Reference<XComponentContext>& _rContext ); virtual ~OTextConnectionSettingsDialog(); public: @@ -116,8 +117,8 @@ namespace dbaui //= OTextConnectionSettingsDialog //==================================================================== //-------------------------------------------------------------------- - OTextConnectionSettingsDialog::OTextConnectionSettingsDialog( const ::comphelper::ComponentContext& _rContext ) - :OTextConnectionSettingsDialog_BASE( _rContext.getLegacyServiceFactory() ) + OTextConnectionSettingsDialog::OTextConnectionSettingsDialog( const Reference<XComponentContext>& _rContext ) + :OTextConnectionSettingsDialog_BASE( _rContext ) { TextConnectionSettingsDialog::bindItemStorages( *m_pDatasourceItems, m_aPropertyValues ); } @@ -131,7 +132,15 @@ namespace dbaui IMPLEMENT_IMPLEMENTATION_ID( OTextConnectionSettingsDialog ) //--------------------------------------------------------------------- - IMPLEMENT_SERVICE_INFO1_STATIC( OTextConnectionSettingsDialog, "com.sun.star.comp.dbaccess.OTextConnectionSettingsDialog", "com.sun.star.sdb.TextConnectionSettings" ) + IMPLEMENT_SERVICE_INFO_IMPLNAME_STATIC(OTextConnectionSettingsDialog, "com.sun.star.comp.dbaccess.OTextConnectionSettingsDialog") + IMPLEMENT_SERVICE_INFO_SUPPORTS(OTextConnectionSettingsDialog) + IMPLEMENT_SERVICE_INFO_GETSUPPORTED1_STATIC(OTextConnectionSettingsDialog, "com.sun.star.sdb.TextConnectionSettings") + + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > + SAL_CALL OTextConnectionSettingsDialog::Create(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB) + { + return static_cast< XServiceInfo* >(new OTextConnectionSettingsDialog( comphelper::getComponentContext(_rxORB))); + } //--------------------------------------------------------------------- Reference< XPropertySetInfo > SAL_CALL OTextConnectionSettingsDialog::getPropertySetInfo() throw(RuntimeException) diff --git a/dbaccess/source/ui/uno/unoDirectSql.cxx b/dbaccess/source/ui/uno/unoDirectSql.cxx index 3bebc92be2d7..b32a2d3efc5b 100644 --- a/dbaccess/source/ui/uno/unoDirectSql.cxx +++ b/dbaccess/source/ui/uno/unoDirectSql.cxx @@ -28,6 +28,7 @@ #include "dbustrings.hrc" #include "datasourceconnector.hxx" #include <tools/diagnose_ex.h> +#include <comphelper/processfactory.hxx> extern "C" void SAL_CALL createRegistryInfo_ODirectSQLDialog() @@ -53,7 +54,7 @@ namespace dbaui //===================================================================== DBG_NAME(ODirectSQLDialog) //--------------------------------------------------------------------- - ODirectSQLDialog::ODirectSQLDialog(const Reference< XMultiServiceFactory >& _rxORB) + ODirectSQLDialog::ODirectSQLDialog(const Reference< XComponentContext >& _rxORB) :ODirectSQLDialog_BASE( _rxORB ) { DBG_CTOR(ODirectSQLDialog,NULL); @@ -71,7 +72,15 @@ DBG_NAME(ODirectSQLDialog) IMPLEMENT_IMPLEMENTATION_ID( ODirectSQLDialog ) //--------------------------------------------------------------------- - IMPLEMENT_SERVICE_INFO1_STATIC( ODirectSQLDialog, "com.sun.star.comp.sdb.DirectSQLDialog", SERVICE_SDB_DIRECTSQLDIALOG.ascii ) + IMPLEMENT_SERVICE_INFO_IMPLNAME_STATIC(ODirectSQLDialog, "com.sun.star.comp.sdb.DirectSQLDialog") + IMPLEMENT_SERVICE_INFO_SUPPORTS(ODirectSQLDialog) + IMPLEMENT_SERVICE_INFO_GETSUPPORTED1_STATIC(ODirectSQLDialog, SERVICE_SDB_DIRECTSQLDIALOG.ascii) + + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > + SAL_CALL ODirectSQLDialog::Create(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB) + { + return static_cast< XServiceInfo* >(new ODirectSQLDialog( comphelper::getComponentContext(_rxORB))); + } //--------------------------------------------------------------------- IMPLEMENT_PROPERTYCONTAINER_DEFAULTS( ODirectSQLDialog ) @@ -86,7 +95,7 @@ DBG_NAME(ODirectSQLDialog) try { // the connection the row set is working with - ODatasourceConnector aDSConnector(m_aContext.getUNOContext(), _pParent); + ODatasourceConnector aDSConnector(m_aContext, _pParent); xConnection = aDSConnector.connect( m_sInitialSelection, NULL ); } catch( const Exception& ) diff --git a/dbaccess/source/ui/uno/unoDirectSql.hxx b/dbaccess/source/ui/uno/unoDirectSql.hxx index a32c1f48cbd9..54c614489293 100644 --- a/dbaccess/source/ui/uno/unoDirectSql.hxx +++ b/dbaccess/source/ui/uno/unoDirectSql.hxx @@ -48,7 +48,7 @@ namespace dbaui ::rtl::OUString m_sInitialSelection; ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > m_xActiveConnection; protected: - ODirectSQLDialog(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB); + ODirectSQLDialog(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxORB); virtual ~ODirectSQLDialog(); public: diff --git a/dbaccess/source/ui/uno/unoadmin.cxx b/dbaccess/source/ui/uno/unoadmin.cxx index 1d9a918db48e..4fb61913e609 100644 --- a/dbaccess/source/ui/uno/unoadmin.cxx +++ b/dbaccess/source/ui/uno/unoadmin.cxx @@ -51,7 +51,7 @@ namespace dbaui //========================================================================= DBG_NAME(ODatabaseAdministrationDialog) //------------------------------------------------------------------------- -ODatabaseAdministrationDialog::ODatabaseAdministrationDialog(const Reference< XMultiServiceFactory >& _rxORB) +ODatabaseAdministrationDialog::ODatabaseAdministrationDialog(const Reference< XComponentContext >& _rxORB) :ODatabaseAdministrationDialogBase(_rxORB) ,m_pDatasourceItems(NULL) ,m_pItemPool(NULL) @@ -60,7 +60,7 @@ ODatabaseAdministrationDialog::ODatabaseAdministrationDialog(const Reference< XM { DBG_CTOR(ODatabaseAdministrationDialog,NULL); - m_pCollection = new ::dbaccess::ODsnTypeCollection(comphelper::getComponentContext(_rxORB)); + m_pCollection = new ::dbaccess::ODsnTypeCollection(_rxORB); ODbAdminDialog::createItemSet(m_pDatasourceItems, m_pItemPool, m_pItemPoolDefaults, m_pCollection); } diff --git a/dbaccess/source/ui/uno/unosqlmessage.cxx b/dbaccess/source/ui/uno/unosqlmessage.cxx index d40473076f44..94ceda731275 100644 --- a/dbaccess/source/ui/uno/unosqlmessage.cxx +++ b/dbaccess/source/ui/uno/unosqlmessage.cxx @@ -22,6 +22,7 @@ #include "unosqlmessage.hxx" #include "dbu_reghelper.hxx" #include "dbustrings.hrc" +#include <comphelper/processfactory.hxx> #include <cppuhelper/typeprovider.hxx> #include <connectivity/dbexception.hxx> @@ -47,7 +48,7 @@ namespace dbaui //========================================================================= //------------------------------------------------------------------------- -OSQLMessageDialog::OSQLMessageDialog(const Reference< XMultiServiceFactory >& _rxORB) +OSQLMessageDialog::OSQLMessageDialog(const Reference< XComponentContext >& _rxORB) :OSQLMessageDialogBase(_rxORB) { registerMayBeVoidProperty(PROPERTY_SQLEXCEPTION, PROPERTY_ID_SQLEXCEPTION, PropertyAttribute::TRANSIENT | PropertyAttribute::MAYBEVOID, @@ -66,7 +67,7 @@ Sequence<sal_Int8> SAL_CALL OSQLMessageDialog::getImplementationId( ) throw(Run //------------------------------------------------------------------------- Reference< XInterface > SAL_CALL OSQLMessageDialog::Create(const Reference< XMultiServiceFactory >& _rxFactory) { - return *(new OSQLMessageDialog(_rxFactory)); + return *(new OSQLMessageDialog( comphelper::getComponentContext(_rxFactory) )); } //------------------------------------------------------------------------- |