diff --git a/extensions/source/bibliography/datman.cxx b/extensions/source/bibliography/datman.cxx index 93b42303a0ad..a3667b119941 100644 --- a/extensions/source/bibliography/datman.cxx +++ b/extensions/source/bibliography/datman.cxx @@ -38,6 +38,7 @@ #include #include #include +#include #include #include #include @@ -1641,9 +1642,8 @@ uno::Reference< form::runtime::XFormController > BibDataManager::GetFormControll { if(!m_xFormCtrl.is()) { - Reference< lang::XMultiServiceFactory > xMgr = comphelper::getProcessServiceFactory(); - m_xFormCtrl = uno::Reference< form::runtime::XFormController > ( - xMgr->createInstance("com.sun.star.form.runtime.FormController"), UNO_QUERY); + Reference< uno::XComponentContext > xContext = comphelper::getProcessComponentContext(); + m_xFormCtrl = form::runtime::FormController::create(xContext); m_xFormCtrl->setModel(uno::Reference< awt::XTabControllerModel > (getForm(), UNO_QUERY)); m_xFormDispatch = uno::Reference< frame::XDispatch > ( m_xFormCtrl, UNO_QUERY); } diff --git a/extensions/source/propctrlr/eventhandler.cxx b/extensions/source/propctrlr/eventhandler.cxx index 73a6016d1407..7e8a02045af3 100644 --- a/extensions/source/propctrlr/eventhandler.cxx +++ b/extensions/source/propctrlr/eventhandler.cxx @@ -41,7 +41,7 @@ #include #include #include -#include +#include #include #include #include @@ -107,6 +107,7 @@ namespace pcr using ::com::sun::star::container::XNameContainer; using ::com::sun::star::awt::XTabControllerModel; using ::com::sun::star::form::XForm; + using ::com::sun::star::form::runtime::FormController; using ::com::sun::star::form::runtime::XFormController; using ::com::sun::star::beans::UnknownPropertyException; using ::com::sun::star::uno::makeAny; @@ -1110,8 +1111,7 @@ namespace pcr if ( xComponentAsForm.is() ) { Reference< XTabControllerModel > xComponentAsTCModel( m_xComponent, UNO_QUERY_THROW ); - Reference< XFormController > xController( - m_aContext.createComponent( "com.sun.star.form.runtime.FormController" ), UNO_QUERY_THROW ); + Reference< XFormController > xController = FormController::create( m_aContext.getUNOContext() ); xController->setModel( xComponentAsTCModel ); xReturn = xController; diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk index 1ef0fec977ae..96877642bbab 100644 --- a/offapi/UnoApi_offapi.mk +++ b/offapi/UnoApi_offapi.mk @@ -136,6 +136,7 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/form/inspe DefaultFormComponentInspectorModel \ )) $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/form/runtime,\ + FormController \ FormOperations \ )) $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/frame,\ @@ -841,9 +842,6 @@ $(eval $(call gb_UnoApi_add_idlfiles_noheader,offapi,offapi/com/sun/star/form/in XMLFormsPropertyHandler \ XSDValidationPropertyHandler \ )) -$(eval $(call gb_UnoApi_add_idlfiles_noheader,offapi,offapi/com/sun/star/form/runtime,\ - FormController \ -)) $(eval $(call gb_UnoApi_add_idlfiles_noheader,offapi,offapi/com/sun/star/form/validation,\ ValidatableBindableControlModel \ ValidatableControlModel \ diff --git a/offapi/com/sun/star/form/runtime/FormController.idl b/offapi/com/sun/star/form/runtime/FormController.idl index 1f9234469039..48eaa6fedbce 100644 --- a/offapi/com/sun/star/form/runtime/FormController.idl +++ b/offapi/com/sun/star/form/runtime/FormController.idl @@ -29,10 +29,7 @@ module com { module sun { module star { module form { module runtime { /** specifies a component controlling the interaction between the user and multiple form controls belonging to a single form. */ -service FormController -{ - interface XFormController; -}; +service FormController : XFormController; }; }; }; }; }; diff --git a/svx/source/form/fmservs.cxx b/svx/source/form/fmservs.cxx index 05643178b567..e230a3fa4797 100644 --- a/svx/source/form/fmservs.cxx +++ b/svx/source/form/fmservs.cxx @@ -79,7 +79,7 @@ namespace svxform // ------------------------------------------------------------------------ // FormController - REGISTER_SERVICE( FormController, FM_FORM_CONTROLLER ); + REGISTER_SERVICE( FormController, OUString( "com.sun.star.form.runtime.FormController" ) ); REGISTER_SERVICE( LegacyFormController, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.FormController" ) ) ); // ------------------------------------------------------------------------ diff --git a/svx/source/form/fmvwimp.cxx b/svx/source/form/fmvwimp.cxx index 8643daa0f511..938c69ef47ff 100644 --- a/svx/source/form/fmvwimp.cxx +++ b/svx/source/form/fmvwimp.cxx @@ -59,6 +59,7 @@ #include #include #include +#include #include #include #include @@ -110,6 +111,7 @@ using namespace ::svxform; using ::com::sun::star::lang::XComponent; using ::com::sun::star::container::XIndexAccess; using ::com::sun::star::form::XForm; + using ::com::sun::star::form::runtime::FormController; using ::com::sun::star::form::runtime::XFormController; using ::com::sun::star::script::XEventAttacherManager; using ::com::sun::star::awt::XTabControllerModel; @@ -340,12 +342,7 @@ void FormViewPageWindowAdapter::setController(const Reference< XForm > & xForm, Reference< XTabControllerModel > xTabOrder(xForm, UNO_QUERY); // create a form controller - Reference< XFormController > xController( m_aContext.createComponent( FM_FORM_CONTROLLER ), UNO_QUERY ); - if ( !xController.is() ) - { - ShowServiceNotAvailableError( m_pWindow, FM_FORM_CONTROLLER, sal_True ); - return; - } + Reference< XFormController > xController( FormController::create(m_aContext.getUNOContext()) ); Reference< XInteractionHandler > xHandler; if ( _rxParentController.is() ) diff --git a/svx/source/form/formcontroller.cxx b/svx/source/form/formcontroller.cxx index 8de569787d1b..05f5d3fce784 100644 --- a/svx/source/form/formcontroller.cxx +++ b/svx/source/form/formcontroller.cxx @@ -739,7 +739,7 @@ Sequence< ::rtl::OUString> FormController::getSupportedServiceNames_Static(void) if (!aServices.getLength()) { aServices.realloc(2); - aServices.getArray()[0] = FM_FORM_CONTROLLER; + aServices.getArray()[0] = OUString( "com.sun.star.form.runtime.FormController" ); aServices.getArray()[1] = ::rtl::OUString("com.sun.star.awt.control.TabController"); } return aServices; diff --git a/svx/source/form/legacyformcontroller.cxx b/svx/source/form/legacyformcontroller.cxx index 2ce46783ce71..b3f0641e9ef8 100644 --- a/svx/source/form/legacyformcontroller.cxx +++ b/svx/source/form/legacyformcontroller.cxx @@ -21,11 +21,12 @@ #include "fmservs.hxx" #include -#include +#include #include #include #include +#include //........................................................................ namespace svxform @@ -44,11 +45,13 @@ namespace svxform 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::lang::XMultiServiceFactory; using ::com::sun::star::awt::XControl; using ::com::sun::star::awt::XTabControllerModel; using ::com::sun::star::awt::XControlContainer; using ::com::sun::star::lang::XServiceInfo; + using ::com::sun::star::form::runtime::FormController; /** === end UNO using === **/ using namespace ::com::sun::star; @@ -70,12 +73,12 @@ namespace svxform public: static Reference< XInterface > Create( const Reference< XMultiServiceFactory >& _rxFactory ) { - return *( new LegacyFormController( _rxFactory ) ); + return *( new LegacyFormController( comphelper::getComponentContext(_rxFactory) ) ); } protected: - LegacyFormController( const Reference< XMultiServiceFactory >& _rxFactory ) - :m_xDelegator( _rxFactory->createInstance( FM_FORM_CONTROLLER ), UNO_QUERY_THROW ) + LegacyFormController( const Reference< XComponentContext >& _rxContext ) + :m_xDelegator( FormController::create(_rxContext) ) { } diff --git a/svx/source/inc/fmservs.hxx b/svx/source/inc/fmservs.hxx index 61ad6dc6150b..62705b641393 100644 --- a/svx/source/inc/fmservs.hxx +++ b/svx/source/inc/fmservs.hxx @@ -45,7 +45,6 @@ #define FM_COMPONENT_IMAGECONTROL rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.component.ImageControl" ) ) #define FM_CONTROL_GRID rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.control.Grid" ) ) #define FM_CONTROL_GRIDCONTROL rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.control.GridControl" ) ) -#define FM_FORM_CONTROLLER rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.runtime.FormController" ) ) #define SRV_SDB_CONNECTION rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.sdb.Connection" ) ) #define FM_SUN_COMPONENT_FORM rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.Form" ) ) #define FM_SUN_COMPONENT_TEXTFIELD rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.TextField" ) )