summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-01-31 18:02:02 +0200
committerNoel Grandin <noel@peralex.com>2013-02-11 08:02:18 +0200
commite7a76a0e65a185c3ac0ef041f7e6957d3f8b655b (patch)
tree5f3ffccac0b0de52a551075abe31de0f2ce3b9bd /svx
parent5d0b2b011ff2f141db452ffef84c3a77efbd6e7b (diff)
fdo#46808, convert form::runtime::FormController to new-style
Change-Id: Ied761cbb8e23d65596a5fdc4650e1cd2c95e9245
Diffstat (limited to 'svx')
-rw-r--r--svx/source/form/fmservs.cxx2
-rw-r--r--svx/source/form/fmvwimp.cxx9
-rw-r--r--svx/source/form/formcontroller.cxx2
-rw-r--r--svx/source/form/legacyformcontroller.cxx11
-rw-r--r--svx/source/inc/fmservs.hxx1
5 files changed, 12 insertions, 13 deletions
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 <com/sun/star/form/XReset.hpp>
#include <com/sun/star/form/binding/XBindableValue.hpp>
#include <com/sun/star/form/binding/XValueBinding.hpp>
+#include <com/sun/star/form/runtime/FormController.hpp>
#include <com/sun/star/form/submission/XSubmissionSupplier.hpp>
#include <com/sun/star/awt/XTabControllerModel.hpp>
#include <com/sun/star/awt/XControlContainer.hpp>
@@ -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 <com/sun/star/form/XFormController.hpp>
-#include <com/sun/star/form/runtime/XFormController.hpp>
+#include <com/sun/star/form/runtime/FormController.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <cppuhelper/implbase2.hxx>
+#include <comphelper/processfactory.hxx>
//........................................................................
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" ) )