Kaydet (Commit) 332b4286 authored tarafından Noel Grandin's avatar Noel Grandin

fdo#46808, convert xforms::XForms to new style

the service already existed, it just needed an IDL file

Change-Id: I4410dbd1e047e5e7e83c84f0b0de7155cc4fa41c
üst 4cac11f8
...@@ -392,6 +392,7 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/util,\ ...@@ -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,\ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/xforms,\
Model \ Model \
XForms \
)) ))
$(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/xml/crypto,\ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/xml/crypto,\
NSSInitializer \ NSSInitializer \
......
/* -*- 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 <com/sun/star/container/XNameContainer.idl>
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: */
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include <com/sun/star/xforms/Model.hpp> #include <com/sun/star/xforms/Model.hpp>
#include <com/sun/star/xforms/XModel2.hpp> #include <com/sun/star/xforms/XModel2.hpp>
#include <com/sun/star/xforms/XFormsUIHelper1.hpp> #include <com/sun/star/xforms/XFormsUIHelper1.hpp>
#include <com/sun/star/xforms/XForms.hpp>
#include <comphelper/processfactory.hxx> #include <comphelper/processfactory.hxx>
#include <tools/diagnose_ex.h> #include <tools/diagnose_ex.h>
...@@ -53,13 +54,6 @@ bool SwDoc::isXForms() const ...@@ -53,13 +54,6 @@ bool SwDoc::isXForms() const
return mxXForms.is(); return mxXForms.is();
} }
static Reference<XInterface> 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 ) void SwDoc::initXForms( bool bCreateDefaultModel )
{ {
OSL_ENSURE( ! isXForms(), "please initialize only once" ); OSL_ENSURE( ! isXForms(), "please initialize only once" );
...@@ -67,9 +61,7 @@ void SwDoc::initXForms( bool bCreateDefaultModel ) ...@@ -67,9 +61,7 @@ void SwDoc::initXForms( bool bCreateDefaultModel )
try try
{ {
// create XForms components // create XForms components
mxXForms.set( lcl_createInstance( "com.sun.star.xforms.XForms" ), mxXForms = xforms::XForms::create( comphelper::getProcessComponentContext() );
UNO_QUERY );
OSL_ENSURE( mxXForms.is(), "can't create XForms container" );
// change our module identifier, to be able to have a dedicated UI // change our module identifier, to be able to have a dedicated UI
Reference< XModule > xModule; Reference< XModule > xModule;
......
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