diff options
author | Noel Grandin <noel@peralex.com> | 2013-01-04 11:58:23 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-01-09 08:08:15 +0200 |
commit | e88e974e7cd9d92ca338ba6c56baa0aa9a4b0636 (patch) | |
tree | d721f3a93bf55680e5d10c8c421124fc0d53bb38 /dbaccess | |
parent | ea638e605616a2db08f88e2e14d4928854834694 (diff) |
fdo#46808, convert OGenericAdministrationPage::setServiceFactory
... to XComponentContext.
Change-Id: I8f9a811dafc831db59d6a462f8b405d7568e34cf
Diffstat (limited to 'dbaccess')
-rw-r--r-- | dbaccess/source/ui/dlg/ConnectionHelper.cxx | 4 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/ConnectionHelper.hxx | 5 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/TablesSingleDlg.cxx | 4 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/UserAdmin.cxx | 6 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/UserAdminDlg.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/adminpages.hxx | 4 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/advancedsettings.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/dbadmin.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/dbwiz.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/dbwizsetup.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/tablespage.cxx | 6 | ||||
-rw-r--r-- | dbaccess/source/ui/inc/TablesSingleDlg.hxx | 6 | ||||
-rw-r--r-- | dbaccess/source/ui/uno/TableFilterDlg.cxx | 2 |
13 files changed, 21 insertions, 26 deletions
diff --git a/dbaccess/source/ui/dlg/ConnectionHelper.cxx b/dbaccess/source/ui/dlg/ConnectionHelper.cxx index c33685de305a..8bac6979cff1 100644 --- a/dbaccess/source/ui/dlg/ConnectionHelper.cxx +++ b/dbaccess/source/ui/dlg/ConnectionHelper.cxx @@ -172,7 +172,7 @@ DBG_NAME(OConnectionHelper) { try { - Reference< XFolderPicker2 > xFolderPicker = FolderPicker::create(comphelper::getComponentContext(m_xORB)); + Reference< XFolderPicker2 > xFolderPicker = FolderPicker::create(m_xORB); sal_Bool bDoBrowse = sal_False; String sOldPath = getURLNoPrefix(); @@ -518,7 +518,7 @@ DBG_NAME(OConnectionHelper) sal_Bool bExists = sal_False; IS_PATH_EXIST eExists = PATH_NOT_EXIST; Reference< ::com::sun::star::task::XInteractionHandler > xInteractionHandler( - task::InteractionHandler::createWithParent(comphelper::getComponentContext(m_xORB), 0), UNO_QUERY ); + task::InteractionHandler::createWithParent(m_xORB, 0), UNO_QUERY ); OFilePickerInteractionHandler* pHandler = new OFilePickerInteractionHandler(xInteractionHandler); xInteractionHandler = pHandler; diff --git a/dbaccess/source/ui/dlg/ConnectionHelper.hxx b/dbaccess/source/ui/dlg/ConnectionHelper.hxx index 0cb8572151ea..1497db425d44 100644 --- a/dbaccess/source/ui/dlg/ConnectionHelper.hxx +++ b/dbaccess/source/ui/dlg/ConnectionHelper.hxx @@ -88,11 +88,6 @@ namespace dbaui */ void askForFileName(::sfx2::FileDialogHelper& _aFileOpen); - virtual void SetServiceFactory(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > _rxORB) - { - OGenericAdministrationPage::SetServiceFactory(_rxORB); - } - protected: void setURL( const String& _rURL ); virtual bool checkTestConnection(); diff --git a/dbaccess/source/ui/dlg/TablesSingleDlg.cxx b/dbaccess/source/ui/dlg/TablesSingleDlg.cxx index 89fbdda38a60..91f292a4193e 100644 --- a/dbaccess/source/ui/dlg/TablesSingleDlg.cxx +++ b/dbaccess/source/ui/dlg/TablesSingleDlg.cxx @@ -45,10 +45,10 @@ DBG_NAME(OTableSubscriptionDialog) //======================================================================== OTableSubscriptionDialog::OTableSubscriptionDialog(Window* pParent ,SfxItemSet* _pItems - ,const Reference< XMultiServiceFactory >& _rxORB + ,const Reference< XComponentContext >& _rxORB ,const ::com::sun::star::uno::Any& _aDataSourceName) :SfxSingleTabDialog(pParent,DLG_TABLE_FILTER,_pItems) - ,m_pImpl( new ODbDataSourceAdministrationHelper( comphelper::getComponentContext(_rxORB), pParent, this ) ) + ,m_pImpl( new ODbDataSourceAdministrationHelper( _rxORB, pParent, this ) ) ,m_bStopExecution(sal_False) ,m_pOutSet(_pItems) { diff --git a/dbaccess/source/ui/dlg/UserAdmin.cxx b/dbaccess/source/ui/dlg/UserAdmin.cxx index 54d63191dc76..a79399a009fc 100644 --- a/dbaccess/source/ui/dlg/UserAdmin.cxx +++ b/dbaccess/source/ui/dlg/UserAdmin.cxx @@ -271,7 +271,7 @@ IMPL_LINK( OUserAdmin, UserHdl, PushButton *, pButton ) } catch(const SQLException& e) { - ::dbaui::showError(::dbtools::SQLExceptionInfo(e),this, comphelper::getComponentContext(m_xORB)); + ::dbaui::showError(::dbtools::SQLExceptionInfo(e), this, m_xORB); return 0; } catch(Exception& ) @@ -307,7 +307,7 @@ void OUserAdmin::fillWindows(::std::vector< ISaveValueWrapper* >& /*_rControlLis // ----------------------------------------------------------------------------- void OUserAdmin::implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue) { - m_TableCtrl.setComponentContext(comphelper::getComponentContext(m_xORB)); + m_TableCtrl.setComponentContext(m_xORB); try { if ( !m_xConnection.is() && m_pAdminDialog ) @@ -334,7 +334,7 @@ void OUserAdmin::implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue) } catch(const SQLException& e) { - ::dbaui::showError(::dbtools::SQLExceptionInfo(e),this,comphelper::getComponentContext(m_xORB)); + ::dbaui::showError(::dbtools::SQLExceptionInfo(e), this, m_xORB); } OGenericAdministrationPage::implInitControls(_rSet, _bSaveValue); diff --git a/dbaccess/source/ui/dlg/UserAdminDlg.cxx b/dbaccess/source/ui/dlg/UserAdminDlg.cxx index 411c9c279974..30e52f18813a 100644 --- a/dbaccess/source/ui/dlg/UserAdminDlg.cxx +++ b/dbaccess/source/ui/dlg/UserAdminDlg.cxx @@ -131,7 +131,7 @@ DBG_NAME(OUserAdminDlg) void OUserAdminDlg::PageCreated(sal_uInt16 _nId, SfxTabPage& _rPage) { // register ourself as modified listener - static_cast<OGenericAdministrationPage&>(_rPage).SetServiceFactory( Reference<XMultiServiceFactory>(m_pImpl->getORB()->getServiceManager(), UNO_QUERY_THROW) ); + static_cast<OGenericAdministrationPage&>(_rPage).SetServiceFactory( m_pImpl->getORB() ); static_cast<OGenericAdministrationPage&>(_rPage).SetAdminDialog(this,this); AdjustLayout(); diff --git a/dbaccess/source/ui/dlg/adminpages.hxx b/dbaccess/source/ui/dlg/adminpages.hxx index e87d62df9455..1fe71f11e05e 100644 --- a/dbaccess/source/ui/dlg/adminpages.hxx +++ b/dbaccess/source/ui/dlg/adminpages.hxx @@ -105,7 +105,7 @@ namespace dbaui IItemSetHelper* m_pItemSetHelper; FixedText* m_pFT_HeaderText; - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xORB; public: OGenericAdministrationPage(Window* _pParent, const ResId& _rId, const SfxItemSet& _rAttrSet); @@ -131,7 +131,7 @@ namespace dbaui @param _rxORB The service factory. */ - virtual void SetServiceFactory(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > _rxORB) + void SetServiceFactory(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > _rxORB) { m_xORB = _rxORB; } diff --git a/dbaccess/source/ui/dlg/advancedsettings.cxx b/dbaccess/source/ui/dlg/advancedsettings.cxx index be26d56ba05f..d2ec3e9a5e3a 100644 --- a/dbaccess/source/ui/dlg/advancedsettings.cxx +++ b/dbaccess/source/ui/dlg/advancedsettings.cxx @@ -516,7 +516,7 @@ namespace dbaui void AdvancedSettingsDialog::PageCreated(sal_uInt16 _nId, SfxTabPage& _rPage) { // register ourself as modified listener - static_cast<OGenericAdministrationPage&>(_rPage).SetServiceFactory( Reference<XMultiServiceFactory>(m_pImpl->getORB()->getServiceManager(), UNO_QUERY_THROW) ); + static_cast<OGenericAdministrationPage&>(_rPage).SetServiceFactory( getORB() ); static_cast<OGenericAdministrationPage&>(_rPage).SetAdminDialog(this,this); AdjustLayout(); diff --git a/dbaccess/source/ui/dlg/dbadmin.cxx b/dbaccess/source/ui/dlg/dbadmin.cxx index 9d97f6d37530..759c45faacf8 100644 --- a/dbaccess/source/ui/dlg/dbadmin.cxx +++ b/dbaccess/source/ui/dlg/dbadmin.cxx @@ -98,7 +98,7 @@ short ODbAdminDialog::Ok() void ODbAdminDialog::PageCreated(sal_uInt16 _nId, SfxTabPage& _rPage) { // register ourself as modified listener - static_cast<OGenericAdministrationPage&>(_rPage).SetServiceFactory( Reference<XMultiServiceFactory>(m_pImpl->getORB()->getServiceManager(), UNO_QUERY_THROW) ); + static_cast<OGenericAdministrationPage&>(_rPage).SetServiceFactory( getORB() ); static_cast<OGenericAdministrationPage&>(_rPage).SetAdminDialog(this,this); AdjustLayout(); diff --git a/dbaccess/source/ui/dlg/dbwiz.cxx b/dbaccess/source/ui/dlg/dbwiz.cxx index d788d2a4bcbf..232ebff1f549 100644 --- a/dbaccess/source/ui/dlg/dbwiz.cxx +++ b/dbaccess/source/ui/dlg/dbwiz.cxx @@ -300,7 +300,7 @@ TabPage* ODbTypeWizDialog::createPage(WizardState _nState) // register ourself as modified listener if ( pPage ) { - static_cast<OGenericAdministrationPage*>(pPage)->SetServiceFactory( Reference<XMultiServiceFactory>(m_pImpl->getORB()->getServiceManager(), UNO_QUERY_THROW) ); + static_cast<OGenericAdministrationPage*>(pPage)->SetServiceFactory( m_pImpl->getORB() ); static_cast<OGenericAdministrationPage*>(pPage)->SetAdminDialog(this,this); // open our own resource block, as the page titles are strings local to this block LocalResourceAccess aDummy(DLG_DATABASE_ADMINISTRATION, RSC_TABDIALOG); diff --git a/dbaccess/source/ui/dlg/dbwizsetup.cxx b/dbaccess/source/ui/dlg/dbwizsetup.cxx index 7d5d6f2a2273..14177e75fcdb 100644 --- a/dbaccess/source/ui/dlg/dbwizsetup.cxx +++ b/dbaccess/source/ui/dlg/dbwizsetup.cxx @@ -594,7 +594,7 @@ TabPage* ODbTypeWizDialogSetup::createPage(WizardState _nState) if ( pPage ) { - pPage->SetServiceFactory( uno::Reference<lang::XMultiServiceFactory>(m_pImpl->getORB()->getServiceManager(), uno::UNO_QUERY_THROW) ); + pPage->SetServiceFactory( m_pImpl->getORB() ); pPage->SetAdminDialog(this, this); defaultButton( _nState == PAGE_DBSETUPWIZARD_FINAL ? WZB_FINISH : WZB_NEXT ); diff --git a/dbaccess/source/ui/dlg/tablespage.cxx b/dbaccess/source/ui/dlg/tablespage.cxx index 637475991391..7cb42b0c0e73 100644 --- a/dbaccess/source/ui/dlg/tablespage.cxx +++ b/dbaccess/source/ui/dlg/tablespage.cxx @@ -271,7 +271,7 @@ DBG_NAME(OTableSubscriptionPage) // the collator for the string compares try { - m_xCollator = Reference< XCollator >(m_xORB->createInstance(SERVICE_I18N_COLLATOR), UNO_QUERY); + m_xCollator = Reference< XCollator >(m_xORB->getServiceManager()->createInstanceWithContext(SERVICE_I18N_COLLATOR, m_xORB), UNO_QUERY); if (m_xCollator.is()) m_xCollator->loadDefaultCollator(Application::GetSettings().GetLanguageTag().getLocale(), 0); } @@ -295,7 +295,7 @@ DBG_NAME(OTableSubscriptionPage) m_aTablesList.GetModel()->SetCompareHdl(LINK(this, OTableSubscriptionPage, OnTreeEntryCompare)); Reference< XDriver > xDriver; - m_aTablesList.setORB(m_xORB); + m_aTablesList.setORB( Reference<XMultiServiceFactory>(m_xORB->getServiceManager(), UNO_QUERY_THROW) ); Reference<XPropertySet> xProp = m_pTablesDlg->getCurrentDataSource(); OSL_ENSURE(xProp.is(),"No data source set!"); if ( xProp.is() ) @@ -312,7 +312,7 @@ DBG_NAME(OTableSubscriptionPage) xProp->setPropertyValue( PROPERTY_TABLETYPEFILTER, makeAny( Sequence< ::rtl::OUString >() ) ); Reference< ::com::sun::star::lang::XEventListener> xEvt; - aErrorInfo = ::dbaui::createConnection(xProp,comphelper::getComponentContext(m_xORB),xEvt,m_xCurrentConnection); + aErrorInfo = ::dbaui::createConnection(xProp, m_xORB, xEvt, m_xCurrentConnection); xProp->setPropertyValue(PROPERTY_TABLEFILTER,aTableFilter); xProp->setPropertyValue(PROPERTY_TABLETYPEFILTER,aTableTypeFilter); diff --git a/dbaccess/source/ui/inc/TablesSingleDlg.hxx b/dbaccess/source/ui/inc/TablesSingleDlg.hxx index 31de1f1dae25..31aa38076437 100644 --- a/dbaccess/source/ui/inc/TablesSingleDlg.hxx +++ b/dbaccess/source/ui/inc/TablesSingleDlg.hxx @@ -31,8 +31,8 @@ namespace com { namespace sun { namespace star { namespace beans { class XPropertySet; } - namespace lang { - class XMultiServiceFactory; + namespace uno { + class XComponentContext; } }}} @@ -55,7 +55,7 @@ class ODbDataSourceAdministrationHelper; OTableSubscriptionDialog(Window* pParent ,SfxItemSet* _pItems - ,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::Any& _aDataSourceName ); virtual ~OTableSubscriptionDialog(); diff --git a/dbaccess/source/ui/uno/TableFilterDlg.cxx b/dbaccess/source/ui/uno/TableFilterDlg.cxx index 064ae48911c7..b39d12693b3f 100644 --- a/dbaccess/source/ui/uno/TableFilterDlg.cxx +++ b/dbaccess/source/ui/uno/TableFilterDlg.cxx @@ -107,7 +107,7 @@ Reference<XPropertySetInfo> SAL_CALL OTableFilterDialog::getPropertySetInfo() t //------------------------------------------------------------------------------ Dialog* OTableFilterDialog::createDialog(Window* _pParent) { - OTableSubscriptionDialog* pDlg = new OTableSubscriptionDialog(_pParent, m_pDatasourceItems, m_aContext.getLegacyServiceFactory(),m_aInitialSelection); + OTableSubscriptionDialog* pDlg = new OTableSubscriptionDialog(_pParent, m_pDatasourceItems, m_aContext.getUNOContext(), m_aInitialSelection); return pDlg; } |