diff options
author | Noel Grandin <noel@peralex.com> | 2013-01-07 17:46:55 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-01-15 09:56:00 +0200 |
commit | 92f14ced5e6f613772792d863a8c2cfeddfdae04 (patch) | |
tree | 320db909a032db6c3527eab2cce56ea5f84f6028 /dbaccess | |
parent | e7018375cdf0e5e542631df9dee6023ff80b7840 (diff) |
fdo#46808, Adapt frame::TaskCreator UNO service to new style
The service already existed, it just did not have an IDL file.
Change-Id: I157c53d09b612da0178432100b8928013f811706
Diffstat (limited to 'dbaccess')
37 files changed, 141 insertions, 137 deletions
diff --git a/dbaccess/inc/dbsubcomponentcontroller.hxx b/dbaccess/inc/dbsubcomponentcontroller.hxx index d397974f7cf5..b709458d03da 100644 --- a/dbaccess/inc/dbsubcomponentcontroller.hxx +++ b/dbaccess/inc/dbsubcomponentcontroller.hxx @@ -163,7 +163,7 @@ namespace dbaui virtual ::rtl::OUString SAL_CALL getTitle( ) throw (::com::sun::star::uno::RuntimeException); protected: - DBSubComponentController(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxORB); + DBSubComponentController(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext>& _rxORB); virtual ~DBSubComponentController(); virtual void disconnect(); diff --git a/dbaccess/inc/genericcontroller.hxx b/dbaccess/inc/genericcontroller.hxx index ddcb323e97ce..e2da361b27de 100644 --- a/dbaccess/inc/genericcontroller.hxx +++ b/dbaccess/inc/genericcontroller.hxx @@ -42,7 +42,6 @@ #include <com/sun/star/uno/XComponentContext.hpp> #include <com/sun/star/util/XModifyListener.hpp> #include <com/sun/star/util/XURLTransformer.hpp> -#include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/awt/XUserInputInterception.hpp> #include <comphelper/broadcasthelper.hxx> @@ -238,7 +237,7 @@ namespace dbaui OAsyncronousLink m_aAsyncCloseTask; // called when a task shoud be closed ::com::sun::star::uno::Reference< ::com::sun::star::util::XURLTransformer > m_xUrlTransformer; // needed sometimes - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceFactory; + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext; ControllerFrame m_aCurrentFrame; ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider > m_xSlaveDispatcher; // for intercepting dispatches ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider > m_xMasterDispatcher; // dito @@ -260,7 +259,7 @@ namespace dbaui // ---------------------------------------------------------------- // methods - OGenericUnoController( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rM ); + OGenericUnoController( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rM ); const ::comphelper::NamedValueCollection& getInitParams() const { return m_aInitParameters; } @@ -401,7 +400,7 @@ namespace dbaui DECL_LINK(OnAsyncCloseTask, void*); public: - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > getORB() const { return m_xServiceFactory; } + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > getORB() const { return m_xContext; } ODataView* getView() const { return m_pView; } void setView( ODataView& i_rView ) { m_pView = &i_rView; } void clearView() { m_pView = NULL; } diff --git a/dbaccess/source/ui/app/AppController.cxx b/dbaccess/source/ui/app/AppController.cxx index 1ddb0ebe061b..cc9622490766 100644 --- a/dbaccess/source/ui/app/AppController.cxx +++ b/dbaccess/source/ui/app/AppController.cxx @@ -189,7 +189,7 @@ Sequence< ::rtl::OUString> SAL_CALL OApplicationController::getSupportedServiceN // ------------------------------------------------------------------------- Reference< XInterface > SAL_CALL OApplicationController::Create(const Reference<XMultiServiceFactory >& _rxFactory) { - return *(new OApplicationController(_rxFactory)); + return *(new OApplicationController( comphelper::getComponentContext(_rxFactory))); } // ----------------------------------------------------------------------------- @@ -297,11 +297,11 @@ private: //==================================================================== DBG_NAME(OApplicationController) //-------------------------------------------------------------------- -OApplicationController::OApplicationController(const Reference< XMultiServiceFactory >& _rxORB) +OApplicationController::OApplicationController(const Reference< XComponentContext >& _rxORB) :OApplicationController_CBASE( _rxORB ) ,m_aContextMenuInterceptors( getMutex() ) ,m_pSubComponentManager( new SubComponentManager( *this, getSharedMutex() ) ) - ,m_aTypeCollection( comphelper::getComponentContext(_rxORB) ) + ,m_aTypeCollection( _rxORB ) ,m_aTableCopyHelper(this) ,m_pClipbordNotifier(NULL) ,m_nAsyncDrop(0) @@ -444,7 +444,7 @@ void SAL_CALL OApplicationController::disposing() //-------------------------------------------------------------------- sal_Bool OApplicationController::Construct(Window* _pParent) { - setView( * new OApplicationView( _pParent, comphelper::getComponentContext(getORB()), *this, m_ePreviewMode ) ); + setView( * new OApplicationView( _pParent, getORB(), *this, m_ePreviewMode ) ); getView()->SetUniqueId(UID_APP_VIEW); // late construction @@ -656,11 +656,11 @@ FeatureState OApplicationController::GetState(sal_uInt16 _nId) const && SvtModuleOptions().IsModuleInstalled(SvtModuleOptions::E_SWRITER); if ( aReturn.bEnabled ) { - Reference< XContentEnumerationAccess > xEnumAccess(m_xServiceFactory, UNO_QUERY); + Reference< XContentEnumerationAccess > xEnumAccess(m_xContext->getServiceManager(), UNO_QUERY); aReturn.bEnabled = xEnumAccess.is(); if ( aReturn.bEnabled ) { - const ::rtl::OUString sReportEngineServiceName = ::dbtools::getDefaultReportEngineServiceName(comphelper::getComponentContext(m_xServiceFactory)); + const ::rtl::OUString sReportEngineServiceName = ::dbtools::getDefaultReportEngineServiceName(m_xContext); aReturn.bEnabled = !sReportEngineServiceName.isEmpty(); if ( aReturn.bEnabled ) { @@ -742,7 +742,7 @@ FeatureState OApplicationController::GetState(sal_uInt16 _nId) const aReturn.bEnabled = eType == E_QUERY || eType == E_TABLE; if ( aReturn.bEnabled && SID_APP_NEW_REPORT_PRE_SEL == _nId ) { - Reference< XContentEnumerationAccess > xEnumAccess(m_xServiceFactory, UNO_QUERY); + Reference< XContentEnumerationAccess > xEnumAccess(m_xContext->getServiceManager(), UNO_QUERY); aReturn.bEnabled = xEnumAccess.is(); if ( aReturn.bEnabled ) { @@ -2130,7 +2130,7 @@ void OApplicationController::renameEntry() } pNameChecker.reset( new HierarchicalNameCheck( xHNames.get(), String() ) ); aDialog.reset( new OSaveAsDlg( - getView(), comphelper::getComponentContext(getORB()), sName, sLabel, *pNameChecker, SAD_TITLE_RENAME ) ); + getView(), getORB(), sName, sLabel, *pNameChecker, SAD_TITLE_RENAME ) ); } } } @@ -2149,7 +2149,7 @@ void OApplicationController::renameEntry() ensureConnection(); pNameChecker.reset( new DynamicTableOrQueryNameCheck( getConnection(), nCommandType ) ); aDialog.reset( new OSaveAsDlg( - getView(), nCommandType, comphelper::getComponentContext(getORB()), getConnection(), + getView(), nCommandType, getORB(), getConnection(), *aList.begin(), *pNameChecker, SAD_TITLE_RENAME ) ); } break; @@ -2689,7 +2689,7 @@ IMPL_LINK( OApplicationController, OnFirstControllerConnected, void*, /**/ ) aDetail.Message = String( ModuleRes( STR_SUB_DOCS_WITH_SCRIPTS_DETAIL ) ); aWarning.NextException <<= aDetail; - Reference< XExecutableDialog > xDialog = ErrorMessageDialog::create( ::comphelper::getComponentContext( getORB() ), "", NULL, makeAny( aWarning ) ); + Reference< XExecutableDialog > xDialog = ErrorMessageDialog::create( getORB(), "", NULL, makeAny( aWarning ) ); xDialog->execute(); } catch( const Exception& ) diff --git a/dbaccess/source/ui/app/AppController.hxx b/dbaccess/source/ui/app/AppController.hxx index 6cdb65c2cf29..6584ce395a01 100644 --- a/dbaccess/source/ui/app/AppController.hxx +++ b/dbaccess/source/ui/app/AppController.hxx @@ -424,7 +424,7 @@ namespace dbaui virtual ~OApplicationController(); public: - OApplicationController(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB); + OApplicationController(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxORB); DECLARE_XINTERFACE( ) DECLARE_XTYPEPROVIDER( ) diff --git a/dbaccess/source/ui/app/AppControllerDnD.cxx b/dbaccess/source/ui/app/AppControllerDnD.cxx index 588c195f4a92..19da30e36ae4 100644 --- a/dbaccess/source/ui/app/AppControllerDnD.cxx +++ b/dbaccess/source/ui/app/AppControllerDnD.cxx @@ -473,7 +473,7 @@ SAL_WNODEPRECATED_DECLARATIONS_PUSH } ::std::auto_ptr< OLinkedDocumentsAccess > pDocuments( new OLinkedDocumentsAccess( - getView(), this, comphelper::getComponentContext(getORB()), xDocContainer, xConnection, getDatabaseName() + getView(), this, getORB(), xDocContainer, xConnection, getDatabaseName() ) ); return pDocuments; } @@ -506,11 +506,11 @@ TransferableHelper* OApplicationController::copyObject() if ( eType == E_TABLE ) { - pData = new ODataClipboard(sDataSource, CommandType::TABLE, sName, xConnection, getNumberFormatter(xConnection, comphelper::getComponentContext(getORB())), getORB()); + pData = new ODataClipboard(sDataSource, CommandType::TABLE, sName, xConnection, getNumberFormatter(xConnection, getORB()), getORB()); } else { - pData = new ODataClipboard(sDataSource, CommandType::QUERY, sName, getNumberFormatter(xConnection, comphelper::getComponentContext(getORB())), getORB()); + pData = new ODataClipboard(sDataSource, CommandType::QUERY, sName, getNumberFormatter(xConnection, getORB()), getORB()); } } } @@ -610,7 +610,7 @@ sal_Bool OApplicationController::paste( ElementType _eType,const ::svx::ODataAcc { // the concrete query Reference< XQueryDefinitionsSupplier > xSourceQuerySup( - getDataSourceByName( sDataSourceName, getView(), comphelper::getComponentContext(getORB()), NULL ), + getDataSourceByName( sDataSourceName, getView(), getORB(), NULL ), UNO_QUERY_THROW ); Reference< XNameAccess > xQueries( xSourceQuerySup->getQueryDefinitions(), UNO_SET_THROW ); if ( xQueries->hasByName( sCommand ) ) @@ -657,7 +657,7 @@ sal_Bool OApplicationController::paste( ElementType _eType,const ::svx::ODataAcc { OSaveAsDlg aAskForName( getView(), CommandType::QUERY, - comphelper::getComponentContext(getORB()), + getORB(), getConnection(), sTargetName, aNameChecker, diff --git a/dbaccess/source/ui/app/AppControllerGen.cxx b/dbaccess/source/ui/app/AppControllerGen.cxx index 659ff0f9438b..901453269243 100644 --- a/dbaccess/source/ui/app/AppControllerGen.cxx +++ b/dbaccess/source/ui/app/AppControllerGen.cxx @@ -144,7 +144,7 @@ void OApplicationController::convertToView(const ::rtl::OUString& _sName) String aDefaultName = ::dbaui::createDefaultName(xMeta,xTables,aName); DynamicTableOrQueryNameCheck aNameChecker( xConnection, CommandType::TABLE ); - OSaveAsDlg aDlg( getView(), CommandType::TABLE, comphelper::getComponentContext(getORB()), xConnection, aDefaultName, aNameChecker ); + OSaveAsDlg aDlg( getView(), CommandType::TABLE, getORB(), xConnection, aDefaultName, aNameChecker ); if ( aDlg.Execute() == RET_OK ) { ::rtl::OUString sName = aDlg.getName(); @@ -244,7 +244,8 @@ void OApplicationController::openDialog( const ::rtl::OUString& _sServiceName ) // create the dialog Reference< XExecutableDialog > xAdminDialog; xAdminDialog = Reference< XExecutableDialog >( - getORB()->createInstanceWithArguments(_sServiceName,aArgs), UNO_QUERY); + getORB()->getServiceManager()->createInstanceWithArgumentsAndContext(_sServiceName, aArgs, getORB()), + UNO_QUERY); // execute it if (xAdminDialog.is()) @@ -449,7 +450,7 @@ void OApplicationController::impl_validateObjectTypeAndName_throw( const sal_Int // ensure we're connected if ( !isConnected() ) { - SQLError aError( comphelper::getComponentContext(getORB()) ); + SQLError aError( getORB() ); aError.raiseException( ErrorCondition::DB_NOT_CONNECTED, *this ); } @@ -667,7 +668,7 @@ sal_Bool OApplicationController::insertHierachyElement(ElementType _eType,const { Reference<XHierarchicalNameContainer> xNames(getElements(_eType), UNO_QUERY); return dbaui::insertHierachyElement(getView() - ,comphelper::getComponentContext(getORB()) + ,getORB() ,xNames ,_sParentFolder ,_eType == E_FORM diff --git a/dbaccess/source/ui/app/AppDetailPageHelper.cxx b/dbaccess/source/ui/app/AppDetailPageHelper.cxx index 3efb185b9832..dc7c2ebc1e10 100644 --- a/dbaccess/source/ui/app/AppDetailPageHelper.cxx +++ b/dbaccess/source/ui/app/AppDetailPageHelper.cxx @@ -1166,7 +1166,7 @@ void OAppDetailPageHelper::showPreview( const ::rtl::OUString& _sDataSourceName, Reference< XDatabaseDocumentUI > xApplication( getBorderWin().getView()->getAppController().getXController(), UNO_QUERY ); SAL_WNODEPRECATED_DECLARATIONS_PUSH ::std::auto_ptr< DatabaseObjectView > pDispatcher( new ResultSetBrowser( - uno::Reference<lang::XMultiServiceFactory>(getBorderWin().getView()->getORB()->getServiceManager(), uno::UNO_QUERY_THROW), + getBorderWin().getView()->getORB(), xApplication, NULL, _bTable ) ); SAL_WNODEPRECATED_DECLARATIONS_POP diff --git a/dbaccess/source/ui/browser/brwctrlr.cxx b/dbaccess/source/ui/browser/brwctrlr.cxx index f0bccc505f42..0fbfdeb4d8ac 100644 --- a/dbaccess/source/ui/browser/brwctrlr.cxx +++ b/dbaccess/source/ui/browser/brwctrlr.cxx @@ -609,7 +609,7 @@ Any SAL_CALL SbaXDataBrowserController::queryInterface(const Type& _rType) throw DBG_NAME(SbaXDataBrowserController) //------------------------------------------------------------------------------ -SbaXDataBrowserController::SbaXDataBrowserController(const Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rM) +SbaXDataBrowserController::SbaXDataBrowserController(const Reference< ::com::sun::star::uno::XComponentContext >& _rM) :SbaXDataBrowserController_Base(_rM) ,m_nRowSetPrivileges(0) ,m_pClipbordNotifier( NULL ) @@ -696,7 +696,7 @@ void SbaXDataBrowserController::onStartLoading( const Reference< XLoadable >& _r // ----------------------------------------------------------------------------- void SbaXDataBrowserController::impl_checkForCannotSelectUnfiltered( const SQLExceptionInfo& _rError ) { - ::connectivity::SQLError aError( comphelper::getComponentContext(getORB()) ); + ::connectivity::SQLError aError( getORB() ); ::connectivity::ErrorCode nErrorCode( aError.getErrorCode( ErrorCondition::DATA_CANNOT_SELECT_UNFILTERED ) ); if ( ((const SQLException*)_rError)->ErrorCode == nErrorCode ) { @@ -772,13 +772,13 @@ void SbaXDataBrowserController::initFormatter() RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaXDataBrowserController::initFormatter" ); // --------------------------------------------------------------- // create a formatter working with the connections format supplier - Reference< ::com::sun::star::util::XNumberFormatsSupplier > xSupplier(::dbtools::getNumberFormats(::dbtools::getConnection(m_xRowSet), sal_True, comphelper::getComponentContext(getORB()))); + Reference< ::com::sun::star::util::XNumberFormatsSupplier > xSupplier(::dbtools::getNumberFormats(::dbtools::getConnection(m_xRowSet), sal_True, getORB())); if(xSupplier.is()) { // create a new formatter m_xFormatter = Reference< util::XNumberFormatter > ( - util::NumberFormatter::create(comphelper::getComponentContext(getORB())), UNO_QUERY_THROW); + util::NumberFormatter::create(getORB()), UNO_QUERY_THROW); m_xFormatter->attachNumberFormatsSupplier(xSupplier); } else // clear the formatter @@ -848,7 +848,7 @@ sal_Bool SbaXDataBrowserController::Construct(Window* pParent) // --------------- // create the view - setView( * new UnoDataBrowserView( pParent, *this, comphelper::getComponentContext(getORB()) ) ); + setView( * new UnoDataBrowserView( pParent, *this, getORB() ) ); if (!getBrowserView()) return sal_False; @@ -949,14 +949,18 @@ void SbaXDataBrowserController::RemoveColumnListener(const Reference< XPropertyS Reference< XRowSet > SbaXDataBrowserController::CreateForm() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaXDataBrowserController::CreateForm" ); - return Reference< XRowSet > (getORB()->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.form.component.Form"))), UNO_QUERY); + return Reference< XRowSet > ( + getORB()->getServiceManager()->createInstanceWithContext("com.sun.star.form.component.Form", getORB()), + UNO_QUERY); } //------------------------------------------------------------------------------ Reference< ::com::sun::star::form::XFormComponent > SbaXDataBrowserController::CreateGridModel() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaXDataBrowserController::CreateGridModel" ); - return Reference< ::com::sun::star::form::XFormComponent > (getORB()->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.form.component.GridControl"))), UNO_QUERY); + return Reference< ::com::sun::star::form::XFormComponent > ( + getORB()->getServiceManager()->createInstanceWithContext("com.sun.star.form.component.GridControl", getORB()), + UNO_QUERY); } // ------------------------------------------------------------------------- @@ -1469,7 +1473,7 @@ sal_Bool SbaXDataBrowserController::approveParameter(const ::com::sun::star::for pParamRequest->addContinuation(pAbort); // create the handler, let it handle the request - Reference< XInteractionHandler2 > xHandler( InteractionHandler::createWithParent(comphelper::getComponentContext(getORB()), 0) ); + Reference< XInteractionHandler2 > xHandler( InteractionHandler::createWithParent(getORB(), 0) ); xHandler->handle(xParamRequest); if (!pParamValues->wasSelected()) @@ -1921,7 +1925,7 @@ void SbaXDataBrowserController::ExecuteFilterSortCrit(sal_Bool bFilter) Reference< XConnection> xCon(xFormSet->getPropertyValue(PROPERTY_ACTIVE_CONNECTION),UNO_QUERY); if(bFilter) { - DlgFilterCrit aDlg( getBrowserView(), comphelper::getComponentContext(getORB()), xCon, xParser, xSup->getColumns() ); + DlgFilterCrit aDlg( getBrowserView(), getORB(), xCon, xParser, xSup->getColumns() ); String aFilter; if ( !aDlg.Execute() ) return; // if so we don't need to update the grid @@ -2002,7 +2006,7 @@ void SbaXDataBrowserController::ExecuteSearch() xModelSet->setPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AlwaysShowCursor")), ::comphelper::makeBoolAny(sal_Bool(sal_True))); xModelSet->setPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CursorColor")), makeAny(sal_Int32(COL_LIGHTRED))); - Reference< ::com::sun::star::util::XNumberFormatsSupplier > xNFS(::dbtools::getNumberFormats(::dbtools::getConnection(m_xRowSet), sal_True, comphelper::getComponentContext(getORB()))); + Reference< ::com::sun::star::util::XNumberFormatsSupplier > xNFS(::dbtools::getNumberFormats(::dbtools::getConnection(m_xRowSet), sal_True, getORB())); SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); AbstractFmSearchDialog* pDialog = NULL; diff --git a/dbaccess/source/ui/browser/dbexchange.cxx b/dbaccess/source/ui/browser/dbexchange.cxx index 6bf1451b9760..a9c1940d9c3c 100644 --- a/dbaccess/source/ui/browser/dbexchange.cxx +++ b/dbaccess/source/ui/browser/dbexchange.cxx @@ -67,7 +67,7 @@ namespace dbaui const ::rtl::OUString& _rCommand, const Reference< XConnection >& _rxConnection, const Reference< XNumberFormatter >& _rxFormatter, - const Reference< XMultiServiceFactory >& _rxORB) + const Reference< XComponentContext >& _rxORB) :ODataAccessObjectTransferable( _rDatasource,::rtl::OUString(), _nCommandType, _rCommand, _rxConnection ) ,m_pHtml(NULL) ,m_pRtf(NULL) @@ -87,7 +87,7 @@ namespace dbaui const sal_Int32 _nCommandType, const ::rtl::OUString& _rCommand, const Reference< XNumberFormatter >& _rxFormatter, - const Reference< XMultiServiceFactory >& _rxORB) + const Reference< XComponentContext >& _rxORB) :ODataAccessObjectTransferable( _rDatasource, ::rtl::OUString(),_nCommandType, _rCommand) ,m_pHtml(NULL) ,m_pRtf(NULL) @@ -100,7 +100,7 @@ namespace dbaui ODataClipboard::ODataClipboard( const Reference< XPropertySet >& i_rAliveForm, const Sequence< Any >& i_rSelectedRows, const sal_Bool i_bBookmarkSelection, - const Reference< XMultiServiceFactory >& i_rORB ) + const Reference< XComponentContext >& i_rORB ) :ODataAccessObjectTransferable( i_rAliveForm ) ,m_pHtml(NULL) ,m_pRtf(NULL) @@ -129,7 +129,7 @@ namespace dbaui if ( xConnection.is() && i_rORB.is() ) { - Reference< XNumberFormatter > xFormatter( getNumberFormatter( xConnection, comphelper::getComponentContext(i_rORB) ) ); + Reference< XNumberFormatter > xFormatter( getNumberFormatter( xConnection, i_rORB ) ); if ( xFormatter.is() ) { m_pHtml.set( new OHTMLImportExport( getDescriptor(), i_rORB, xFormatter ) ); diff --git a/dbaccess/source/ui/browser/exsrcbrw.cxx b/dbaccess/source/ui/browser/exsrcbrw.cxx index 6c837b700580..e3b0c177f519 100644 --- a/dbaccess/source/ui/browser/exsrcbrw.cxx +++ b/dbaccess/source/ui/browser/exsrcbrw.cxx @@ -62,7 +62,7 @@ Any SAL_CALL SbaExternalSourceBrowser::queryInterface(const Type& _rType) throw } DBG_NAME(SbaExternalSourceBrowser) //------------------------------------------------------------------------------ -SbaExternalSourceBrowser::SbaExternalSourceBrowser(const Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rM) +SbaExternalSourceBrowser::SbaExternalSourceBrowser(const Reference< ::com::sun::star::uno::XComponentContext >& _rM) :SbaXDataBrowserController(_rM) ,m_aModifyListeners(getMutex()) ,m_pDataSourceImpl(NULL) @@ -99,7 +99,7 @@ SbaExternalSourceBrowser::~SbaExternalSourceBrowser() //------------------------------------------------------------------------- Reference< XInterface > SAL_CALL SbaExternalSourceBrowser::Create(const Reference<XMultiServiceFactory >& _rxFactory) { - return *(new SbaExternalSourceBrowser(_rxFactory)); + return *(new SbaExternalSourceBrowser( comphelper::getComponentContext(_rxFactory))); } //------------------------------------------------------------------------- ::rtl::OUString SAL_CALL SbaExternalSourceBrowser::getImplementationName() throw(RuntimeException) diff --git a/dbaccess/source/ui/browser/genericcontroller.cxx b/dbaccess/source/ui/browser/genericcontroller.cxx index 69cd5866cd18..c2aa93040892 100644 --- a/dbaccess/source/ui/browser/genericcontroller.cxx +++ b/dbaccess/source/ui/browser/genericcontroller.cxx @@ -175,7 +175,7 @@ struct OGenericUnoController_Data //========================================================================== DBG_NAME(OGenericUnoController) // ------------------------------------------------------------------------- -OGenericUnoController::OGenericUnoController(const Reference< XMultiServiceFactory >& _rM) +OGenericUnoController::OGenericUnoController(const Reference< XComponentContext >& _rM) :OGenericUnoController_Base( getMutex() ) ,m_pView(NULL) #ifdef DBG_UTIL @@ -183,7 +183,7 @@ OGenericUnoController::OGenericUnoController(const Reference< XMultiServiceFacto #endif ,m_aAsyncInvalidateAll(LINK(this, OGenericUnoController, OnAsyncInvalidateAll)) ,m_aAsyncCloseTask(LINK(this, OGenericUnoController, OnAsyncCloseTask)) - ,m_xServiceFactory(_rM) + ,m_xContext(_rM) ,m_aCurrentFrame( *this ) ,m_bPreview(sal_False) ,m_bReadOnly(sal_False) @@ -200,7 +200,7 @@ OGenericUnoController::OGenericUnoController(const Reference< XMultiServiceFacto try { - m_xUrlTransformer = URLTransformer::create(comphelper::getComponentContext(_rM)); + m_xUrlTransformer = URLTransformer::create(_rM); } catch(Exception&) { @@ -262,7 +262,7 @@ sal_Bool OGenericUnoController::Construct(Window* /*pParent*/) OSL_ENSURE(getORB().is(), "OGenericUnoController::Construct need a service factory!"); try { - m_xDatabaseContext = DatabaseContext::create(comphelper::getComponentContext(getORB())); + m_xDatabaseContext = DatabaseContext::create(getORB()); } catch(const Exception&) { @@ -1052,7 +1052,7 @@ Reference< XConnection > OGenericUnoController::connect( const Reference< XDataS { WaitObject aWaitCursor( getView() ); - ODatasourceConnector aConnector( comphelper::getComponentContext(getORB()), getView(), ::rtl::OUString() ); + ODatasourceConnector aConnector( getORB(), getView(), ::rtl::OUString() ); Reference< XConnection > xConnection = aConnector.connect( _xDataSource, _pErrorInfo ); startConnectionListening( xConnection ); @@ -1064,7 +1064,7 @@ Reference< XConnection > OGenericUnoController::connect( const ::rtl::OUString& { WaitObject aWaitCursor( getView() ); - ODatasourceConnector aConnector( comphelper::getComponentContext(getORB()), getView(), _rContextInformation ); + ODatasourceConnector aConnector( getORB(), getView(), _rContextInformation ); Reference<XConnection> xConnection = aConnector.connect( _rDataSourceName, _pErrorInfo ); startConnectionListening( xConnection ); @@ -1074,7 +1074,7 @@ Reference< XConnection > OGenericUnoController::connect( const ::rtl::OUString& // ----------------------------------------------------------------------------- void OGenericUnoController::showError(const SQLExceptionInfo& _rInfo) { - ::dbaui::showError(_rInfo,getView(),comphelper::getComponentContext(getORB())); + ::dbaui::showError(_rInfo,getView(),getORB()); } // ----------------------------------------------------------------------------- Reference< XLayoutManager > OGenericUnoController::getLayoutManager(const Reference< XFrame >& _xFrame) const @@ -1386,7 +1386,7 @@ Reference< XTitle > OGenericUnoController::impl_getTitleHelper_throw() Reference< XUntitledNumbers > xUntitledProvider(getPrivateModel(), UNO_QUERY ); Reference< XController > xThis(static_cast< XController* >(this), UNO_QUERY_THROW); - ::framework::TitleHelper* pHelper = new ::framework::TitleHelper( comphelper::getComponentContext(m_xServiceFactory) ); + ::framework::TitleHelper* pHelper = new ::framework::TitleHelper( m_xContext ); m_xTitleHelper.set( static_cast< ::cppu::OWeakObject* >(pHelper), UNO_QUERY_THROW); pHelper->setOwner (xThis ); diff --git a/dbaccess/source/ui/browser/sbagrid.cxx b/dbaccess/source/ui/browser/sbagrid.cxx index f95b727d28ab..d1d419802284 100644 --- a/dbaccess/source/ui/browser/sbagrid.cxx +++ b/dbaccess/source/ui/browser/sbagrid.cxx @@ -1304,7 +1304,7 @@ void SbaGridControl::implTransferSelectedRows( sal_Int16 nRowPos, bool _bTrueIfC Reference< XResultSet> xRowSetClone; try { - ODataClipboard* pTransfer = new ODataClipboard( xForm, aSelectedRows, bSelectionBookmarks, getServiceManager() ); + ODataClipboard* pTransfer = new ODataClipboard( xForm, aSelectedRows, bSelectionBookmarks, comphelper::getComponentContext(getServiceManager()) ); Reference< XTransferable > xEnsureDelete = pTransfer; if ( _bTrueIfClipboardFalseIfDrag ) @@ -1555,7 +1555,7 @@ IMPL_LINK(SbaGridControl, AsynchDropEvent, void*, /*EMPTY_ARG*/) if ( !bCountFinal ) setDataSource(NULL); // deattach from grid control Reference< XResultSetUpdate > xResultSetUpdate(xDataSource,UNO_QUERY); - ODatabaseImportExport* pImExport = new ORowSetImportExport(this,xResultSetUpdate,m_aDataDescriptor,getServiceManager()); + ODatabaseImportExport* pImExport = new ORowSetImportExport(this,xResultSetUpdate,m_aDataDescriptor, comphelper::getComponentContext(getServiceManager())); Reference<XEventListener> xHolder = pImExport; Hide(); try diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx index fcb6f3ed6204..29cdbf5acbd5 100644 --- a/dbaccess/source/ui/browser/unodatbr.cxx +++ b/dbaccess/source/ui/browser/unodatbr.cxx @@ -211,12 +211,12 @@ void SafeRemovePropertyListener(const Reference< XPropertySet > & xSet, const :: Reference< XInterface > SAL_CALL SbaTableQueryBrowser::Create(const Reference<XMultiServiceFactory >& _rxFactory) { SolarMutexGuard aGuard; - return *(new SbaTableQueryBrowser(_rxFactory)); + return *(new SbaTableQueryBrowser(comphelper::getComponentContext(_rxFactory))); } DBG_NAME(SbaTableQueryBrowser); //------------------------------------------------------------------------------ -SbaTableQueryBrowser::SbaTableQueryBrowser(const Reference< XMultiServiceFactory >& _rM) +SbaTableQueryBrowser::SbaTableQueryBrowser(const Reference< XComponentContext >& _rM) :SbaXDataBrowserController(_rM) ,m_aSelectionListeners( getMutex() ) ,m_aContextMenuInterceptors( getMutex() ) @@ -362,7 +362,7 @@ sal_Bool SbaTableQueryBrowser::Construct(Window* pParent) xDatabaseRegistrations->addDatabaseRegistrationsListener( this ); // the collator for the string compares - m_xCollator = Collator::create( comphelper::getComponentContext( getORB() ) ); + m_xCollator = Collator::create( getORB() ); m_xCollator->loadDefaultCollator( Application::GetSettings().GetLanguageTag().getLocale(), 0 ); } catch(const Exception&) @@ -1753,7 +1753,7 @@ FeatureState SbaTableQueryBrowser::GetState(sal_uInt16 nId) const } else if ( nId == ID_TREE_EDIT_DATABASE ) { - ::utl::OConfigurationTreeRoot aConfig( ::utl::OConfigurationTreeRoot::createWithComponentContext( comphelper::getComponentContext(getORB()), + ::utl::OConfigurationTreeRoot aConfig( ::utl::OConfigurationTreeRoot::createWithComponentContext( getORB(), ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/org.openoffice.Office.DataAccess/Policies/Features/Common" ) ) ) ); sal_Bool bHaveEditDatabase( sal_True ); OSL_VERIFY( aConfig.getNodeValue( "EditDatabaseFromDataSourceView" ) >>= bHaveEditDatabase ); @@ -3516,7 +3516,7 @@ void SbaTableQueryBrowser::implAdministrate( SvTreeListEntry* _pApplyTo ) { // get the desktop object sal_Int32 nFrameSearchFlag = FrameSearchFlag::ALL | FrameSearchFlag::GLOBAL ; - Reference< XDesktop2 > xFrameLoader = Desktop::create( comphelper::getComponentContext(getORB()) ); + Reference< XDesktop2 > xFrameLoader = Desktop::create( getORB() ); // the initial selection SvTreeListEntry* pTopLevelSelected = _pApplyTo; @@ -3526,13 +3526,13 @@ void SbaTableQueryBrowser::implAdministrate( SvTreeListEntry* _pApplyTo ) if (pTopLevelSelected) sInitialSelection = getDataSourceAcessor( pTopLevelSelected ); - Reference< XDataSource > xDataSource( getDataSourceByName( sInitialSelection, getView(), comphelper::getComponentContext(getORB()), NULL ) ); + Reference< XDataSource > xDataSource( getDataSourceByName( sInitialSelection, getView(), getORB(), NULL ) ); Reference< XModel > xDocumentModel( getDataSourceOrModel( xDataSource ), UNO_QUERY ); if ( xDocumentModel.is() ) { Reference< XInteractionHandler2 > xInteractionHandler( - InteractionHandler::createWithParent(comphelper::getComponentContext(getORB()), 0) ); + InteractionHandler::createWithParent(getORB(), 0) ); ::comphelper::NamedValueCollection aLoadArgs; aLoadArgs.put( "Model", xDocumentModel ); diff --git a/dbaccess/source/ui/dlg/RelationDlg.cxx b/dbaccess/source/ui/dlg/RelationDlg.cxx index ae94376ad0fa..0d4c5ec8dd49 100644 --- a/dbaccess/source/ui/dlg/RelationDlg.cxx +++ b/dbaccess/source/ui/dlg/RelationDlg.cxx @@ -210,7 +210,7 @@ IMPL_LINK( ORelationDialog, OKClickHdl, Button*, /*pButton*/ ) { ::dbaui::showError( SQLExceptionInfo( ::cppu::getCaughtException() ), this, - comphelper::getComponentContext(static_cast<OJoinTableView*>(GetParent())->getDesignView()->getController().getORB())); + static_cast<OJoinTableView*>(GetParent())->getDesignView()->getController().getORB()); } catch( const Exception& ) { diff --git a/dbaccess/source/ui/inc/JoinController.hxx b/dbaccess/source/ui/inc/JoinController.hxx index 36f8475aa2ce..e10c59782b10 100644 --- a/dbaccess/source/ui/inc/JoinController.hxx +++ b/dbaccess/source/ui/inc/JoinController.hxx @@ -80,7 +80,7 @@ namespace dbaui virtual ~OJoinController(); public: - OJoinController(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rM); + OJoinController(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rM); // --------------------------------------------------------------- // attribute access diff --git a/dbaccess/source/ui/inc/RelationController.hxx b/dbaccess/source/ui/inc/RelationController.hxx index f6518c208ee0..df04f1d03190 100644 --- a/dbaccess/source/ui/inc/RelationController.hxx +++ b/dbaccess/source/ui/inc/RelationController.hxx @@ -47,7 +47,7 @@ namespace dbaui void loadLayoutInformation(); void loadTableData(const ::com::sun::star::uno::Any& _aTable); public: - ORelationController(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rM); + ORelationController(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rM); ~ORelationController(); // temp diff --git a/dbaccess/source/ui/inc/TableController.hxx b/dbaccess/source/ui/inc/TableController.hxx index 9fac70ab504e..cebe6b794f63 100644 --- a/dbaccess/source/ui/inc/TableController.hxx +++ b/dbaccess/source/ui/inc/TableController.hxx @@ -85,7 +85,7 @@ namespace dbaui virtual ~OTableController(); public: - OTableController(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rM); + OTableController(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rM); ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > getTable() { return m_xTable;} diff --git a/dbaccess/source/ui/inc/TokenWriter.hxx b/dbaccess/source/ui/inc/TokenWriter.hxx index 2281886e9d23..4c7480685ff6 100644 --- a/dbaccess/source/ui/inc/TokenWriter.hxx +++ b/dbaccess/source/ui/inc/TokenWriter.hxx @@ -27,7 +27,6 @@ #include <com/sun/star/sdbc/XResultSet.hpp> #include <com/sun/star/sdbc/XResultSetUpdate.hpp> #include <com/sun/star/sdbc/XRow.hpp> -#include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/lang/XEventListener.hpp> #include <com/sun/star/frame/XModel.hpp> #include <com/sun/star/beans/PropertyValue.hpp> @@ -72,7 +71,7 @@ namespace dbaui ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData > m_xResultSetMetaData; ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > m_xRowSetColumns; ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter > m_xFormatter; // a number formatter working with the connection's NumberFormatsSupplier - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory> m_xFactory; + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext; ::rtl::OUString m_sName; @@ -97,14 +96,14 @@ namespace dbaui // export data ODatabaseImportExport( const ::svx::ODataAccessDescriptor& _aDataDescriptor, - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rM, + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rM, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& _rxNumberF, const String& rExchange = String()); // import data ODatabaseImportExport( const SharedConnection& _rxConnection, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& _rxNumberF, - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rM); + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rM); virtual ~ODatabaseImportExport(); @@ -140,7 +139,7 @@ namespace dbaui public: // export data ORTFImportExport( const ::svx::ODataAccessDescriptor& _aDataDescriptor, - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rM, + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rM, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& _rxNumberF, const String& rExchange = String()) : ODatabaseImportExport(_aDataDescriptor,_rM,_rxNumberF,rExchange) {}; @@ -148,7 +147,7 @@ namespace dbaui // import data ORTFImportExport( const SharedConnection& _rxConnection, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& _rxNumberF, - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rM) + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rM) : ODatabaseImportExport(_rxConnection,_rxNumberF,_rM) {} @@ -186,13 +185,13 @@ namespace dbaui public: // export data OHTMLImportExport( const ::svx::ODataAccessDescriptor& _aDataDescriptor, - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rM, + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rM, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& _rxNumberF, const String& rExchange = String()); // import data OHTMLImportExport( const SharedConnection& _rxConnection, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& _rxNumberF, - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rM) + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rM) : ODatabaseImportExport(_rxConnection,_rxNumberF,_rM) {} @@ -224,12 +223,12 @@ namespace dbaui ORowSetImportExport(Window* _pParent, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetUpdate >& _xResultSetUpdate, const ::svx::ODataAccessDescriptor& _aDataDescriptor, - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rM, + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rM, const String& rExchange = String()); // import data ORowSetImportExport(const SharedConnection& _rxConnection, - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rM) + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rM) : ODatabaseImportExport(_rxConnection,NULL,_rM) {} diff --git a/dbaccess/source/ui/inc/brwctrlr.hxx b/dbaccess/source/ui/inc/brwctrlr.hxx index 4563d971b492..6fa6097e28ba 100644 --- a/dbaccess/source/ui/inc/brwctrlr.hxx +++ b/dbaccess/source/ui/inc/brwctrlr.hxx @@ -148,7 +148,7 @@ namespace dbaui getViewClipboard() const { return m_aSystemClipboard; } public: - SbaXDataBrowserController(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rM); + SbaXDataBrowserController(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rM); UnoDataBrowserView* getBrowserView() const { return static_cast< UnoDataBrowserView*>(getView()); } // late construction diff --git a/dbaccess/source/ui/inc/databaseobjectview.hxx b/dbaccess/source/ui/inc/databaseobjectview.hxx index 5ebf5a434277..fcbf4b8fe59f 100644 --- a/dbaccess/source/ui/inc/databaseobjectview.hxx +++ b/dbaccess/source/ui/inc/databaseobjectview.hxx @@ -32,6 +32,7 @@ #include <com/sun/star/ui/dialogs/XExecutableDialog.hpp> #include <com/sun/star/sdb/application/XDatabaseDocumentUI.hpp> #include <com/sun/star/uno/Sequence.hxx> +#include <com/sun/star/uno/XComponentContext.hpp> #include <comphelper/namedvaluecollection.hxx> #include <boost/shared_ptr.hpp> @@ -49,7 +50,7 @@ namespace dbaui class DatabaseObjectView { private: - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xORB; ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > m_xParentFrame; @@ -99,7 +100,7 @@ namespace dbaui public: DatabaseObjectView( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB, + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxORB, const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::application::XDatabaseDocumentUI >& _rxApplication, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& _rxParentFrame, const ::rtl::OUString& _rComponentURL @@ -165,7 +166,7 @@ namespace dbaui public: QueryDesigner( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB, + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxORB, const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::application::XDatabaseDocumentUI >& _rxApplication, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& _rxParentFrame, bool _bCreateView @@ -192,7 +193,7 @@ namespace dbaui public: TableDesigner( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB, + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxORB, const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::application::XDatabaseDocumentUI >& _rxApplication, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& _rxParentFrame ); @@ -227,7 +228,7 @@ namespace dbaui public: ResultSetBrowser( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB, + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxORB, const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::application::XDatabaseDocumentUI >& _rxApplication, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& _rxParentFrame, sal_Bool _bTable @@ -241,7 +242,7 @@ namespace dbaui { public: RelationDesigner( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB, + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxORB, const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::application::XDatabaseDocumentUI >& _rxApplication, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& _rxParentFrame ); diff --git a/dbaccess/source/ui/inc/dbexchange.hxx b/dbaccess/source/ui/inc/dbexchange.hxx index 8c43e3877f98..0e0d687332cb 100644 --- a/dbaccess/source/ui/inc/dbexchange.hxx +++ b/dbaccess/source/ui/inc/dbexchange.hxx @@ -50,7 +50,7 @@ namespace dbaui const ::rtl::OUString& _rCommand, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& _rxFormatter, - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxORB ); ODataClipboard( @@ -58,14 +58,14 @@ namespace dbaui const sal_Int32 _nCommandType, const ::rtl::OUString& _rCommand, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& _rxFormatter, - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxORB ); ODataClipboard( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& i_rAliveForm, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& i_rSelectedRows, const sal_Bool i_bBookmarkSelection, - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_rORB + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& i_rORB ); // XEventListener diff --git a/dbaccess/source/ui/inc/exsrcbrw.hxx b/dbaccess/source/ui/inc/exsrcbrw.hxx index f76b1b9ac658..fd2d7f6222d2 100644 --- a/dbaccess/source/ui/inc/exsrcbrw.hxx +++ b/dbaccess/source/ui/inc/exsrcbrw.hxx @@ -44,7 +44,7 @@ namespace dbaui // recursion public: - SbaExternalSourceBrowser(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rM); + SbaExternalSourceBrowser(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rM); static ::rtl::OUString getImplementationName_Static() throw( ::com::sun::star::uno::RuntimeException ); static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static(void) throw( ::com::sun::star::uno::RuntimeException ); diff --git a/dbaccess/source/ui/inc/querycontroller.hxx b/dbaccess/source/ui/inc/querycontroller.hxx index 43f775338d32..789f9ea57713 100644 --- a/dbaccess/source/ui/inc/querycontroller.hxx +++ b/dbaccess/source/ui/inc/querycontroller.hxx @@ -129,7 +129,7 @@ namespace dbaui OQueryContainerWindow* getContainer() const { return static_cast< OQueryContainerWindow* >( getView() ); } public: - OQueryController(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rM); + OQueryController(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rM); virtual ~OQueryController(); OTableFields& getTableFieldDesc() { return m_vTableFieldDesc; } diff --git a/dbaccess/source/ui/inc/singledoccontroller.hxx b/dbaccess/source/ui/inc/singledoccontroller.hxx index 3fb4d4999dbe..6c55b743d032 100644 --- a/dbaccess/source/ui/inc/singledoccontroller.hxx +++ b/dbaccess/source/ui/inc/singledoccontroller.hxx @@ -44,7 +44,7 @@ namespace dbaui class OSingleDocumentController : public OSingleDocumentController_Base { protected: - OSingleDocumentController( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxORB ); + OSingleDocumentController( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext>& _rxORB ); virtual ~OSingleDocumentController(); // OComponentHelper diff --git a/dbaccess/source/ui/inc/unodatbr.hxx b/dbaccess/source/ui/inc/unodatbr.hxx index 5d6fbe63f6a1..aca502a9f9de 100644 --- a/dbaccess/source/ui/inc/unodatbr.hxx +++ b/dbaccess/source/ui/inc/unodatbr.hxx @@ -126,7 +126,7 @@ namespace dbaui virtual ::rtl::OUString getPrivateTitle( ) const; // attribute access public: - SbaTableQueryBrowser(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rM); + SbaTableQueryBrowser(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rM); ~SbaTableQueryBrowser(); enum EntryType diff --git a/dbaccess/source/ui/misc/RowSetDrop.cxx b/dbaccess/source/ui/misc/RowSetDrop.cxx index 77eb69a627b9..a4eaf1b23460 100644 --- a/dbaccess/source/ui/misc/RowSetDrop.cxx +++ b/dbaccess/source/ui/misc/RowSetDrop.cxx @@ -43,7 +43,7 @@ using namespace ::com::sun::star::lang; ORowSetImportExport::ORowSetImportExport( Window* _pParent, const Reference< XResultSetUpdate >& _xResultSetUpdate, const ::svx::ODataAccessDescriptor& _aDataDescriptor, - const Reference< XMultiServiceFactory >& _rM, + const Reference< XComponentContext >& _rM, const String& rExchange ) : ODatabaseImportExport(_aDataDescriptor,_rM,NULL,rExchange) diff --git a/dbaccess/source/ui/misc/TableCopyHelper.cxx b/dbaccess/source/ui/misc/TableCopyHelper.cxx index b57bf8e0072f..856a8b477def 100644 --- a/dbaccess/source/ui/misc/TableCopyHelper.cxx +++ b/dbaccess/source/ui/misc/TableCopyHelper.cxx @@ -247,9 +247,9 @@ sal_Bool OTableCopyHelper::copyTagTable(OTableCopyHelper::DropDescriptor& _rDesc Reference<XEventListener> xEvt; ODatabaseImportExport* pImport = NULL; if ( _rDesc.bHtml ) - pImport = new OHTMLImportExport(_xConnection,getNumberFormatter(_xConnection, comphelper::getComponentContext(m_pController->getORB())),m_pController->getORB()); + pImport = new OHTMLImportExport(_xConnection,getNumberFormatter(_xConnection, m_pController->getORB()),m_pController->getORB()); else - pImport = new ORTFImportExport(_xConnection,getNumberFormatter(_xConnection, comphelper::getComponentContext(m_pController->getORB())),m_pController->getORB()); + pImport = new ORTFImportExport(_xConnection,getNumberFormatter(_xConnection, m_pController->getORB()),m_pController->getORB()); xEvt = pImport; SvStream* pStream = (SvStream*)(SotStorageStream*)_rDesc.aHtmlRtfStorage; diff --git a/dbaccess/source/ui/misc/TokenWriter.cxx b/dbaccess/source/ui/misc/TokenWriter.cxx index 076368974ee2..20d8e8d94717 100644 --- a/dbaccess/source/ui/misc/TokenWriter.cxx +++ b/dbaccess/source/ui/misc/TokenWriter.cxx @@ -91,12 +91,12 @@ const static char sFontSize[] = "font-size: "; DBG_NAME(ODatabaseImportExport) //====================================================================== ODatabaseImportExport::ODatabaseImportExport(const ::svx::ODataAccessDescriptor& _aDataDescriptor, - const Reference< XMultiServiceFactory >& _rM, + const Reference< XComponentContext >& _rM, const Reference< ::com::sun::star::util::XNumberFormatter >& _rxNumberF, const String& rExchange) :m_bBookmarkSelection( sal_False ) ,m_xFormatter(_rxNumberF) - ,m_xFactory(_rM) + ,m_xContext(_rM) ,m_nCommandType(CommandType::TABLE) ,m_bNeedToReInitialize(sal_False) ,m_pReader(NULL) @@ -124,11 +124,11 @@ ODatabaseImportExport::ODatabaseImportExport(const ::svx::ODataAccessDescriptor& // ----------------------------------------------------------------------------- // import data ODatabaseImportExport::ODatabaseImportExport( const ::dbtools::SharedConnection& _rxConnection, - const Reference< XNumberFormatter >& _rxNumberF, const Reference< XMultiServiceFactory >& _rM ) + const Reference< XNumberFormatter >& _rxNumberF, const Reference< XComponentContext >& _rM ) :m_bBookmarkSelection( sal_False ) ,m_xConnection(_rxConnection) ,m_xFormatter(_rxNumberF) - ,m_xFactory(_rM) + ,m_xContext(_rM) ,m_nCommandType(::com::sun::star::sdb::CommandType::TABLE) ,m_bNeedToReInitialize(sal_False) ,m_pReader(NULL) @@ -277,11 +277,11 @@ void ODatabaseImportExport::initialize() if ( !m_xConnection.is() ) { // we need a connection OSL_ENSURE(!m_sDataSourceName.isEmpty(),"There must be a datsource name!"); - Reference<XNameAccess> xDatabaseContext( DatabaseContext::create(comphelper::getComponentContext(m_xFactory)), UNO_QUERY_THROW); + Reference<XNameAccess> xDatabaseContext( DatabaseContext::create(m_xContext), UNO_QUERY_THROW); Reference< XEventListener> xEvt((::cppu::OWeakObject*)this,UNO_QUERY); Reference< XConnection > xConnection; - SQLExceptionInfo aInfo = ::dbaui::createConnection( m_sDataSourceName, xDatabaseContext, comphelper::getComponentContext(m_xFactory), xEvt, xConnection ); + SQLExceptionInfo aInfo = ::dbaui::createConnection( m_sDataSourceName, xDatabaseContext, m_xContext, xEvt, xConnection ); m_xConnection.reset( xConnection ); if(aInfo.isValid() && aInfo.getType() == SQLExceptionInfo::SQL_EXCEPTION) @@ -323,7 +323,7 @@ void ODatabaseImportExport::initialize() // the result set may be already set with the datadescriptor if ( !m_xResultSet.is() ) { - m_xResultSet.set( m_xFactory->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdb.RowSet")) ), UNO_QUERY ); + m_xResultSet.set( m_xContext->getServiceManager()->createInstanceWithContext("com.sun.star.sdb.RowSet", m_xContext), UNO_QUERY ); Reference< XPropertySet > xProp( m_xResultSet, UNO_QUERY_THROW ); xProp->setPropertyValue( PROPERTY_ACTIVE_CONNECTION, makeAny( m_xConnection.getTyped() ) ); xProp->setPropertyValue( PROPERTY_COMMAND_TYPE, makeAny( m_nCommandType ) ); @@ -521,7 +521,6 @@ sal_Bool ORTFImportExport::Write() (*m_pStream) << ODatabaseImportExport::sNewLine << '}'; (*m_pStream) << ODatabaseImportExport::sNewLine; - ::comphelper::ComponentContext aContext(m_xFactory); Reference< XRowSet > xRowSet(m_xRow,UNO_QUERY); sal_Int32 k=1; sal_Int32 kk=0; @@ -587,7 +586,6 @@ void ORTFImportExport::appendRow(::rtl::OString* pHorzChar,sal_Int32 _nColumnCou const sal_Bool bItalic = ( ::com::sun::star::awt::FontSlant_ITALIC == m_aFont.Slant ); const sal_Bool bUnderline = ( ::com::sun::star::awt::FontUnderline::NONE != m_aFont.Underline ); const sal_Bool bStrikeout = ( ::com::sun::star::awt::FontStrikeout::NONE != m_aFont.Strikeout ); - ::comphelper::ComponentContext aContext(m_xFactory); Reference< XRowSet > xRowSet(m_xRow,UNO_QUERY); (*m_pStream) << '{'; @@ -608,7 +606,7 @@ void ORTFImportExport::appendRow(::rtl::OString* pHorzChar,sal_Int32 _nColumnCou try { Reference<XPropertySet> xColumn(m_xRowSetColumns->getByIndex(i-1),UNO_QUERY_THROW); - dbtools::FormattedColumnValue aFormatedValue(aContext,xRowSet,xColumn); + dbtools::FormattedColumnValue aFormatedValue(m_xContext,xRowSet,xColumn); ::rtl::OUString sValue = aFormatedValue.getFormattedValue(); if ( !sValue.isEmpty() ) RTFOutFuncs::Out_String(*m_pStream,sValue,m_eDestEnc); @@ -636,7 +634,7 @@ sal_Bool ORTFImportExport::Read() SvParserState eState = SVPAR_ERROR; if ( m_pStream ) { - m_pReader = new ORTFReader((*m_pStream),m_xConnection,m_xFormatter,comphelper::getComponentContext(m_xFactory)); + m_pReader = new ORTFReader((*m_pStream),m_xConnection,m_xFormatter,m_xContext); ((ORTFReader*)m_pReader)->AddRef(); if ( isCheckEnabled() ) m_pReader->enableCheckOnly(); @@ -672,7 +670,7 @@ const char OHTMLImportExport::sIndentSource[nIndentMax+1] = "\t\t\t\t\t\t\t\t\t\ //------------------------------------------------------------------- OHTMLImportExport::OHTMLImportExport(const ::svx::ODataAccessDescriptor& _aDataDescriptor, - const Reference< XMultiServiceFactory >& _rM, + const Reference< XComponentContext >& _rM, const Reference< ::com::sun::star::util::XNumberFormatter >& _rxNumberF, const String& rExchange) : ODatabaseImportExport(_aDataDescriptor,_rM,_rxNumberF,rExchange) @@ -715,7 +713,7 @@ sal_Bool OHTMLImportExport::Read() SvParserState eState = SVPAR_ERROR; if ( m_pStream ) { - m_pReader = new OHTMLReader((*m_pStream),m_xConnection,m_xFormatter,comphelper::getComponentContext(m_xFactory)); + m_pReader = new OHTMLReader((*m_pStream),m_xConnection,m_xFormatter,m_xContext); ((OHTMLReader*)m_pReader)->AddRef(); if ( isCheckEnabled() ) m_pReader->enableCheckOnly(); @@ -732,7 +730,7 @@ void OHTMLImportExport::WriteHeader() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "misc", "Ocke.Janssen@sun.com", "OHTMLImportExport::WriteHeader" ); uno::Reference<document::XDocumentProperties> xDocProps( - document::DocumentProperties::create( comphelper::getComponentContext(m_xFactory) ) ); + document::DocumentProperties::create( m_xContext ) ); if (xDocProps.is()) { xDocProps->setTitle(m_sName); } @@ -897,7 +895,6 @@ void OHTMLImportExport::WriteTables() TAG_ON_LF( OOO_STRING_SVTOOLS_HTML_tbody ); // 2. and now the data - ::comphelper::ComponentContext aContext(m_xFactory); Reference< XRowSet > xRowSet(m_xRow,UNO_QUERY); sal_Int32 j=1; sal_Int32 kk=0; @@ -919,7 +916,7 @@ void OHTMLImportExport::WriteTables() try { Reference<XPropertySet> xColumn(m_xRowSetColumns->getByIndex(i-1),UNO_QUERY_THROW); - dbtools::FormattedColumnValue aFormatedValue(aContext,xRowSet,xColumn); + dbtools::FormattedColumnValue aFormatedValue(m_xContext,xRowSet,xColumn); ::rtl::OUString sValue = aFormatedValue.getFormattedValue(); if (!sValue.isEmpty()) { diff --git a/dbaccess/source/ui/misc/databaseobjectview.cxx b/dbaccess/source/ui/misc/databaseobjectview.cxx index 6ad3829e3fd4..16b748d0f3c1 100644 --- a/dbaccess/source/ui/misc/databaseobjectview.cxx +++ b/dbaccess/source/ui/misc/databaseobjectview.cxx @@ -23,6 +23,7 @@ #include "asyncmodaldialog.hxx" #include <com/sun/star/lang/XSingleServiceFactory.hpp> +#include <com/sun/star/frame/TaskCreator.hpp> #include <com/sun/star/frame/XDispatchProvider.hpp> #include <com/sun/star/frame/XFrame.hpp> #include <com/sun/star/frame/XFrames.hpp> @@ -58,7 +59,7 @@ namespace dbaui //====================================================================== //= DatabaseObjectView //====================================================================== - DatabaseObjectView::DatabaseObjectView( const Reference< XMultiServiceFactory >& _rxORB, + DatabaseObjectView::DatabaseObjectView( const Reference< XComponentContext >& _rxORB, const Reference< XDatabaseDocumentUI >& _rxApplication, const Reference< XFrame >& _rxParentFrame, const ::rtl::OUString& _rComponentURL ) @@ -118,7 +119,7 @@ namespace dbaui // if we have no externally provided frame, create one if ( !m_xFrameLoader.is() ) { - Reference< XSingleServiceFactory > xFact(m_xORB->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.TaskCreator"))), UNO_QUERY_THROW); + Reference< XSingleServiceFactory > xFact = TaskCreator::create(m_xORB); Sequence< Any > lArgs(2); NamedValue aProp; sal_Int32 nArg = 0; @@ -184,7 +185,7 @@ namespace dbaui //= QueryDesigner //====================================================================== //---------------------------------------------------------------------- - QueryDesigner::QueryDesigner( const Reference< XMultiServiceFactory >& _rxORB, const Reference< XDatabaseDocumentUI >& _rxApplication, + QueryDesigner::QueryDesigner( const Reference< XComponentContext >& _rxORB, const Reference< XDatabaseDocumentUI >& _rxApplication, const Reference< XFrame >& _rxParentFrame, bool _bCreateView ) :DatabaseObjectView( _rxORB, _rxApplication, _rxParentFrame, _bCreateView ? URL_COMPONENT_VIEWDESIGN : URL_COMPONENT_QUERYDESIGN ) ,m_nCommandType( _bCreateView ? CommandType::TABLE : CommandType::QUERY ) @@ -218,7 +219,7 @@ namespace dbaui //= TableDesigner //====================================================================== //---------------------------------------------------------------------- - TableDesigner::TableDesigner( const Reference< XMultiServiceFactory >& _rxORB, const Reference< XDatabaseDocumentUI >& _rxApplication, const Reference< XFrame >& _rxParentFrame ) + TableDesigner::TableDesigner( const Reference< XComponentContext >& _rxORB, const Reference< XDatabaseDocumentUI >& _rxApplication, const Reference< XFrame >& _rxParentFrame ) :DatabaseObjectView( _rxORB, _rxApplication, _rxParentFrame, static_cast< ::rtl::OUString >( URL_COMPONENT_TABLEDESIGN ) ) { } @@ -284,7 +285,7 @@ namespace dbaui //= ResultSetBrowser //====================================================================== //---------------------------------------------------------------------- - ResultSetBrowser::ResultSetBrowser( const Reference< XMultiServiceFactory >& _rxORB, const Reference< XDatabaseDocumentUI >& _rxApplication, const Reference< XFrame >& _rxParentFrame, + ResultSetBrowser::ResultSetBrowser( const Reference< XComponentContext >& _rxORB, const Reference< XDatabaseDocumentUI >& _rxApplication, const Reference< XFrame >& _rxParentFrame, sal_Bool _bTable ) :DatabaseObjectView( _rxORB, _rxApplication, _rxParentFrame, static_cast < ::rtl::OUString >( URL_COMPONENT_DATASOURCEBROWSER ) ) ,m_bTable(_bTable) @@ -319,7 +320,7 @@ namespace dbaui //= RelationDesigner //====================================================================== //---------------------------------------------------------------------- - RelationDesigner::RelationDesigner( const Reference< XMultiServiceFactory >& _rxORB, const Reference< XDatabaseDocumentUI >& _rxApplication, const Reference< XFrame >& _rxParentFrame ) + RelationDesigner::RelationDesigner( const Reference< XComponentContext >& _rxORB, const Reference< XDatabaseDocumentUI >& _rxApplication, const Reference< XFrame >& _rxParentFrame ) :DatabaseObjectView( _rxORB, _rxApplication, _rxParentFrame, static_cast< ::rtl::OUString >( URL_COMPONENT_RELATIONDESIGN ) ) { } diff --git a/dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx b/dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx index 09718e39b6d4..db1982f59411 100644 --- a/dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx +++ b/dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx @@ -62,6 +62,7 @@ namespace dbaui using ::com::sun::star::uno::RuntimeException; using ::com::sun::star::uno::Sequence; using ::com::sun::star::uno::Type; + using ::com::sun::star::uno::XComponentContext; using ::com::sun::star::sdbc::XConnection; using ::com::sun::star::uno::UNO_QUERY; using ::com::sun::star::container::XChild; @@ -178,7 +179,7 @@ namespace dbaui //= DBSubComponentController //==================================================================== //-------------------------------------------------------------------- - DBSubComponentController::DBSubComponentController(const Reference< XMultiServiceFactory >& _rxORB) + DBSubComponentController::DBSubComponentController(const Reference< XComponentContext >& _rxORB) :DBSubComponentController_Base( _rxORB ) ,m_pImpl( new DBSubComponentController_Impl( getMutex() ) ) { @@ -298,7 +299,7 @@ namespace dbaui if(xSupplier.is()) { m_pImpl->m_xFormatter = Reference< XNumberFormatter >( - NumberFormatter::create(comphelper::getComponentContext(getORB())), UNO_QUERY_THROW); + NumberFormatter::create(getORB()), UNO_QUERY_THROW); m_pImpl->m_xFormatter->attachNumberFormatsSupplier(xSupplier); } OSL_ENSURE(m_pImpl->m_xFormatter.is(),"No NumberFormatter!"); diff --git a/dbaccess/source/ui/misc/singledoccontroller.cxx b/dbaccess/source/ui/misc/singledoccontroller.cxx index c194885b4d9f..27ac7a1e4740 100644 --- a/dbaccess/source/ui/misc/singledoccontroller.cxx +++ b/dbaccess/source/ui/misc/singledoccontroller.cxx @@ -46,6 +46,7 @@ namespace dbaui 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::document::XUndoManager; using ::com::sun::star::lang::XMultiServiceFactory; using ::com::sun::star::beans::PropertyValue; @@ -69,7 +70,7 @@ namespace dbaui //= OSingleDocumentController //================================================================================================================== //------------------------------------------------------------------------------------------------------------------ - OSingleDocumentController::OSingleDocumentController( const Reference< XMultiServiceFactory >& _rxORB ) + OSingleDocumentController::OSingleDocumentController( const Reference< XComponentContext >& _rxORB ) :OSingleDocumentController_Base( _rxORB ) ,m_pData( new OSingleDocumentController_Data( *this, getMutex() ) ) { diff --git a/dbaccess/source/ui/querydesign/JoinController.cxx b/dbaccess/source/ui/querydesign/JoinController.cxx index 20a2c60945e4..4ad229061658 100644 --- a/dbaccess/source/ui/querydesign/JoinController.cxx +++ b/dbaccess/source/ui/querydesign/JoinController.cxx @@ -163,7 +163,7 @@ OJoinTableView* AddTableDialogContext::getTableView() const DBG_NAME(OJoinController) // ----------------------------------------------------------------------------- -OJoinController::OJoinController(const Reference< XMultiServiceFactory >& _rM) +OJoinController::OJoinController(const Reference< XComponentContext >& _rM) :OJoinController_BASE(_rM) ,m_pAddTableDialog(NULL) { diff --git a/dbaccess/source/ui/querydesign/JoinTableView.cxx b/dbaccess/source/ui/querydesign/JoinTableView.cxx index f2e6a85b08eb..e3f528898dfd 100644 --- a/dbaccess/source/ui/querydesign/JoinTableView.cxx +++ b/dbaccess/source/ui/querydesign/JoinTableView.cxx @@ -303,13 +303,13 @@ TTableWindowData::value_type OJoinTableView::createTableWindowData(const ::rtl:: catch ( const SQLException& ) { ::dbaui::showError( ::dbtools::SQLExceptionInfo( ::cppu::getCaughtException() ), - pParent, comphelper::getComponentContext(pParent->getController().getORB()) ); + pParent, pParent->getController().getORB() ); } catch( const WrappedTargetException& e ) { SQLException aSql; if ( e.TargetException >>= aSql ) - ::dbaui::showError( ::dbtools::SQLExceptionInfo( aSql ), pParent, comphelper::getComponentContext(pParent->getController().getORB()) ); + ::dbaui::showError( ::dbtools::SQLExceptionInfo( aSql ), pParent, pParent->getController().getORB() ); } catch( const Exception& ) { diff --git a/dbaccess/source/ui/querydesign/querycontroller.cxx b/dbaccess/source/ui/querydesign/querycontroller.cxx index e49f1af9fe04..31e6d18002bf 100644 --- a/dbaccess/source/ui/querydesign/querycontroller.cxx +++ b/dbaccess/source/ui/querydesign/querycontroller.cxx @@ -110,7 +110,7 @@ namespace dbaui return getSupportedServiceNames_Static(); } public: - OViewController(const Reference< XMultiServiceFactory >& _rM) : OQueryController(_rM){} + OViewController(const Reference< XComponentContext >& _rM) : OQueryController(_rM){} // need by registration static OUString getImplementationName_Static() throw( RuntimeException ) @@ -125,7 +125,7 @@ namespace dbaui } static Reference< XInterface > SAL_CALL Create(const Reference< XMultiServiceFactory >& _rM) { - return *(new OViewController(_rM)); + return *(new OViewController(comphelper::getComponentContext(_rM))); } }; } @@ -304,15 +304,15 @@ Sequence< OUString> SAL_CALL OQueryController::getSupportedServiceNames() throw( // ------------------------------------------------------------------------- Reference< XInterface > SAL_CALL OQueryController::Create(const Reference<XMultiServiceFactory >& _rxFactory) { - return *(new OQueryController(_rxFactory)); + return *(new OQueryController(comphelper::getComponentContext(_rxFactory))); } DBG_NAME(OQueryController); // ----------------------------------------------------------------------------- -OQueryController::OQueryController(const Reference< XMultiServiceFactory >& _rM) +OQueryController::OQueryController(const Reference< XComponentContext >& _rM) :OJoinController(_rM) ,OQueryController_PBase( getBroadcastHelper() ) ,m_pParseContext( new svxform::OSystemParseContext ) - ,m_aSqlParser( comphelper::getComponentContext(_rM), m_pParseContext ) + ,m_aSqlParser( _rM, m_pParseContext ) ,m_pSqlIterator(NULL) ,m_nVisibleRows(0x400) ,m_nSplitPos(-1) @@ -1095,7 +1095,7 @@ sal_Bool OQueryController::Construct(Window* pParent) { // TODO: we have to check if we should create the text- or the design- view - setView( * new OQueryContainerWindow( pParent, *this, comphelper::getComponentContext(getORB()) ) ); + setView( * new OQueryContainerWindow( pParent, *this, getORB() ) ); return OJoinController::Construct(pParent); } @@ -1366,7 +1366,7 @@ sal_Bool OQueryController::askForNewName(const Reference<XNameAccess>& _xElement OSaveAsDlg aDlg( getView(), m_nCommandType, - comphelper::getComponentContext(getORB()), + getORB(), getConnection(), aDefaultName, aNameChecker, @@ -1523,7 +1523,7 @@ bool OQueryController::doSaveAsDoc(sal_Bool _bSaveAs) m_xAlterView.set( xElements->getByName( m_sName ), UNO_QUERY ); // now check if our datasource has set a tablefilter and if so, append the new table name to it - ::dbaui::appendToFilter( getConnection(), m_sName, comphelper::getComponentContext(getORB()), getView() ); + ::dbaui::appendToFilter( getConnection(), m_sName, getORB(), getView() ); } Reference< XTitleChangeListener> xEventListener(impl_getTitleHelper_throw(),UNO_QUERY); if ( xEventListener.is() ) diff --git a/dbaccess/source/ui/relationdesign/RelationController.cxx b/dbaccess/source/ui/relationdesign/RelationController.cxx index 2e999e8e118e..8851f393796d 100644 --- a/dbaccess/source/ui/relationdesign/RelationController.cxx +++ b/dbaccess/source/ui/relationdesign/RelationController.cxx @@ -116,11 +116,11 @@ Sequence< ::rtl::OUString> SAL_CALL ORelationController::getSupportedServiceName // ------------------------------------------------------------------------- Reference< XInterface > SAL_CALL ORelationController::Create(const Reference<XMultiServiceFactory >& _rxFactory) { - return *(new ORelationController(_rxFactory)); + return *(new ORelationController(comphelper::getComponentContext(_rxFactory))); } DBG_NAME(ORelationController); // ----------------------------------------------------------------------------- -ORelationController::ORelationController(const Reference< XMultiServiceFactory >& _rM) +ORelationController::ORelationController(const Reference< XComponentContext >& _rM) : OJoinController(_rM) ,m_nThreadEvent(0) ,m_bRelationsPossible(sal_True) @@ -161,7 +161,7 @@ void ORelationController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue case ID_BROWSER_SAVEDOC: { OSL_ENSURE(isEditable(),"Slot ID_BROWSER_SAVEDOC should not be enabled!"); - if(!::dbaui::checkDataSourceAvailable(::comphelper::getString(getDataSource()->getPropertyValue(PROPERTY_NAME)), comphelper::getComponentContext(getORB()))) + if(!::dbaui::checkDataSourceAvailable(::comphelper::getString(getDataSource()->getPropertyValue(PROPERTY_NAME)), getORB())) { String aMessage(ModuleRes(STR_DATASOURCE_DELETED)); OSQLWarningBox( getView(), aMessage ).Execute(); @@ -249,7 +249,7 @@ void ORelationController::impl_initialize() // ----------------------------------------------------------------------------- sal_Bool ORelationController::Construct(Window* pParent) { - setView( * new ORelationDesignView( pParent, *this, comphelper::getComponentContext(getORB()) ) ); + setView( * new ORelationDesignView( pParent, *this, getORB() ) ); OJoinController::Construct(pParent); return sal_True; } diff --git a/dbaccess/source/ui/tabledesign/TEditControl.cxx b/dbaccess/source/ui/tabledesign/TEditControl.cxx index 6fd7c3e5ee9f..2785fe7b4828 100644 --- a/dbaccess/source/ui/tabledesign/TEditControl.cxx +++ b/dbaccess/source/ui/tabledesign/TEditControl.cxx @@ -142,7 +142,7 @@ void OTableEditorCtrl::Init() aColumnName = String( ModuleRes(STR_TAB_FIELD_COLUMN_DATATYPE) ); InsertDataColumn( FIELD_TYPE, aColumnName, FIELDTYPE_WIDTH ); - ::dbaccess::ODsnTypeCollection aDsnTypes(comphelper::getComponentContext(GetView()->getController().getORB())); + ::dbaccess::ODsnTypeCollection aDsnTypes(GetView()->getController().getORB()); sal_Bool bShowColumnDescription = aDsnTypes.supportsColumnDescription(::comphelper::getString(GetView()->getController().getDataSource()->getPropertyValue(PROPERTY_URL))); aColumnName = String( ModuleRes(STR_TAB_HELP_TEXT) ); InsertDataColumn( HELP_TEXT, aColumnName, bShowColumnDescription ? FIELDTYPE_WIDTH : FIELDDESCR_WIDTH ); diff --git a/dbaccess/source/ui/tabledesign/TableController.cxx b/dbaccess/source/ui/tabledesign/TableController.cxx index 91c5352e923b..dd1f6aab9666 100644 --- a/dbaccess/source/ui/tabledesign/TableController.cxx +++ b/dbaccess/source/ui/tabledesign/TableController.cxx @@ -150,12 +150,12 @@ Sequence< ::rtl::OUString> SAL_CALL OTableController::getSupportedServiceNames() // ------------------------------------------------------------------------- Reference< XInterface > SAL_CALL OTableController::Create(const Reference<XMultiServiceFactory >& _rxFactory) { - return *(new OTableController(_rxFactory)); + return *(new OTableController(comphelper::getComponentContext(_rxFactory))); } DBG_NAME(OTableController) // ----------------------------------------------------------------------------- -OTableController::OTableController(const Reference< XMultiServiceFactory >& _rM) : OTableController_BASE(_rM) +OTableController::OTableController(const Reference< XComponentContext >& _rM) : OTableController_BASE(_rM) ,m_sTypeNames(ModuleRes(STR_TABLEDESIGN_DBFIELDTYPES)) ,m_pTypeInfo() ,m_bAllowAutoIncrementValue(sal_False) @@ -341,7 +341,7 @@ sal_Bool OTableController::doSaveDoc(sal_Bool _bSaveAs) } DynamicTableOrQueryNameCheck aNameChecker( getConnection(), CommandType::TABLE ); - OSaveAsDlg aDlg( getView(), CommandType::TABLE, comphelper::getComponentContext(getORB()), getConnection(), aDefaultName, aNameChecker ); + OSaveAsDlg aDlg( getView(), CommandType::TABLE, getORB(), getConnection(), aDefaultName, aNameChecker ); if ( aDlg.Execute() != RET_OK ) return sal_False; @@ -406,7 +406,7 @@ sal_Bool OTableController::doSaveDoc(sal_Bool _bSaveAs) assignTable(); } // now check if our datasource has set a tablefilter and if append the new table name to it - ::dbaui::appendToFilter(getConnection(),m_sName,comphelper::getComponentContext(getORB()),getView()); // we are not interessted in the return value + ::dbaui::appendToFilter(getConnection(),m_sName,getORB(),getView()); // we are not interessted in the return value Reference< frame::XTitleChangeListener> xEventListener(impl_getTitleHelper_throw(),UNO_QUERY); if ( xEventListener.is() ) { @@ -514,7 +514,7 @@ void OTableController::doEditIndexes() if (!xIndexes.is()) return; - DbaIndexDialog aDialog(getView(), aFieldNames, xIndexes, getConnection(), comphelper::getComponentContext(getORB()), isConnected() ? getConnection()->getMetaData().is() && getConnection()->getMetaData()->getMaxColumnsInIndex() : sal_Int32(0)); + DbaIndexDialog aDialog(getView(), aFieldNames, xIndexes, getConnection(), getORB(), isConnected() ? getConnection()->getMetaData().is() && getConnection()->getMetaData()->getMaxColumnsInIndex() : sal_Int32(0)); if (RET_OK != aDialog.Execute()) return; @@ -565,7 +565,7 @@ void OTableController::impl_initialize() // ----------------------------------------------------------------------------- sal_Bool OTableController::Construct(Window* pParent) { - setView( * new OTableDesignView( pParent, comphelper::getComponentContext(getORB()), *this ) ); + setView( * new OTableDesignView( pParent, getORB(), *this ) ); OTableController_BASE::Construct(pParent); return sal_True; } |