Kaydet (Commit) 0f627e06 authored tarafından Noel Grandin's avatar Noel Grandin

fdo#46808, Convert form::TabOrderDialog service to new style

The service already existed, it just needed an IDL file.

Change-Id: I10219da7292db5e746a89028ddc4fabb069ac388
üst 30dd9b2f
......@@ -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>
......@@ -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
//........................................................................
......
......@@ -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();
......
......@@ -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 \
......
/* -*- 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: */
......@@ -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& )
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment