Kaydet (Commit) 73adc9b6 authored tarafından Noel Grandin's avatar Noel Grandin

fdo#46808, Convert form::ControlFontDialog to new style

Change-Id: I83487cddbd6b3fce1fdcdfa48623b63a0e026d90
üst 4bc3ead0
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include "dlgattr.hxx" #include "dlgattr.hxx"
#include "dlgsize.hxx" #include "dlgsize.hxx"
#include <com/sun/star/form/XLoadable.hpp> #include <com/sun/star/form/XLoadable.hpp>
#include <com/sun/star/form/ControlFontDialog.hpp>
#include <com/sun/star/sdb/CommandType.hpp> #include <com/sun/star/sdb/CommandType.hpp>
#include <com/sun/star/sdb/XSQLQueryComposerFactory.hpp> #include <com/sun/star/sdb/XSQLQueryComposerFactory.hpp>
#include <com/sun/star/sdb/XResultSetAccess.hpp> #include <com/sun/star/sdb/XResultSetAccess.hpp>
...@@ -952,24 +953,9 @@ void SbaGridControl::SetBrowserAttrs() ...@@ -952,24 +953,9 @@ void SbaGridControl::SetBrowserAttrs()
try try
{ {
PropertyValue aArg;
aArg.Name = OUString("IntrospectedObject");
aArg.Value <<= xGridModel;
Sequence< Any > aDialogArgs(1);
aDialogArgs[0] <<= aArg;
Reference< XComponentContext > xContext = getContext(); Reference< XComponentContext > xContext = getContext();
Reference< XInterface > xDialog = xContext->getServiceManager()->createInstanceWithArgumentsAndContext("com.sun.star.form.ControlFontDialog", aDialogArgs, xContext); Reference< XExecutableDialog > xExecute = ControlFontDialog::createWithGridModel( xContext, xGridModel);
if (!xDialog.is()) xExecute->execute();
{
ShowServiceNotAvailableError(this, OUString("com.sun.star.form.ControlFontDialog"), sal_True);
return;
}
Reference< XExecutableDialog > xExecute(xDialog, UNO_QUERY);
OSL_ENSURE(xExecute.is(), "SbaGridControl::SetBrowserAttrs: missing an interface on the dialog!");
if (xExecute.is())
xExecute->execute();
} }
catch( const Exception& ) catch( const Exception& )
{ {
......
...@@ -103,6 +103,22 @@ namespace pcr ...@@ -103,6 +103,22 @@ namespace pcr
return aSupported; return aSupported;
} }
void OControlFontDialog::initialize( const Sequence< Any >& aArguments ) throw(Exception, RuntimeException)
{
Reference<XPropertySet> xGridModel;
if (aArguments.getLength() == 1 && (aArguments[0] >>= xGridModel))
{
PropertyValue aArg;
aArg.Name = OUString("IntrospectedObject");
aArg.Value <<= xGridModel;
Sequence< Any > aNewArguments(1);
aNewArguments[0] <<= aArg;
OControlFontDialog_DBase::initialize(aNewArguments);
}
else
OControlFontDialog_DBase::initialize(aArguments);
}
//--------------------------------------------------------------------- //---------------------------------------------------------------------
Reference<XPropertySetInfo> SAL_CALL OControlFontDialog::getPropertySetInfo() throw(RuntimeException) Reference<XPropertySetInfo> SAL_CALL OControlFontDialog::getPropertySetInfo() throw(RuntimeException)
{ {
......
...@@ -70,7 +70,10 @@ namespace pcr ...@@ -70,7 +70,10 @@ namespace pcr
static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > 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 >&); SAL_CALL Create(const ::com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >&);
// XPropertySet // 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 ::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(); virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
......
...@@ -145,6 +145,7 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/embed,\ ...@@ -145,6 +145,7 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/embed,\
StorageFactory \ StorageFactory \
)) ))
$(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/form,\ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/form,\
ControlFontDialog \
Forms \ Forms \
)) ))
$(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/form/control,\ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/form/control,\
......
/* -*- 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_ControlFontDialog_idl__
#define __com_sun_star_form_ControlFontDialog_idl__
#include <com/sun/star/beans/XPropertySet.idl>
#include <com/sun/star/ui/dialogs/XExecutableDialog.idl>
module com { module sun { module star { module form {
/**
@since LibreOffice 4.1
*/
published service ControlFontDialog : com::sun::star::ui::dialogs::XExecutableDialog
{
createWithGridModel([in] com::sun::star::beans::XPropertySet GridModel);
};
}; }; }; };
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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