diff options
Diffstat (limited to 'dbaccess/source')
-rw-r--r-- | dbaccess/source/core/api/RowSet.cxx | 5 | ||||
-rw-r--r-- | dbaccess/source/core/dataaccess/databasecontext.hxx | 12 | ||||
-rw-r--r-- | dbaccess/source/core/dataaccess/databasedocument.cxx | 4 | ||||
-rw-r--r-- | dbaccess/source/core/dataaccess/datasource.cxx | 4 | ||||
-rw-r--r-- | dbaccess/source/filter/xml/dbloader2.cxx | 5 | ||||
-rw-r--r-- | dbaccess/source/ui/browser/genericcontroller.cxx | 3 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/DbAdminImpl.cxx | 4 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/dbwizsetup.cxx | 5 | ||||
-rw-r--r-- | dbaccess/source/ui/inc/UITools.hxx | 5 | ||||
-rw-r--r-- | dbaccess/source/ui/misc/TokenWriter.cxx | 3 | ||||
-rw-r--r-- | dbaccess/source/ui/misc/UITools.cxx | 33 | ||||
-rw-r--r-- | dbaccess/source/ui/misc/WCopyTable.cxx | 3 | ||||
-rw-r--r-- | dbaccess/source/ui/querydesign/querycontroller.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/relationdesign/RelationController.cxx | 3 | ||||
-rw-r--r-- | dbaccess/source/ui/tabledesign/TableController.cxx | 3 | ||||
-rw-r--r-- | dbaccess/source/ui/uno/copytablewizard.cxx | 5 |
16 files changed, 52 insertions, 47 deletions
diff --git a/dbaccess/source/core/api/RowSet.cxx b/dbaccess/source/core/api/RowSet.cxx index e8bc7740cd2b..c4ac4ef2f09b 100644 --- a/dbaccess/source/core/api/RowSet.cxx +++ b/dbaccess/source/core/api/RowSet.cxx @@ -34,6 +34,7 @@ #include <com/sun/star/container/XChild.hpp> #include <com/sun/star/lang/DisposedException.hpp> #include <com/sun/star/sdb/CommandType.hpp> +#include <com/sun/star/sdb/DatabaseContext.hpp> #include <com/sun/star/sdb/ErrorCondition.hpp> #include <com/sun/star/sdb/RowChangeAction.hpp> #include <com/sun/star/sdb/RowSetVetoException.hpp> @@ -2154,9 +2155,7 @@ Reference< XConnection > ORowSet::calcConnection(const Reference< XInteractionH Reference< XConnection > xNewConn; if ( !m_aDataSourceName.isEmpty() ) { - Reference< XNameAccess > xDatabaseContext( - m_aContext.createComponent( (::rtl::OUString)SERVICE_SDB_DATABASECONTEXT ), - UNO_QUERY_THROW ); + Reference< XNameAccess > xDatabaseContext( DatabaseContext::create(m_aContext.getUNOContext()), UNO_QUERY_THROW ); try { Reference< XDataSource > xDataSource( xDatabaseContext->getByName( m_aDataSourceName ), UNO_QUERY_THROW ); diff --git a/dbaccess/source/core/dataaccess/databasecontext.hxx b/dbaccess/source/core/dataaccess/databasecontext.hxx index 83b0195b096a..6e4342597032 100644 --- a/dbaccess/source/core/dataaccess/databasecontext.hxx +++ b/dbaccess/source/core/dataaccess/databasecontext.hxx @@ -31,6 +31,7 @@ #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/lang/XSingleServiceFactory.hpp> #include <com/sun/star/lang/XUnoTunnel.hpp> +#include <com/sun/star/sdb/XDatabaseContext.hpp> #include <com/sun/star/sdb/XDatabaseEnvironment.hpp> #include <com/sun/star/sdb/XDatabaseRegistrations.hpp> #include <com/sun/star/uno/XNamingService.hpp> @@ -39,7 +40,7 @@ #include <basic/basicmanagerrepository.hxx> #include <comphelper/componentcontext.hxx> #include <comphelper/stl_types.hxx> -#include <cppuhelper/compbase8.hxx> +#include <cppuhelper/compbase3.hxx> #include <cppuhelper/interfacecontainer.hxx> #include <boost/shared_ptr.hpp> @@ -64,14 +65,9 @@ class DatabaseDocumentLoader; ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > ODatabaseContext_CreateInstance(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >&); -typedef ::cppu::WeakComponentImplHelper8 < ::com::sun::star::lang::XServiceInfo - , ::com::sun::star::container::XEnumerationAccess - , ::com::sun::star::container::XNameAccess - , ::com::sun::star::uno::XNamingService - , ::com::sun::star::container::XContainer - , ::com::sun::star::lang::XSingleServiceFactory +typedef ::cppu::WeakComponentImplHelper3 < ::com::sun::star::lang::XServiceInfo + , ::com::sun::star::sdb::XDatabaseContext , ::com::sun::star::lang::XUnoTunnel - , ::com::sun::star::sdb::XDatabaseRegistrations > DatabaseAccessContext_Base; class ODatabaseContext :public DatabaseAccessContext_Base diff --git a/dbaccess/source/core/dataaccess/databasedocument.cxx b/dbaccess/source/core/dataaccess/databasedocument.cxx index 9b49dc4c62ba..83435d826e2c 100644 --- a/dbaccess/source/core/dataaccess/databasedocument.cxx +++ b/dbaccess/source/core/dataaccess/databasedocument.cxx @@ -53,6 +53,7 @@ #include <com/sun/star/view/XSelectionSupplier.hpp> #include <com/sun/star/xml/sax/XDocumentHandler.hpp> #include <com/sun/star/ucb/XContent.hpp> +#include <com/sun/star/sdb/DatabaseContext.hpp> #include <com/sun/star/sdb/application/XDatabaseDocumentUI.hpp> #include <com/sun/star/script/XStorageBasedLibraryContainer.hpp> @@ -101,6 +102,7 @@ using namespace ::com::sun::star::util; using namespace ::com::sun::star::embed; using namespace ::com::sun::star::task; using namespace ::com::sun::star::view; +using namespace ::com::sun::star::sdb; using namespace ::com::sun::star::sdbc; using namespace ::com::sun::star; using namespace ::com::sun::star::xml::sax; @@ -1868,7 +1870,7 @@ Sequence< ::rtl::OUString > ODatabaseDocument::getSupportedServiceNames( ) thro Reference< XInterface > ODatabaseDocument::Create( const Reference< XComponentContext >& _rxContext ) { ::comphelper::ComponentContext aContext( _rxContext ); - Reference< XUnoTunnel > xDBContextTunnel( aContext.createComponent( (::rtl::OUString)SERVICE_SDB_DATABASECONTEXT ), UNO_QUERY_THROW ); + 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 ) ); diff --git a/dbaccess/source/core/dataaccess/datasource.cxx b/dbaccess/source/core/dataaccess/datasource.cxx index 061d873ef0a7..a0480dfeb376 100644 --- a/dbaccess/source/core/dataaccess/datasource.cxx +++ b/dbaccess/source/core/dataaccess/datasource.cxx @@ -40,6 +40,7 @@ #include <com/sun/star/embed/XTransactedObject.hpp> #include <com/sun/star/lang/DisposedException.hpp> #include <com/sun/star/reflection/XProxyFactory.hpp> +#include <com/sun/star/sdb/DatabaseContext.hpp> #include <com/sun/star/sdbc/XDriverAccess.hpp> #include <com/sun/star/sdbc/XDriverManager.hpp> #include <com/sun/star/sdbcx/XTablesSupplier.hpp> @@ -600,8 +601,7 @@ Sequence< ::rtl::OUString > ODatabaseSource::getSupportedServiceNames( ) throw Reference< XInterface > ODatabaseSource::Create( const Reference< XComponentContext >& _rxContext ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "ODatabaseSource::Create" ); - ::comphelper::ComponentContext aContext( _rxContext ); - Reference< XSingleServiceFactory > xDBContext( aContext.createComponent( (::rtl::OUString)SERVICE_SDB_DATABASECONTEXT ), UNO_QUERY_THROW ); + Reference< XSingleServiceFactory > xDBContext( DatabaseContext::create(_rxContext), UNO_QUERY_THROW ); return xDBContext->createInstance(); } diff --git a/dbaccess/source/filter/xml/dbloader2.cxx b/dbaccess/source/filter/xml/dbloader2.cxx index bad3711e4ceb..6441d8d9f46e 100644 --- a/dbaccess/source/filter/xml/dbloader2.cxx +++ b/dbaccess/source/filter/xml/dbloader2.cxx @@ -40,6 +40,7 @@ #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/lang/XSingleServiceFactory.hpp> #include <com/sun/star/registry/XRegistryKey.hpp> +#include <com/sun/star/sdb/DatabaseContext.hpp> #include <com/sun/star/sdb/XDocumentDataSource.hpp> #include <com/sun/star/task/XJobExecutor.hpp> #include <com/sun/star/ui/dialogs/XExecutableDialog.hpp> @@ -445,9 +446,7 @@ void SAL_CALL DBContentLoader::load(const Reference< XFrame > & rFrame, const :: sal_Int32 nInitialSelection = -1; if ( !xModel.is() ) { - Reference< XSingleServiceFactory > xDatabaseContext; - if ( !m_aContext.createComponent( (::rtl::OUString)SERVICE_SDB_DATABASECONTEXT, xDatabaseContext ) ) - throw RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "css.sdb.DatabaseContext not available" ) ), NULL ); + Reference< XSingleServiceFactory > xDatabaseContext( DatabaseContext::create(m_aContext.getUNOContext()), UNO_QUERY_THROW ); ::rtl::OUString sFactoryName = SvtModuleOptions().GetFactoryEmptyDocumentURL(SvtModuleOptions::E_DATABASE); bCreateNew = sFactoryName.match(_rURL); diff --git a/dbaccess/source/ui/browser/genericcontroller.cxx b/dbaccess/source/ui/browser/genericcontroller.cxx index cb8d8b947bb2..ed7fadf037f8 100644 --- a/dbaccess/source/ui/browser/genericcontroller.cxx +++ b/dbaccess/source/ui/browser/genericcontroller.cxx @@ -34,6 +34,7 @@ #include <comphelper/sequence.hxx> #include <comphelper/extract.hxx> #include <com/sun/star/sdbc/XDataSource.hpp> +#include <com/sun/star/sdb/DatabaseContext.hpp> #include <com/sun/star/sdb/SQLContext.hpp> #include <com/sun/star/sdb/XCompletedConnection.hpp> #include <com/sun/star/beans/XPropertySet.hpp> @@ -255,7 +256,7 @@ sal_Bool OGenericUnoController::Construct(Window* /*pParent*/) OSL_ENSURE(getORB().is(), "OGenericUnoController::Construct need a service factory!"); try { - m_xDatabaseContext = Reference< XNameAccess >(getORB()->createInstance(SERVICE_SDB_DATABASECONTEXT), UNO_QUERY); + m_xDatabaseContext = Reference< XNameAccess >( DatabaseContext::create(comphelper::ComponentContext(getORB()).getUNOContext()), UNO_QUERY_THROW ); } catch(Exception&) { diff --git a/dbaccess/source/ui/dlg/DbAdminImpl.cxx b/dbaccess/source/ui/dlg/DbAdminImpl.cxx index a0d53c47c5d5..da713f32d1d6 100644 --- a/dbaccess/source/ui/dlg/DbAdminImpl.cxx +++ b/dbaccess/source/ui/dlg/DbAdminImpl.cxx @@ -41,6 +41,7 @@ #include <com/sun/star/beans/PropertyAttribute.hpp> #include <com/sun/star/frame/XStorable.hpp> +#include <com/sun/star/sdb/DatabaseContext.hpp> #include <com/sun/star/sdb/SQLContext.hpp> #include <com/sun/star/sdbc/XDriver.hpp> #include <com/sun/star/sdbc/XDriverAccess.hpp> @@ -49,6 +50,7 @@ #include <com/sun/star/ucb/XInteractionSupplyAuthentication2.hpp> #include <com/sun/star/ucb/AuthenticationRequest.hpp> +#include <comphelper/componentcontext.hxx> #include <comphelper/guarding.hxx> #include <comphelper/interaction.hxx> #include <comphelper/property.hxx> @@ -206,7 +208,7 @@ ODbDataSourceAdministrationHelper::ODbDataSourceAdministrationHelper(const Refer try { - m_xDatabaseContext = Reference< XNameAccess >(m_xORB->createInstance(SERVICE_SDB_DATABASECONTEXT), UNO_QUERY); + m_xDatabaseContext = Reference< XNameAccess >( DatabaseContext::create(comphelper::ComponentContext(m_xORB).getUNOContext()), UNO_QUERY_THROW ); m_xDynamicContext.set(m_xDatabaseContext,UNO_QUERY); } catch(Exception&) diff --git a/dbaccess/source/ui/dlg/dbwizsetup.cxx b/dbaccess/source/ui/dlg/dbwizsetup.cxx index 274c81353e90..664879d7807f 100644 --- a/dbaccess/source/ui/dlg/dbwizsetup.cxx +++ b/dbaccess/source/ui/dlg/dbwizsetup.cxx @@ -54,6 +54,7 @@ #include <com/sun/star/sdbcx/XTablesSupplier.hpp> #include <com/sun/star/sdbc/XDataSource.hpp> #include <com/sun/star/container/XNameAccess.hpp> +#include <com/sun/star/sdb/DatabaseContext.hpp> #include <com/sun/star/sdb/XDocumentDataSource.hpp> #include <com/sun/star/frame/FrameSearchFlag.hpp> #include <com/sun/star/frame/XComponentLoader.hpp> @@ -858,8 +859,8 @@ sal_Bool ODbTypeWizDialogSetup::SaveDatabaseDocument() void ODbTypeWizDialogSetup::RegisterDataSourceByLocation(const ::rtl::OUString& _sPath) { Reference< XPropertySet > xDatasource = m_pImpl->getCurrentDataSource(); - Reference< XNamingService > xDatabaseContext(getORB()->createInstance(SERVICE_SDB_DATABASECONTEXT), UNO_QUERY); - Reference< XNameAccess > xNameAccessDatabaseContext(xDatabaseContext, UNO_QUERY); + Reference< XNamingService > xDatabaseContext( DatabaseContext::create(comphelper::ComponentContext(getORB()).getUNOContext()), UNO_QUERY_THROW ); + Reference< XNameAccess > xNameAccessDatabaseContext(xDatabaseContext, UNO_QUERY_THROW ); INetURLObject aURL( _sPath ); ::rtl::OUString sFilename = aURL.getBase( INetURLObject::LAST_SEGMENT, true, INetURLObject::DECODE_WITH_CHARSET ); ::rtl::OUString sDatabaseName = ::dbtools::createUniqueName(xNameAccessDatabaseContext, sFilename,sal_False); diff --git a/dbaccess/source/ui/inc/UITools.hxx b/dbaccess/source/ui/inc/UITools.hxx index 4abcb5920866..574b3ad231e7 100644 --- a/dbaccess/source/ui/inc/UITools.hxx +++ b/dbaccess/source/ui/inc/UITools.hxx @@ -57,6 +57,7 @@ namespace com { namespace sun { namespace star { class XNumberFormatter; } namespace ucb { class XContent; } + namespace uno { class XComponentContext; } }}} @@ -138,7 +139,7 @@ namespace dbaui /** checks if the given name exists in the database context */ sal_Bool checkDataSourceAvailable( const ::rtl::OUString& _sDataSourceName, - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _xFactory_xORB); + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext); /** maps SvxCellHorJustify to com::sun::star::awt::TextAlign @param SvxCellHorJustify& _eAlignment @@ -215,7 +216,7 @@ namespace dbaui */ sal_Bool appendToFilter(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& _xConnection, const ::rtl::OUString& _sName, - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _xFactory, + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext, Window* _pParent); /** notifySystemWindow adds or remove the given window _pToRegister at the Systemwindow found when search _pWindow. diff --git a/dbaccess/source/ui/misc/TokenWriter.cxx b/dbaccess/source/ui/misc/TokenWriter.cxx index 36c922cdc180..9c30b73dbf91 100644 --- a/dbaccess/source/ui/misc/TokenWriter.cxx +++ b/dbaccess/source/ui/misc/TokenWriter.cxx @@ -29,6 +29,7 @@ #include <comphelper/string.hxx> #include <comphelper/types.hxx> #include <connectivity/dbtools.hxx> +#include <com/sun/star/sdb/DatabaseContext.hpp> #include <com/sun/star/sdbc/XConnection.hpp> #include <com/sun/star/sdbcx/XColumnsSupplier.hpp> #include <com/sun/star/sdbc/XResultSetMetaDataSupplier.hpp> @@ -276,7 +277,7 @@ void ODatabaseImportExport::initialize() if ( !m_xConnection.is() ) { // we need a connection OSL_ENSURE(!m_sDataSourceName.isEmpty(),"There must be a datsource name!"); - Reference<XNameAccess> xDatabaseContext = Reference< XNameAccess >(m_xFactory->createInstance(SERVICE_SDB_DATABASECONTEXT), UNO_QUERY); + Reference<XNameAccess> xDatabaseContext( DatabaseContext::create(comphelper::ComponentContext(m_xFactory).getUNOContext()), UNO_QUERY_THROW); Reference< XEventListener> xEvt((::cppu::OWeakObject*)this,UNO_QUERY); Reference< XConnection > xConnection; diff --git a/dbaccess/source/ui/misc/UITools.cxx b/dbaccess/source/ui/misc/UITools.cxx index 4131abc204e0..0ac020f5e792 100644 --- a/dbaccess/source/ui/misc/UITools.cxx +++ b/dbaccess/source/ui/misc/UITools.cxx @@ -27,6 +27,7 @@ #include "dbtreelistbox.hxx" #include "defaultobjectnamecheck.hxx" #include <comphelper/extract.hxx> +#include <com/sun/star/sdb/DatabaseContext.hpp> #include <com/sun/star/sdb/XSingleSelectQueryAnalyzer.hpp> #include <com/sun/star/sdb/XCompletedConnection.hpp> #include <com/sun/star/sdbc/XDataSource.hpp> @@ -223,7 +224,7 @@ Reference< XDataSource > getDataSourceByName( const ::rtl::OUString& _rDataSourc Window* _pErrorMessageParent, Reference< XMultiServiceFactory > _rxORB, ::dbtools::SQLExceptionInfo* _pErrorInfo ) { ::comphelper::ComponentContext aContext( _rxORB ); - Reference< XNameAccess > xDatabaseContext( aContext.createComponent( "com.sun.star.sdb.DatabaseContext" ), UNO_QUERY_THROW ); + Reference< XDatabaseContext > xDatabaseContext = DatabaseContext::create(aContext.getUNOContext()); Reference< XDataSource > xDatasource; Any aError; @@ -722,22 +723,18 @@ void setColumnProperties(const Reference<XPropertySet>& _rxColumn,const OFieldDe return sDefaultName; } // ----------------------------------------------------------------------------- -sal_Bool checkDataSourceAvailable(const ::rtl::OUString& _sDataSourceName,const Reference< ::com::sun::star::lang::XMultiServiceFactory >& _xORB) +sal_Bool checkDataSourceAvailable(const ::rtl::OUString& _sDataSourceName,const Reference< ::com::sun::star::uno::XComponentContext >& _xContext) { - sal_Bool bRet = sal_False; - Reference< XNameAccess > xDataBaseContext(_xORB->createInstance(SERVICE_SDB_DATABASECONTEXT), UNO_QUERY); - if ( xDataBaseContext.is() ) - { - bRet = xDataBaseContext->hasByName(_sDataSourceName); - if ( !bRet ) - { // try if this one is a URL - try - { - bRet = xDataBaseContext->getByName(_sDataSourceName).hasValue(); - } - catch(const Exception&) - { - } + Reference< XDatabaseContext > xDataBaseContext = DatabaseContext::create(_xContext); + sal_Bool bRet = xDataBaseContext->hasByName(_sDataSourceName); + if ( !bRet ) + { // try if this one is a URL + try + { + bRet = xDataBaseContext->getByName(_sDataSourceName).hasValue(); + } + catch(const Exception&) + { } } return bRet; @@ -1019,7 +1016,7 @@ const SfxFilter* getStandardDatabaseFilter() // ----------------------------------------------------------------------------- sal_Bool appendToFilter(const Reference<XConnection>& _xConnection, const ::rtl::OUString& _sName, - const Reference< XMultiServiceFactory >& _xFactory, + const Reference< XComponentContext >& _rxContext, Window* _pParent) { sal_Bool bRet = sal_False; @@ -1050,7 +1047,7 @@ sal_Bool appendToFilter(const Reference<XConnection>& _xConnection, bRet = sal_True; if(bHasToInsert) { - if(! ::dbaui::checkDataSourceAvailable(::comphelper::getString(xProp->getPropertyValue(PROPERTY_NAME)),_xFactory)) + if(! ::dbaui::checkDataSourceAvailable(::comphelper::getString(xProp->getPropertyValue(PROPERTY_NAME)),_rxContext)) { String aMessage(ModuleRes(STR_TABLEDESIGN_DATASOURCE_DELETED)); OSQLWarningBox( _pParent, aMessage ).Execute(); diff --git a/dbaccess/source/ui/misc/WCopyTable.cxx b/dbaccess/source/ui/misc/WCopyTable.cxx index 782eb3cb9f3f..e7e0ae95ccdf 100644 --- a/dbaccess/source/ui/misc/WCopyTable.cxx +++ b/dbaccess/source/ui/misc/WCopyTable.cxx @@ -46,6 +46,7 @@ #include <com/sun/star/sdbcx/XViewsSupplier.hpp> #include <com/sun/star/sdbc/XResultSetMetaDataSupplier.hpp> +#include <comphelper/componentcontext.hxx> #include <comphelper/extract.hxx> #include <comphelper/types.hxx> #include <comphelper/interaction.hxx> @@ -1337,7 +1338,7 @@ Reference< XPropertySet > OCopyTableWizard::createTable() { xSuppDestinationColumns.set( xTable, UNO_QUERY_THROW ); // insert new table name into table filter - ::dbaui::appendToFilter( m_xDestConnection, m_sName, GetFactory(), this ); + ::dbaui::appendToFilter( m_xDestConnection, m_sName, comphelper::ComponentContext(GetFactory()).getUNOContext(), this ); // copy ui settings m_rSourceObject.copyUISettingsTo( xTable ); diff --git a/dbaccess/source/ui/querydesign/querycontroller.cxx b/dbaccess/source/ui/querydesign/querycontroller.cxx index 7ae234877f80..6d46ff69c348 100644 --- a/dbaccess/source/ui/querydesign/querycontroller.cxx +++ b/dbaccess/source/ui/querydesign/querycontroller.cxx @@ -1534,7 +1534,7 @@ bool OQueryController::doSaveAsDoc(sal_Bool _bSaveAs) m_xAlterView.set( xElements->getByName( m_sName ), UNO_QUERY ); // now check if our datasource has set a tablefilter and if so, append the new table name to it - ::dbaui::appendToFilter( getConnection(), m_sName, getORB(), getView() ); + ::dbaui::appendToFilter( getConnection(), m_sName, comphelper::ComponentContext(getORB()).getUNOContext(), getView() ); } Reference< XTitleChangeListener> xEventListener(impl_getTitleHelper_throw(),UNO_QUERY); if ( xEventListener.is() ) diff --git a/dbaccess/source/ui/relationdesign/RelationController.cxx b/dbaccess/source/ui/relationdesign/RelationController.cxx index ec23a4ba830b..8a72e9082919 100644 --- a/dbaccess/source/ui/relationdesign/RelationController.cxx +++ b/dbaccess/source/ui/relationdesign/RelationController.cxx @@ -26,6 +26,7 @@ #include "dbustrings.hrc" #include <connectivity/dbtools.hxx> #include <com/sun/star/frame/FrameSearchFlag.hpp> +#include <comphelper/componentcontext.hxx> #include <comphelper/extract.hxx> #include <com/sun/star/container/XChild.hpp> #include <com/sun/star/container/XNameContainer.hpp> @@ -160,7 +161,7 @@ void ORelationController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue case ID_BROWSER_SAVEDOC: { OSL_ENSURE(isEditable(),"Slot ID_BROWSER_SAVEDOC should not be enabled!"); - if(!::dbaui::checkDataSourceAvailable(::comphelper::getString(getDataSource()->getPropertyValue(PROPERTY_NAME)),getORB())) + if(!::dbaui::checkDataSourceAvailable(::comphelper::getString(getDataSource()->getPropertyValue(PROPERTY_NAME)), comphelper::ComponentContext(getORB()).getUNOContext())) { String aMessage(ModuleRes(STR_DATASOURCE_DELETED)); OSQLWarningBox( getView(), aMessage ).Execute(); diff --git a/dbaccess/source/ui/tabledesign/TableController.cxx b/dbaccess/source/ui/tabledesign/TableController.cxx index e86d6f1bc933..f7b969f09378 100644 --- a/dbaccess/source/ui/tabledesign/TableController.cxx +++ b/dbaccess/source/ui/tabledesign/TableController.cxx @@ -56,6 +56,7 @@ #include <com/sun/star/sdbcx/XTablesSupplier.hpp> #include <com/sun/star/ui/dialogs/XExecutableDialog.hpp> +#include <comphelper/componentcontext.hxx> #include <comphelper/extract.hxx> #include <comphelper/streamsection.hxx> #include <comphelper/types.hxx> @@ -405,7 +406,7 @@ sal_Bool OTableController::doSaveDoc(sal_Bool _bSaveAs) assignTable(); } // now check if our datasource has set a tablefilter and if append the new table name to it - ::dbaui::appendToFilter(getConnection(),m_sName,getORB(),getView()); // we are not interessted in the return value + ::dbaui::appendToFilter(getConnection(),m_sName,comphelper::ComponentContext(getORB()).getUNOContext(),getView()); // we are not interessted in the return value Reference< frame::XTitleChangeListener> xEventListener(impl_getTitleHelper_throw(),UNO_QUERY); if ( xEventListener.is() ) { diff --git a/dbaccess/source/ui/uno/copytablewizard.cxx b/dbaccess/source/ui/uno/copytablewizard.cxx index ea9ceb80b9f3..820569a903af 100644 --- a/dbaccess/source/ui/uno/copytablewizard.cxx +++ b/dbaccess/source/ui/uno/copytablewizard.cxx @@ -37,6 +37,7 @@ #include <com/sun/star/container/XChild.hpp> #include <com/sun/star/task/XInteractionHandler.hpp> #include <com/sun/star/frame/XModel.hpp> +#include <com/sun/star/sdb/DatabaseContext.hpp> #include <com/sun/star/sdb/XDocumentDataSource.hpp> #include <com/sun/star/sdb/XCompletedConnection.hpp> #include <com/sun/star/sdb/CommandType.hpp> @@ -103,6 +104,8 @@ namespace dbaui using ::com::sun::star::container::XChild; using ::com::sun::star::task::XInteractionHandler; using ::com::sun::star::frame::XModel; + using ::com::sun::star::sdb::DatabaseContext; + using ::com::sun::star::sdb::XDatabaseContext; using ::com::sun::star::sdb::XDocumentDataSource; using ::com::sun::star::sdb::XCompletedConnection; using ::com::sun::star::lang::WrappedTargetException; @@ -911,7 +914,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< XNameAccess > xDatabaseContext( m_aContext.createComponent( "com.sun.star.sdb.DatabaseContext" ), UNO_QUERY_THROW ); + Reference< XDatabaseContext > xDatabaseContext = DatabaseContext::create( m_aContext.getUNOContext() ); Reference< XDataSource > xDataSource; if ( !sDataSource.isEmpty() ) xDataSource.set( xDatabaseContext->getByName( sDataSource ), UNO_QUERY_THROW ); |