From 77d215ae2ed9bd08444a5128729066b6025bef27 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 4 Jan 2013 11:20:21 +0200 Subject: fdo#46808, use new method OConfigurationTreeRoot::createWithComponentContext .. everywhere that was using createWithServiceFactory, and delete the old method. Change-Id: I02cb2bfbcc2390494383579d2f14caa4fc5b8014 --- extensions/source/abpilot/abspilot.cxx | 9 +++++---- extensions/source/abpilot/fieldmappingimpl.cxx | 24 ++++++++++++------------ extensions/source/abpilot/fieldmappingimpl.hxx | 11 +++++++---- extensions/source/propctrlr/propertyhandler.cxx | 4 ++-- 4 files changed, 26 insertions(+), 22 deletions(-) (limited to 'extensions') diff --git a/extensions/source/abpilot/abspilot.cxx b/extensions/source/abpilot/abspilot.cxx index 236a05cace52..f6789bb08dc8 100644 --- a/extensions/source/abpilot/abspilot.cxx +++ b/extensions/source/abpilot/abspilot.cxx @@ -21,6 +21,7 @@ #include "abpilot.hrc" #include "abpresid.hrc" #include "componentmodule.hxx" +#include #include #include #include "typeselectionpage.hxx" @@ -171,10 +172,10 @@ namespace abp m_aNewDataSource.registerDataSource(m_aSettings.sRegisteredDataSourceName); // 3. write the data source / table names into the configuration - addressconfig::writeTemplateAddressSource( getORB(), m_aSettings.bRegisterDataSource ? m_aSettings.sRegisteredDataSourceName : m_aSettings.sDataSourceName, m_aSettings.sSelectedTable ); + addressconfig::writeTemplateAddressSource( comphelper::getComponentContext(getORB()), m_aSettings.bRegisterDataSource ? m_aSettings.sRegisteredDataSourceName : m_aSettings.sDataSourceName, m_aSettings.sSelectedTable ); // 4. write the field mapping - fieldmapping::writeTemplateAddressFieldMapping( getORB(), m_aSettings.aFieldMapping ); + fieldmapping::writeTemplateAddressFieldMapping( comphelper::getComponentContext(getORB()), m_aSettings.aFieldMapping ); } //--------------------------------------------------------------------- @@ -214,7 +215,7 @@ namespace abp implCommitAll(); - addressconfig::markPilotSuccess( getORB() ); + addressconfig::markPilotSuccess( comphelper::getComponentContext(getORB()) ); return sal_True; } @@ -326,7 +327,7 @@ namespace abp { DBG_ASSERT( !needManualFieldMapping( ), "OAddessBookSourcePilot::implDoAutoFieldMapping: invalid call!" ); - fieldmapping::defaultMapping( getORB(), m_aSettings.aFieldMapping ); + fieldmapping::defaultMapping( comphelper::getComponentContext(getORB()), m_aSettings.aFieldMapping ); } //--------------------------------------------------------------------- diff --git a/extensions/source/abpilot/fieldmappingimpl.cxx b/extensions/source/abpilot/fieldmappingimpl.cxx index dbea7040b9dd..e4e20f84dbd2 100644 --- a/extensions/source/abpilot/fieldmappingimpl.cxx +++ b/extensions/source/abpilot/fieldmappingimpl.cxx @@ -143,7 +143,7 @@ namespace abp } //----------------------------------------------------------------- - void defaultMapping( const Reference< XMultiServiceFactory >& _rxORB, MapString2String& _rFieldAssignment ) SAL_THROW ( ( ) ) + void defaultMapping( const Reference< XComponentContext >& _rxContext, MapString2String& _rFieldAssignment ) SAL_THROW ( ( ) ) { _rFieldAssignment.clear(); @@ -191,8 +191,8 @@ namespace abp sDriverAliasesNodeName += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "/ColumnAliases" )); // create a config node for this - OConfigurationTreeRoot aDriverFieldAliasing = OConfigurationTreeRoot::createWithServiceFactory( - _rxORB, sDriverAliasesNodeName, -1, OConfigurationTreeRoot::CM_READONLY); + OConfigurationTreeRoot aDriverFieldAliasing = OConfigurationTreeRoot::createWithComponentContext( + _rxContext, sDriverAliasesNodeName, -1, OConfigurationTreeRoot::CM_READONLY); // loop through all programmatic pairs DBG_ASSERT( 0 == SAL_N_ELEMENTS( pMappingProgrammatics ) % 2, @@ -236,7 +236,7 @@ namespace abp } //----------------------------------------------------------------- - void writeTemplateAddressFieldMapping( const Reference< XMultiServiceFactory >& _rxORB, const MapString2String& _rFieldAssignment ) SAL_THROW ( ( ) ) + void writeTemplateAddressFieldMapping( const Reference< XComponentContext >& _rxContext, const MapString2String& _rFieldAssignment ) SAL_THROW ( ( ) ) { // want to have a non-const map for easier handling MapString2String aFieldAssignment( _rFieldAssignment ); @@ -245,8 +245,8 @@ namespace abp const ::rtl::OUString& sAddressBookNodeName = lcl_getAddressBookNodeName(); // create a config node for this - OConfigurationTreeRoot aAddressBookSettings = OConfigurationTreeRoot::createWithServiceFactory( - _rxORB, sAddressBookNodeName, -1, OConfigurationTreeRoot::CM_UPDATABLE); + OConfigurationTreeRoot aAddressBookSettings = OConfigurationTreeRoot::createWithComponentContext( + _rxContext, sAddressBookNodeName, -1, OConfigurationTreeRoot::CM_UPDATABLE); OConfigurationNode aFields = aAddressBookSettings.openNode( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Fields" )) ); @@ -315,15 +315,15 @@ namespace abp //..................................................................... //----------------------------------------------------------------- - void writeTemplateAddressSource( const Reference< XMultiServiceFactory >& _rxORB, + void writeTemplateAddressSource( const Reference< XComponentContext >& _rxContext, const ::rtl::OUString& _rDataSourceName, const ::rtl::OUString& _rTableName ) SAL_THROW ( ( ) ) { // access the configuration information which the driver uses for determining it's column names const ::rtl::OUString& sAddressBookNodeName = lcl_getAddressBookNodeName(); // create a config node for this - OConfigurationTreeRoot aAddressBookSettings = OConfigurationTreeRoot::createWithServiceFactory( - _rxORB, sAddressBookNodeName, -1, OConfigurationTreeRoot::CM_UPDATABLE); + OConfigurationTreeRoot aAddressBookSettings = OConfigurationTreeRoot::createWithComponentContext( + _rxContext, sAddressBookNodeName, -1, OConfigurationTreeRoot::CM_UPDATABLE); aAddressBookSettings.setNodeValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "DataSourceName" )), makeAny( _rDataSourceName ) ); aAddressBookSettings.setNodeValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Command" )), makeAny( _rTableName ) ); @@ -334,14 +334,14 @@ namespace abp } //----------------------------------------------------------------- - void markPilotSuccess( const Reference< XMultiServiceFactory >& _rxORB ) SAL_THROW ( ( ) ) + void markPilotSuccess( const Reference< XComponentContext >& _rxContext ) SAL_THROW ( ( ) ) { // access the configuration information which the driver uses for determining it's column names const ::rtl::OUString& sAddressBookNodeName = lcl_getAddressBookNodeName(); // create a config node for this - OConfigurationTreeRoot aAddressBookSettings = OConfigurationTreeRoot::createWithServiceFactory( - _rxORB, sAddressBookNodeName, -1, OConfigurationTreeRoot::CM_UPDATABLE); + OConfigurationTreeRoot aAddressBookSettings = OConfigurationTreeRoot::createWithComponentContext( + _rxContext, sAddressBookNodeName, -1, OConfigurationTreeRoot::CM_UPDATABLE); // set the flag aAddressBookSettings.setNodeValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "AutoPilotCompleted" )), makeAny( (sal_Bool)sal_True ) ); diff --git a/extensions/source/abpilot/fieldmappingimpl.hxx b/extensions/source/abpilot/fieldmappingimpl.hxx index c6d0e2a7ec75..ffafaec1ac29 100644 --- a/extensions/source/abpilot/fieldmappingimpl.hxx +++ b/extensions/source/abpilot/fieldmappingimpl.hxx @@ -29,6 +29,9 @@ namespace com { namespace sun { namespace star { namespace lang { class XMultiServiceFactory; } + namespace uno { + class XComponentContext; + } namespace beans { class XPropertySet; } @@ -69,7 +72,7 @@ namespace abp and this function creates a mapping which uses this configuration information.

*/ void defaultMapping( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB, + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext, MapString2String& /* [out] */ _rFieldAssignment ) SAL_THROW ( ( ) ); @@ -77,7 +80,7 @@ namespace abp /** writes a field mapping for the template document address source */ void writeTemplateAddressFieldMapping( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB, + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext, const MapString2String& _rFieldAssignment ) SAL_THROW ( ( ) ); @@ -95,7 +98,7 @@ namespace abp expect it. */ void writeTemplateAddressSource( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB, + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext, const ::rtl::OUString& _rDataSourceName, const ::rtl::OUString& _rTableName ) SAL_THROW ( ( ) ); @@ -103,7 +106,7 @@ namespace abp /** writes the configuration entry which states the the pilot has been completed successfully */ void markPilotSuccess( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext ) SAL_THROW ( ( ) ); //..................................................................... diff --git a/extensions/source/propctrlr/propertyhandler.cxx b/extensions/source/propctrlr/propertyhandler.cxx index 1bedb7c889c6..54a50c0476ba 100644 --- a/extensions/source/propctrlr/propertyhandler.cxx +++ b/extensions/source/propctrlr/propertyhandler.cxx @@ -406,8 +406,8 @@ namespace pcr // read the measurement unit from the configuration if ( !(sConfigurationLocation.isEmpty() || sConfigurationProperty.isEmpty()) ) { - ::utl::OConfigurationTreeRoot aConfigTree( ::utl::OConfigurationTreeRoot::createWithServiceFactory( - m_aContext.getLegacyServiceFactory(), sConfigurationLocation, -1, ::utl::OConfigurationTreeRoot::CM_READONLY ) ); + ::utl::OConfigurationTreeRoot aConfigTree( ::utl::OConfigurationTreeRoot::createWithComponentContext( + m_aContext.getUNOContext(), sConfigurationLocation, -1, ::utl::OConfigurationTreeRoot::CM_READONLY ) ); sal_Int32 nUnitAsInt = (sal_Int32)FUNIT_NONE; aConfigTree.getNodeValue( sConfigurationProperty ) >>= nUnitAsInt; -- cgit