From 332b42860ed5503f4661d38e2745191b7039c275 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 14 Mar 2013 14:47:13 +0200 Subject: fdo#46808, convert xforms::XForms to new style the service already existed, it just needed an IDL file Change-Id: I4410dbd1e047e5e7e83c84f0b0de7155cc4fa41c --- offapi/UnoApi_offapi.mk | 1 + offapi/com/sun/star/xforms/XForms.idl | 38 +++++++++++++++++++++++++++++++++++ sw/source/core/doc/docxforms.cxx | 12 ++--------- 3 files changed, 41 insertions(+), 10 deletions(-) create mode 100644 offapi/com/sun/star/xforms/XForms.idl diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk index d04c8ffc6c08..9a6e6faf1b2d 100644 --- a/offapi/UnoApi_offapi.mk +++ b/offapi/UnoApi_offapi.mk @@ -392,6 +392,7 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/util,\ )) $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/xforms,\ Model \ + XForms \ )) $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/xml/crypto,\ NSSInitializer \ diff --git a/offapi/com/sun/star/xforms/XForms.idl b/offapi/com/sun/star/xforms/XForms.idl new file mode 100644 index 000000000000..ba23bdde6c34 --- /dev/null +++ b/offapi/com/sun/star/xforms/XForms.idl @@ -0,0 +1,38 @@ +/* -*- 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_xforms_Binding_idl__ +#define __com_sun_star_xforms_Binding_idl__ + +#include + + +module com { module sun { module star { module xforms { + + +/** + @since LibreOffice 4.1 +*/ +service XForms : com::sun::star::container::XNameContainer; + + +}; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/doc/docxforms.cxx b/sw/source/core/doc/docxforms.cxx index 11d264b44eb4..e3d9601d0df1 100644 --- a/sw/source/core/doc/docxforms.cxx +++ b/sw/source/core/doc/docxforms.cxx @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -53,13 +54,6 @@ bool SwDoc::isXForms() const return mxXForms.is(); } -static Reference lcl_createInstance( const sal_Char* pServiceName ) -{ - OSL_ENSURE( pServiceName != NULL, "no service name" ); - return comphelper::getProcessServiceFactory()->createInstance( - OUString::createFromAscii( pServiceName ) ); -} - void SwDoc::initXForms( bool bCreateDefaultModel ) { OSL_ENSURE( ! isXForms(), "please initialize only once" ); @@ -67,9 +61,7 @@ void SwDoc::initXForms( bool bCreateDefaultModel ) try { // create XForms components - mxXForms.set( lcl_createInstance( "com.sun.star.xforms.XForms" ), - UNO_QUERY ); - OSL_ENSURE( mxXForms.is(), "can't create XForms container" ); + mxXForms = xforms::XForms::create( comphelper::getProcessComponentContext() ); // change our module identifier, to be able to have a dedicated UI Reference< XModule > xModule; -- cgit v1.2.3