Kaydet (Commit) e88e974e authored tarafından Noel Grandin's avatar Noel Grandin

fdo#46808, convert OGenericAdministrationPage::setServiceFactory

... to XComponentContext.

Change-Id: I8f9a811dafc831db59d6a462f8b405d7568e34cf
üst ea638e60
...@@ -172,7 +172,7 @@ DBG_NAME(OConnectionHelper) ...@@ -172,7 +172,7 @@ DBG_NAME(OConnectionHelper)
{ {
try try
{ {
Reference< XFolderPicker2 > xFolderPicker = FolderPicker::create(comphelper::getComponentContext(m_xORB)); Reference< XFolderPicker2 > xFolderPicker = FolderPicker::create(m_xORB);
sal_Bool bDoBrowse = sal_False; sal_Bool bDoBrowse = sal_False;
String sOldPath = getURLNoPrefix(); String sOldPath = getURLNoPrefix();
...@@ -518,7 +518,7 @@ DBG_NAME(OConnectionHelper) ...@@ -518,7 +518,7 @@ DBG_NAME(OConnectionHelper)
sal_Bool bExists = sal_False; sal_Bool bExists = sal_False;
IS_PATH_EXIST eExists = PATH_NOT_EXIST; IS_PATH_EXIST eExists = PATH_NOT_EXIST;
Reference< ::com::sun::star::task::XInteractionHandler > xInteractionHandler( 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); OFilePickerInteractionHandler* pHandler = new OFilePickerInteractionHandler(xInteractionHandler);
xInteractionHandler = pHandler; xInteractionHandler = pHandler;
......
...@@ -88,11 +88,6 @@ namespace dbaui ...@@ -88,11 +88,6 @@ namespace dbaui
*/ */
void askForFileName(::sfx2::FileDialogHelper& _aFileOpen); void askForFileName(::sfx2::FileDialogHelper& _aFileOpen);
virtual void SetServiceFactory(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > _rxORB)
{
OGenericAdministrationPage::SetServiceFactory(_rxORB);
}
protected: protected:
void setURL( const String& _rURL ); void setURL( const String& _rURL );
virtual bool checkTestConnection(); virtual bool checkTestConnection();
......
...@@ -45,10 +45,10 @@ DBG_NAME(OTableSubscriptionDialog) ...@@ -45,10 +45,10 @@ DBG_NAME(OTableSubscriptionDialog)
//======================================================================== //========================================================================
OTableSubscriptionDialog::OTableSubscriptionDialog(Window* pParent OTableSubscriptionDialog::OTableSubscriptionDialog(Window* pParent
,SfxItemSet* _pItems ,SfxItemSet* _pItems
,const Reference< XMultiServiceFactory >& _rxORB ,const Reference< XComponentContext >& _rxORB
,const ::com::sun::star::uno::Any& _aDataSourceName) ,const ::com::sun::star::uno::Any& _aDataSourceName)
:SfxSingleTabDialog(pParent,DLG_TABLE_FILTER,_pItems) :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_bStopExecution(sal_False)
,m_pOutSet(_pItems) ,m_pOutSet(_pItems)
{ {
......
...@@ -271,7 +271,7 @@ IMPL_LINK( OUserAdmin, UserHdl, PushButton *, pButton ) ...@@ -271,7 +271,7 @@ IMPL_LINK( OUserAdmin, UserHdl, PushButton *, pButton )
} }
catch(const SQLException& e) catch(const SQLException& e)
{ {
::dbaui::showError(::dbtools::SQLExceptionInfo(e),this, comphelper::getComponentContext(m_xORB)); ::dbaui::showError(::dbtools::SQLExceptionInfo(e), this, m_xORB);
return 0; return 0;
} }
catch(Exception& ) catch(Exception& )
...@@ -307,7 +307,7 @@ void OUserAdmin::fillWindows(::std::vector< ISaveValueWrapper* >& /*_rControlLis ...@@ -307,7 +307,7 @@ void OUserAdmin::fillWindows(::std::vector< ISaveValueWrapper* >& /*_rControlLis
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
void OUserAdmin::implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue) void OUserAdmin::implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue)
{ {
m_TableCtrl.setComponentContext(comphelper::getComponentContext(m_xORB)); m_TableCtrl.setComponentContext(m_xORB);
try try
{ {
if ( !m_xConnection.is() && m_pAdminDialog ) if ( !m_xConnection.is() && m_pAdminDialog )
...@@ -334,7 +334,7 @@ void OUserAdmin::implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue) ...@@ -334,7 +334,7 @@ void OUserAdmin::implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue)
} }
catch(const SQLException& e) 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); OGenericAdministrationPage::implInitControls(_rSet, _bSaveValue);
......
...@@ -131,7 +131,7 @@ DBG_NAME(OUserAdminDlg) ...@@ -131,7 +131,7 @@ DBG_NAME(OUserAdminDlg)
void OUserAdminDlg::PageCreated(sal_uInt16 _nId, SfxTabPage& _rPage) void OUserAdminDlg::PageCreated(sal_uInt16 _nId, SfxTabPage& _rPage)
{ {
// register ourself as modified listener // 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); static_cast<OGenericAdministrationPage&>(_rPage).SetAdminDialog(this,this);
AdjustLayout(); AdjustLayout();
......
...@@ -105,7 +105,7 @@ namespace dbaui ...@@ -105,7 +105,7 @@ namespace dbaui
IItemSetHelper* m_pItemSetHelper; IItemSetHelper* m_pItemSetHelper;
FixedText* m_pFT_HeaderText; 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; m_xORB;
public: public:
OGenericAdministrationPage(Window* _pParent, const ResId& _rId, const SfxItemSet& _rAttrSet); OGenericAdministrationPage(Window* _pParent, const ResId& _rId, const SfxItemSet& _rAttrSet);
...@@ -131,7 +131,7 @@ namespace dbaui ...@@ -131,7 +131,7 @@ namespace dbaui
@param _rxORB @param _rxORB
The service factory. 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; m_xORB = _rxORB;
} }
......
...@@ -516,7 +516,7 @@ namespace dbaui ...@@ -516,7 +516,7 @@ namespace dbaui
void AdvancedSettingsDialog::PageCreated(sal_uInt16 _nId, SfxTabPage& _rPage) void AdvancedSettingsDialog::PageCreated(sal_uInt16 _nId, SfxTabPage& _rPage)
{ {
// register ourself as modified listener // 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); static_cast<OGenericAdministrationPage&>(_rPage).SetAdminDialog(this,this);
AdjustLayout(); AdjustLayout();
......
...@@ -98,7 +98,7 @@ short ODbAdminDialog::Ok() ...@@ -98,7 +98,7 @@ short ODbAdminDialog::Ok()
void ODbAdminDialog::PageCreated(sal_uInt16 _nId, SfxTabPage& _rPage) void ODbAdminDialog::PageCreated(sal_uInt16 _nId, SfxTabPage& _rPage)
{ {
// register ourself as modified listener // 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); static_cast<OGenericAdministrationPage&>(_rPage).SetAdminDialog(this,this);
AdjustLayout(); AdjustLayout();
......
...@@ -300,7 +300,7 @@ TabPage* ODbTypeWizDialog::createPage(WizardState _nState) ...@@ -300,7 +300,7 @@ TabPage* ODbTypeWizDialog::createPage(WizardState _nState)
// register ourself as modified listener // register ourself as modified listener
if ( pPage ) 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); static_cast<OGenericAdministrationPage*>(pPage)->SetAdminDialog(this,this);
// open our own resource block, as the page titles are strings local to this block // open our own resource block, as the page titles are strings local to this block
LocalResourceAccess aDummy(DLG_DATABASE_ADMINISTRATION, RSC_TABDIALOG); LocalResourceAccess aDummy(DLG_DATABASE_ADMINISTRATION, RSC_TABDIALOG);
......
...@@ -594,7 +594,7 @@ TabPage* ODbTypeWizDialogSetup::createPage(WizardState _nState) ...@@ -594,7 +594,7 @@ TabPage* ODbTypeWizDialogSetup::createPage(WizardState _nState)
if ( pPage ) 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); pPage->SetAdminDialog(this, this);
defaultButton( _nState == PAGE_DBSETUPWIZARD_FINAL ? WZB_FINISH : WZB_NEXT ); defaultButton( _nState == PAGE_DBSETUPWIZARD_FINAL ? WZB_FINISH : WZB_NEXT );
......
...@@ -271,7 +271,7 @@ DBG_NAME(OTableSubscriptionPage) ...@@ -271,7 +271,7 @@ DBG_NAME(OTableSubscriptionPage)
// the collator for the string compares // the collator for the string compares
try 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()) if (m_xCollator.is())
m_xCollator->loadDefaultCollator(Application::GetSettings().GetLanguageTag().getLocale(), 0); m_xCollator->loadDefaultCollator(Application::GetSettings().GetLanguageTag().getLocale(), 0);
} }
...@@ -295,7 +295,7 @@ DBG_NAME(OTableSubscriptionPage) ...@@ -295,7 +295,7 @@ DBG_NAME(OTableSubscriptionPage)
m_aTablesList.GetModel()->SetCompareHdl(LINK(this, OTableSubscriptionPage, OnTreeEntryCompare)); m_aTablesList.GetModel()->SetCompareHdl(LINK(this, OTableSubscriptionPage, OnTreeEntryCompare));
Reference< XDriver > xDriver; 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(); Reference<XPropertySet> xProp = m_pTablesDlg->getCurrentDataSource();
OSL_ENSURE(xProp.is(),"No data source set!"); OSL_ENSURE(xProp.is(),"No data source set!");
if ( xProp.is() ) if ( xProp.is() )
...@@ -312,7 +312,7 @@ DBG_NAME(OTableSubscriptionPage) ...@@ -312,7 +312,7 @@ DBG_NAME(OTableSubscriptionPage)
xProp->setPropertyValue( PROPERTY_TABLETYPEFILTER, makeAny( Sequence< ::rtl::OUString >() ) ); xProp->setPropertyValue( PROPERTY_TABLETYPEFILTER, makeAny( Sequence< ::rtl::OUString >() ) );
Reference< ::com::sun::star::lang::XEventListener> xEvt; 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_TABLEFILTER,aTableFilter);
xProp->setPropertyValue(PROPERTY_TABLETYPEFILTER,aTableTypeFilter); xProp->setPropertyValue(PROPERTY_TABLETYPEFILTER,aTableTypeFilter);
......
...@@ -31,8 +31,8 @@ namespace com { namespace sun { namespace star { ...@@ -31,8 +31,8 @@ namespace com { namespace sun { namespace star {
namespace beans { namespace beans {
class XPropertySet; class XPropertySet;
} }
namespace lang { namespace uno {
class XMultiServiceFactory; class XComponentContext;
} }
}}} }}}
...@@ -55,7 +55,7 @@ class ODbDataSourceAdministrationHelper; ...@@ -55,7 +55,7 @@ class ODbDataSourceAdministrationHelper;
OTableSubscriptionDialog(Window* pParent OTableSubscriptionDialog(Window* pParent
,SfxItemSet* _pItems ,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 ,const ::com::sun::star::uno::Any& _aDataSourceName
); );
virtual ~OTableSubscriptionDialog(); virtual ~OTableSubscriptionDialog();
......
...@@ -107,7 +107,7 @@ Reference<XPropertySetInfo> SAL_CALL OTableFilterDialog::getPropertySetInfo() t ...@@ -107,7 +107,7 @@ Reference<XPropertySetInfo> SAL_CALL OTableFilterDialog::getPropertySetInfo() t
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
Dialog* OTableFilterDialog::createDialog(Window* _pParent) 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; return pDlg;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment