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

fdo#46808, Convert animations::Command to new style

The service already existed, just needed an IDL file

Change-Id: I5e6449522ce77c36df1857213bd028336c3354bf
üst a66fd8a9
......@@ -39,6 +39,7 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/animations
AnimateColor \
AnimateSet \
Audio \
Command \
IterateContainer \
ParallelTimeContainer \
SequenceTimeContainer \
......
/* -*- 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_animations_Command_idl__
#define __com_sun_star_animations_Command_idl__
#include <com/sun/star/animations/XCommand.idl>
module com { module sun { module star { module animations {
/**
@since LibreOffice 4.1
*/
service Command : com::sun::star::animations::XCommand;
}; }; }; };
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -23,6 +23,7 @@
#include <com/sun/star/animations/AnimateSet.hpp>
#include <com/sun/star/animations/AnimationFill.hpp>
#include <com/sun/star/animations/Audio.hpp>
#include <com/sun/star/animations/Command.hpp>
#include <com/sun/star/animations/IterateContainer.hpp>
#include <com/sun/star/animations/ParallelTimeContainer.hpp>
#include <com/sun/star/animations/SequenceTimeContainer.hpp>
......@@ -1651,8 +1652,8 @@ void CustomAnimationEffect::setStopAudio()
if( mxAudio.is() )
removeAudio();
Reference< XMultiServiceFactory > xMsf( ::comphelper::getProcessServiceFactory() );
Reference< XCommand > xCommand( xMsf->createInstance( "com.sun.star.animations.Command" ), UNO_QUERY_THROW );
Reference< XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
Reference< XCommand > xCommand( Command::create( xContext ) );
xCommand->setCommand( EffectCommands::STOPAUDIO );
......
......@@ -23,9 +23,8 @@
#include <com/sun/star/animations/Timing.hpp>
#include <com/sun/star/animations/Event.hpp>
#include <com/sun/star/animations/AnimationEndSync.hpp>
#include <com/sun/star/animations/Command.hpp>
#include <com/sun/star/animations/EventTrigger.hpp>
#include <com/sun/star/presentation/EffectNodeType.hpp>
#include <com/sun/star/presentation/EffectPresetClass.hpp>
#include <com/sun/star/animations/AnimationNodeType.hpp>
#include <com/sun/star/animations/AnimationTransformType.hpp>
#include <com/sun/star/animations/AnimationCalcMode.hpp>
......@@ -41,6 +40,8 @@
#include <com/sun/star/animations/XAnimateTransform.hpp>
#include <com/sun/star/animations/ValuePair.hpp>
#include <com/sun/star/animations/AnimationColorSpace.hpp>
#include <com/sun/star/presentation/EffectNodeType.hpp>
#include <com/sun/star/presentation/EffectPresetClass.hpp>
#include <com/sun/star/presentation/ShapeAnimationSubType.hpp>
#include <com/sun/star/presentation/EffectCommands.hpp>
#include <com/sun/star/beans/NamedValue.hpp>
......@@ -1419,8 +1420,7 @@ int AnimationImporter::importTimeContainer( const Atom* pAtom, const Reference<
if( pChildAtom->hasChildAtom( DFF_msofbtAnimCommand ) )
{
Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext();
const OUString aServiceName( "com.sun.star.animations.Command" );
Reference< XAnimationNode > xChildNode( xContext->getServiceManager()->createInstanceWithContext(aServiceName, xContext), UNO_QUERY );
Reference< XAnimationNode > xChildNode( Command::create(xContext), UNO_QUERY_THROW );
nNodes += importAnimationNodeContainer( pChildAtom, xChildNode );
Reference< XTimeContainer > xParentContainer( xNode, UNO_QUERY );
if( xParentContainer.is() && xChildNode.is() )
......
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