diff options
author | Noel Grandin <noel@peralex.com> | 2013-03-26 14:42:37 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-04-23 16:05:55 +0200 |
commit | 6dd58cd811f888aa2158242f08bed5ce9e8fd340 (patch) | |
tree | 80664c1e3c2e4dbbd61c657fa9c0d40a50d07c23 | |
parent | 30c466d395aaa4d0516adca739dd5907607be027 (diff) |
fdo#46808, remove unnecessary XMultiServiceFactory from svx::ControllerFeatures
all of the callers sites are using getProcessServiceFactory(),
so no need to store it in instance field
-rw-r--r-- | svx/source/form/fmshimp.cxx | 6 | ||||
-rw-r--r-- | svx/source/form/formcontrolling.cxx | 24 | ||||
-rw-r--r-- | svx/source/inc/formcontrolling.hxx | 15 |
3 files changed, 13 insertions, 32 deletions
diff --git a/svx/source/form/fmshimp.cxx b/svx/source/form/fmshimp.cxx index 013861e097eb..6beaa7b279eb 100644 --- a/svx/source/form/fmshimp.cxx +++ b/svx/source/form/fmshimp.cxx @@ -645,8 +645,8 @@ FmXFormShell::FmXFormShell( FmFormShell& _rShell, SfxViewFrame* _pViewFrame ) ,m_nActivationEvent( 0 ) ,m_pShell( &_rShell ) ,m_pTextShell( new ::svx::FmTextControlShell( _pViewFrame ) ) - ,m_aActiveControllerFeatures( ::comphelper::getProcessServiceFactory(), this ) - ,m_aNavControllerFeatures( ::comphelper::getProcessServiceFactory(), this ) + ,m_aActiveControllerFeatures( this ) + ,m_aNavControllerFeatures( this ) ,m_eDocumentType( eUnknownDocumentType ) ,m_nLockSlotInvalidation( 0 ) ,m_bHadPropertyBrowserInDesignMode( sal_False ) @@ -3266,7 +3266,7 @@ void FmXFormShell::CreateExternalView() if ( m_xExternalViewController == getActiveController() ) { Reference< runtime::XFormController > xAsFormController( m_xExternalViewController, UNO_QUERY ); - ControllerFeatures aHelper( ::comphelper::getProcessServiceFactory(), xAsFormController, NULL ); + ControllerFeatures aHelper( xAsFormController, NULL ); aHelper->commitCurrentControl(); } diff --git a/svx/source/form/formcontrolling.cxx b/svx/source/form/formcontrolling.cxx index b86a38100f5e..b344483c1748 100644 --- a/svx/source/form/formcontrolling.cxx +++ b/svx/source/form/formcontrolling.cxx @@ -32,6 +32,7 @@ #include <tools/diagnose_ex.h> #include <comphelper/anytostring.hxx> +#include <comphelper/processfactory.hxx> #include <cppuhelper/exc_hlp.hxx> #include <osl/diagnose.h> @@ -44,7 +45,7 @@ namespace svx //........................................................................ using ::com::sun::star::uno::Reference; - using ::com::sun::star::lang::XMultiServiceFactory; + using ::com::sun::star::uno::XComponentContext; using ::com::sun::star::form::runtime::XFormController; using ::com::sun::star::form::XForm; using ::com::sun::star::form::runtime::FormOperations; @@ -195,18 +196,15 @@ namespace svx //= ControllerFeatures //==================================================================== //-------------------------------------------------------------------- - ControllerFeatures::ControllerFeatures( const Reference< XMultiServiceFactory >& _rxORB, IControllerFeatureInvalidation* _pInvalidationCallback ) - :m_aContext( _rxORB ) - ,m_pInvalidationCallback( _pInvalidationCallback ) + ControllerFeatures::ControllerFeatures( IControllerFeatureInvalidation* _pInvalidationCallback ) + :m_pInvalidationCallback( _pInvalidationCallback ) ,m_pImpl( NULL ) { } //-------------------------------------------------------------------- - ControllerFeatures::ControllerFeatures( const Reference< XMultiServiceFactory >& _rxORB, - const Reference< XFormController >& _rxController, IControllerFeatureInvalidation* _pInvalidationCallback ) - :m_aContext( _rxORB ) - ,m_pInvalidationCallback( _pInvalidationCallback ) + ControllerFeatures::ControllerFeatures( const Reference< XFormController >& _rxController, IControllerFeatureInvalidation* _pInvalidationCallback ) + :m_pInvalidationCallback( _pInvalidationCallback ) ,m_pImpl( NULL ) { assign( _rxController ); @@ -216,7 +214,7 @@ namespace svx void ControllerFeatures::assign( const Reference< XFormController >& _rxController ) { dispose(); - m_pImpl = new FormControllerHelper( m_aContext, _rxController, m_pInvalidationCallback ); + m_pImpl = new FormControllerHelper( _rxController, m_pInvalidationCallback ); m_pImpl->acquire(); } @@ -241,15 +239,13 @@ namespace svx //= FormControllerHelper //==================================================================== //-------------------------------------------------------------------- - FormControllerHelper::FormControllerHelper( const ::comphelper::ComponentContext& _rContext, - const Reference< XFormController >& _rxController, IControllerFeatureInvalidation* _pInvalidationCallback ) - :m_aContext( _rContext ) - ,m_pInvalidationCallback( _pInvalidationCallback ) + FormControllerHelper::FormControllerHelper( const Reference< XFormController >& _rxController, IControllerFeatureInvalidation* _pInvalidationCallback ) + :m_pInvalidationCallback( _pInvalidationCallback ) { osl_atomic_increment( &m_refCount ); try { - m_xFormOperations = FormOperations::createWithFormController( m_aContext.getUNOContext(), _rxController ); + m_xFormOperations = FormOperations::createWithFormController( comphelper::getProcessComponentContext(), _rxController ); if ( m_xFormOperations.is() ) m_xFormOperations->setFeatureInvalidation( this ); diff --git a/svx/source/inc/formcontrolling.hxx b/svx/source/inc/formcontrolling.hxx index 7f08fbea818a..065a7c093921 100644 --- a/svx/source/inc/formcontrolling.hxx +++ b/svx/source/inc/formcontrolling.hxx @@ -22,13 +22,11 @@ #include <com/sun/star/form/runtime/XFormController.hpp> #include <com/sun/star/form/XForm.hpp> -#include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/form/runtime/FeatureState.hpp> #include <com/sun/star/form/runtime/XFormOperations.hpp> #include <com/sun/star/sdb/XSQLErrorListener.hpp> #include <cppuhelper/implbase2.hxx> -#include <comphelper/componentcontext.hxx> #include <vector> @@ -83,7 +81,6 @@ namespace svx class ControllerFeatures { protected: - ::comphelper::ComponentContext m_aContext; IControllerFeatureInvalidation* m_pInvalidationCallback; // necessary as long as m_pImpl is not yet constructed FormControllerHelper* m_pImpl; @@ -92,22 +89,15 @@ namespace svx The instance is not functional until <method>assign</method> is used. - @param _rxORB - a multi service factory for creating various needed components - @param _pInvalidationCallback the callback for invalidating feature states */ ControllerFeatures( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB, IControllerFeatureInvalidation* _pInvalidationCallback ); /** constructs the instance from a <type scope="com::sun::star::form::runtime">XFormController<type> instance - @param _rxORB - a multi service factory for creating various needed components - @param _rxController The form controller which the helper should be responsible for. Must not be <NULL/>, and must have a valid model (form). @@ -116,7 +106,6 @@ namespace svx the callback for invalidating feature states */ ControllerFeatures( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB, const ::com::sun::star::uno::Reference< ::com::sun::star::form::runtime::XFormController >& _rxController, IControllerFeatureInvalidation* _pInvalidationCallback ); @@ -159,7 +148,6 @@ namespace svx class FormControllerHelper : public FormControllerHelper_Base { protected: - ::comphelper::ComponentContext m_aContext; IControllerFeatureInvalidation* m_pInvalidationCallback; ::com::sun::star::uno::Reference< ::com::sun::star::form::runtime::XFormOperations > m_xFormOperations; @@ -169,8 +157,6 @@ namespace svx public: /** constructs the helper from a <type scope="com::sun::star::form::runtime">XFormController<type> instance - @param _rContext - the context the component lives in @param _rxController The form controller which the helper should be responsible for. Must not be <NULL/>, and must have a valid model (form). @@ -178,7 +164,6 @@ namespace svx the callback for invalidating feature states */ FormControllerHelper( - const ::comphelper::ComponentContext& _rContext, const ::com::sun::star::uno::Reference< ::com::sun::star::form::runtime::XFormController >& _rxController, IControllerFeatureInvalidation* _pInvalidationCallback ); |