summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-04-23 13:55:25 +0200
committerNoel Grandin <noel@peralex.com>2013-04-25 08:56:38 +0200
commit73adc9b6e29a3e005d7c2e98795045e7025325c2 (patch)
tree56eefce782329c17267a6f8d676c5e8e3238829a
parent4bc3ead0649bf2885050ec4cfb47a5ed13bfa41e (diff)
fdo#46808, Convert form::ControlFontDialog to new style
Change-Id: I83487cddbd6b3fce1fdcdfa48623b63a0e026d90
-rw-r--r--dbaccess/source/ui/browser/sbagrid.cxx20
-rw-r--r--extensions/source/propctrlr/controlfontdialog.cxx16
-rw-r--r--extensions/source/propctrlr/controlfontdialog.hxx5
-rw-r--r--offapi/UnoApi_offapi.mk1
-rw-r--r--offapi/com/sun/star/form/ControlFontDialog.idl42
5 files changed, 66 insertions, 18 deletions
diff --git a/dbaccess/source/ui/browser/sbagrid.cxx b/dbaccess/source/ui/browser/sbagrid.cxx
index 973aeca2602f..745d243c4fdb 100644
--- a/dbaccess/source/ui/browser/sbagrid.cxx
+++ b/dbaccess/source/ui/browser/sbagrid.cxx
@@ -30,6 +30,7 @@
#include "dlgattr.hxx"
#include "dlgsize.hxx"
#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/XSQLQueryComposerFactory.hpp>
#include <com/sun/star/sdb/XResultSetAccess.hpp>
@@ -952,24 +953,9 @@ void SbaGridControl::SetBrowserAttrs()
try
{
- PropertyValue aArg;
- aArg.Name = OUString("IntrospectedObject");
- aArg.Value <<= xGridModel;
- Sequence< Any > aDialogArgs(1);
- aDialogArgs[0] <<= aArg;
-
Reference< XComponentContext > xContext = getContext();
- Reference< XInterface > xDialog = xContext->getServiceManager()->createInstanceWithArgumentsAndContext("com.sun.star.form.ControlFontDialog", aDialogArgs, xContext);
- if (!xDialog.is())
- {
- 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();
+ Reference< XExecutableDialog > xExecute = ControlFontDialog::createWithGridModel( xContext, xGridModel);
+ xExecute->execute();
}
catch( const Exception& )
{
diff --git a/extensions/source/propctrlr/controlfontdialog.cxx b/extensions/source/propctrlr/controlfontdialog.cxx
index 861583f686be..87246f779cd4 100644
--- a/extensions/source/propctrlr/controlfontdialog.cxx
+++ b/extensions/source/propctrlr/controlfontdialog.cxx
@@ -103,6 +103,22 @@ namespace pcr
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)
{
diff --git a/extensions/source/propctrlr/controlfontdialog.hxx b/extensions/source/propctrlr/controlfontdialog.hxx
index c0db06a47b63..50080e0301f2 100644
--- a/extensions/source/propctrlr/controlfontdialog.hxx
+++ b/extensions/source/propctrlr/controlfontdialog.hxx
@@ -70,7 +70,10 @@ 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 >&);
- // 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 ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk
index ef5781abef68..2099eba7776b 100644
--- a/offapi/UnoApi_offapi.mk
+++ b/offapi/UnoApi_offapi.mk
@@ -145,6 +145,7 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/embed,\
StorageFactory \
))
$(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/form,\
+ ControlFontDialog \
Forms \
))
$(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/form/control,\
diff --git a/offapi/com/sun/star/form/ControlFontDialog.idl b/offapi/com/sun/star/form/ControlFontDialog.idl
new file mode 100644
index 000000000000..7936f6110414
--- /dev/null
+++ b/offapi/com/sun/star/form/ControlFontDialog.idl
@@ -0,0 +1,42 @@
+/* -*- 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: */