diff options
author | Noel Grandin <noel@peralex.com> | 2013-05-29 14:59:49 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-06-03 10:00:00 +0200 |
commit | 0f627e06c93e85de02a69a225b66be430bcbea36 (patch) | |
tree | fb960a7b2378e07c96a286661bc958637142d9eb | |
parent | 30dd9b2ff564e90a415603694b07b6c43491787c (diff) |
fdo#46808, Convert form::TabOrderDialog service to new style
The service already existed, it just needed an IDL file.
Change-Id: I10219da7292db5e746a89028ddc4fabb069ac388
-rw-r--r-- | extensions/source/propctrlr/pcr.component | 1 | ||||
-rw-r--r-- | extensions/source/propctrlr/pcrunodialogs.cxx | 31 | ||||
-rw-r--r-- | extensions/source/propctrlr/pcrunodialogs.hxx | 3 | ||||
-rw-r--r-- | offapi/UnoApi_offapi.mk | 1 | ||||
-rw-r--r-- | offapi/com/sun/star/form/TabOrderDialog.idl | 46 | ||||
-rw-r--r-- | svx/source/form/fmshimp.cxx | 30 |
6 files changed, 87 insertions, 25 deletions
diff --git a/extensions/source/propctrlr/pcr.component b/extensions/source/propctrlr/pcr.component index c0e466b6e603..a070985819c8 100644 --- a/extensions/source/propctrlr/pcr.component +++ b/extensions/source/propctrlr/pcr.component @@ -78,5 +78,6 @@ </implementation> <implementation name="org.openoffice.comp.form.ui.OTabOrderDialog"> <service name="com.sun.star.form.ui.TabOrderDialog"/> + <service name="com.sun.star.form.TabOrderDialog"/> </implementation> </component> diff --git a/extensions/source/propctrlr/pcrunodialogs.cxx b/extensions/source/propctrlr/pcrunodialogs.cxx index adf013ef2fc7..117b6ac6814c 100644 --- a/extensions/source/propctrlr/pcrunodialogs.cxx +++ b/extensions/source/propctrlr/pcrunodialogs.cxx @@ -98,8 +98,9 @@ namespace pcr //--------------------------------------------------------------------- ::comphelper::StringSequence OTabOrderDialog::getSupportedServiceNames_static() throw(RuntimeException) { - ::comphelper::StringSequence aSupported(1); + ::comphelper::StringSequence aSupported(2); aSupported.getArray()[0] = OUString( "com.sun.star.form.ui.TabOrderDialog" ); + aSupported.getArray()[1] = OUString( "com.sun.star.form.TabOrderDialog" ); return aSupported; } @@ -130,6 +131,34 @@ namespace pcr return new TabOrderDialog( _pParent, m_xTabbingModel, m_xControlContext, m_aContext ); } + void OTabOrderDialog::initialize( const Sequence< Any >& aArguments ) throw(Exception, RuntimeException) + { + Reference<css::awt::XTabControllerModel> xTabbingModel; + Reference<css::awt::XControlContainer> xControlContext; + Reference<css::awt::XWindow> xParentWindow; + if (aArguments.getLength() == 3 && (aArguments[0] >>= xTabbingModel) && (aArguments[1] >>= xControlContext) && (aArguments[2] >>= xParentWindow)) + { + Sequence< Any > aNewArguments( 3 ); + aNewArguments[0] <<= NamedValue( + OUString( "TabbingModel" ), + makeAny( xTabbingModel ) + ); + aNewArguments[1] <<= NamedValue( + OUString( "ControlContext" ), + makeAny( xControlContext ) + ); + aNewArguments[2] <<= NamedValue( + OUString( "ParentWindow" ), + makeAny( xParentWindow ) + ); + OTabOrderDialog_DBase::initialize(aNewArguments); + } + else + OTabOrderDialog_DBase::initialize(aArguments); + } + + + //........................................................................ } // namespace pcr //........................................................................ diff --git a/extensions/source/propctrlr/pcrunodialogs.hxx b/extensions/source/propctrlr/pcrunodialogs.hxx index 8c10693aa711..c401cccf2661 100644 --- a/extensions/source/propctrlr/pcrunodialogs.hxx +++ b/extensions/source/propctrlr/pcrunodialogs.hxx @@ -66,6 +66,9 @@ namespace pcr static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL Create(const ::com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >&); + // XInitialization + virtual void SAL_CALL initialize( const com::sun::star::uno::Sequence< com::sun::star::uno::Any >& aArguments ) throw(::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException); + // XPropertySet virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException); virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk index 7d44fc52e7ea..fc572896fe0f 100644 --- a/offapi/UnoApi_offapi.mk +++ b/offapi/UnoApi_offapi.mk @@ -173,6 +173,7 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/embed,\ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/form,\ ControlFontDialog \ Forms \ + TabOrderDialog \ )) $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/form/control,\ FilterControl \ diff --git a/offapi/com/sun/star/form/TabOrderDialog.idl b/offapi/com/sun/star/form/TabOrderDialog.idl new file mode 100644 index 000000000000..bbe96007144e --- /dev/null +++ b/offapi/com/sun/star/form/TabOrderDialog.idl @@ -0,0 +1,46 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_form_TabOrderDialog_idl__ +#define __com_sun_star_form_TabOrderDialog_idl__ + +#include <com/sun/star/awt/XTabControllerModel.idl> +#include <com/sun/star/awt/XControlContainer.idl> +#include <com/sun/star/awt/XWindow.idl> +#include <com/sun/star/ui/dialogs/XExecutableDialog.idl> + + + +module com { module sun { module star { module form { + + +/** + @since LibreOffice 4.2 + */ +published service TabOrderDialog : com::sun::star::ui::dialogs::XExecutableDialog +{ + createWithModel([in] com::sun::star::awt::XTabControllerModel TabbingModel, + [in] com::sun::star::awt::XControlContainer ControlContext, + [in] com::sun::star::awt::XWindow ParentWindow); +}; + +}; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/form/fmshimp.cxx b/svx/source/form/fmshimp.cxx index 1a38d5018beb..854d8f1d41a3 100644 --- a/svx/source/form/fmshimp.cxx +++ b/svx/source/form/fmshimp.cxx @@ -60,6 +60,7 @@ #include <com/sun/star/container/XIndexAccess.hpp> #include <com/sun/star/container/XNamed.hpp> #include <com/sun/star/form/ListSourceType.hpp> +#include <com/sun/star/form/TabOrderDialog.hpp> #include <com/sun/star/form/XBoundComponent.hpp> #include <com/sun/star/form/XBoundControl.hpp> #include <com/sun/star/form/XGrid.hpp> @@ -1472,35 +1473,16 @@ void FmXFormShell::ExecuteTabOrderDialog( const Reference< XTabControllerModel > try { - Sequence< Any > aDialogArgs( 3 ); - aDialogArgs[0] <<= NamedValue( - OUString( "TabbingModel" ), - makeAny( _rxForForm ) - ); - aDialogArgs[1] <<= NamedValue( - OUString( "ControlContext" ), - makeAny( getControlContainerForView() ) - ); - Reference< XWindow > xParentWindow; if ( m_pShell->GetViewShell() && m_pShell->GetViewShell()->GetViewFrame() ) xParentWindow = VCLUnoHelper::GetInterface ( &m_pShell->GetViewShell()->GetViewFrame()->GetWindow() ); - aDialogArgs[2] <<= NamedValue( - OUString( "ParentWindow" ), - makeAny( xParentWindow ) - ); - Reference< dialogs::XExecutableDialog > xDialog( - ::comphelper::getProcessServiceFactory()->createInstanceWithArguments( - OUString( "com.sun.star.form.ui.TabOrderDialog" ), - aDialogArgs - ), - UNO_QUERY - ); - OSL_ENSURE( xDialog.is(), "FmXFormShell::ExecuteTabOrderDialog: could not create the dialog!" ); + Reference< dialogs::XExecutableDialog > xDialog = form::TabOrderDialog::createWithModel( + comphelper::getProcessComponentContext(), + _rxForForm, getControlContainerForView(), xParentWindow + ); - if ( xDialog.is() ) - xDialog->execute(); + xDialog->execute(); } catch( const Exception& ) { |