fdo#46808, Adapt animations::SequenceTimeContainer UNO service to new style
The service already existed, it just did not have an IDL file Change-Id: I9698830f9c01936a12669ee950e2b231f303c2f8
This commit is contained in:
@@ -31,6 +31,7 @@ $(eval $(call gb_UnoApi_set_include,offapi,\
|
|||||||
|
|
||||||
|
|
||||||
$(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/animations,\
|
$(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/animations,\
|
||||||
|
SequenceTimeContainer \
|
||||||
TargetPropertiesCreator \
|
TargetPropertiesCreator \
|
||||||
))
|
))
|
||||||
$(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/auth,\
|
$(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/auth,\
|
||||||
|
38
offapi/com/sun/star/animations/SequenceTimeContainer.idl
Normal file
38
offapi/com/sun/star/animations/SequenceTimeContainer.idl
Normal file
@@ -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_animations_SequenceTimeContainer_idl__
|
||||||
|
#define __com_sun_star_animations_SequenceTimeContainer_idl__
|
||||||
|
|
||||||
|
#include <com/sun/star/animations/XTimeContainer.idl>
|
||||||
|
|
||||||
|
|
||||||
|
module com { module sun { module star { module animations {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
@since LibreOffice 4.1
|
||||||
|
*/
|
||||||
|
service SequenceTimeContainer : XTimeContainer;
|
||||||
|
|
||||||
|
|
||||||
|
}; }; }; };
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
@@ -20,6 +20,7 @@
|
|||||||
#include <tools/debug.hxx>
|
#include <tools/debug.hxx>
|
||||||
#include <com/sun/star/util/XCloneable.hpp>
|
#include <com/sun/star/util/XCloneable.hpp>
|
||||||
#include <com/sun/star/animations/AnimationFill.hpp>
|
#include <com/sun/star/animations/AnimationFill.hpp>
|
||||||
|
#include <com/sun/star/animations/SequenceTimeContainer.hpp>
|
||||||
#include <com/sun/star/container/XEnumerationAccess.hpp>
|
#include <com/sun/star/container/XEnumerationAccess.hpp>
|
||||||
#include <com/sun/star/presentation/EffectNodeType.hpp>
|
#include <com/sun/star/presentation/EffectNodeType.hpp>
|
||||||
#include <com/sun/star/presentation/EffectCommands.hpp>
|
#include <com/sun/star/presentation/EffectCommands.hpp>
|
||||||
@@ -3208,7 +3209,7 @@ void SAL_CALL AnimationChangeListener::disposing( const ::com::sun::star::lang::
|
|||||||
// ====================================================================
|
// ====================================================================
|
||||||
|
|
||||||
MainSequence::MainSequence()
|
MainSequence::MainSequence()
|
||||||
: mxTimingRootNode( ::comphelper::getProcessServiceFactory()->createInstance("com.sun.star.animations.SequenceTimeContainer"), UNO_QUERY )
|
: mxTimingRootNode( SequenceTimeContainer::create( ::comphelper::getProcessComponentContext() ) )
|
||||||
, mbRebuilding( false )
|
, mbRebuilding( false )
|
||||||
, mnRebuildLockGuard( 0 )
|
, mnRebuildLockGuard( 0 )
|
||||||
, mbPendingRebuildRequest( false )
|
, mbPendingRebuildRequest( false )
|
||||||
@@ -3312,22 +3313,20 @@ void MainSequence::createMainSequence()
|
|||||||
// see if we have a mainsequence at all. if not, create one...
|
// see if we have a mainsequence at all. if not, create one...
|
||||||
if( !mxSequenceRoot.is() )
|
if( !mxSequenceRoot.is() )
|
||||||
{
|
{
|
||||||
mxSequenceRoot = Reference< XTimeContainer >::query(::comphelper::getProcessServiceFactory()->createInstance("com.sun.star.animations.SequenceTimeContainer"));
|
mxSequenceRoot = SequenceTimeContainer::create( ::comphelper::getProcessComponentContext() );
|
||||||
if( mxSequenceRoot.is() )
|
|
||||||
{
|
|
||||||
uno::Sequence< ::com::sun::star::beans::NamedValue > aUserData( 1 );
|
|
||||||
aUserData[0].Name = "node-type";
|
|
||||||
aUserData[0].Value <<= ::com::sun::star::presentation::EffectNodeType::MAIN_SEQUENCE;
|
|
||||||
mxSequenceRoot->setUserData( aUserData );
|
|
||||||
|
|
||||||
// empty sequence until now, set duration to 0.0
|
uno::Sequence< ::com::sun::star::beans::NamedValue > aUserData( 1 );
|
||||||
// explicitly (otherwise, this sequence will never
|
aUserData[0].Name = "node-type";
|
||||||
// end)
|
aUserData[0].Value <<= ::com::sun::star::presentation::EffectNodeType::MAIN_SEQUENCE;
|
||||||
mxSequenceRoot->setDuration( makeAny((double)0.0) );
|
mxSequenceRoot->setUserData( aUserData );
|
||||||
|
|
||||||
Reference< XAnimationNode > xMainSequenceNode( mxSequenceRoot, UNO_QUERY_THROW );
|
// empty sequence until now, set duration to 0.0
|
||||||
mxTimingRootNode->appendChild( xMainSequenceNode );
|
// explicitly (otherwise, this sequence will never
|
||||||
}
|
// end)
|
||||||
|
mxSequenceRoot->setDuration( makeAny((double)0.0) );
|
||||||
|
|
||||||
|
Reference< XAnimationNode > xMainSequenceNode( mxSequenceRoot, UNO_QUERY_THROW );
|
||||||
|
mxTimingRootNode->appendChild( xMainSequenceNode );
|
||||||
}
|
}
|
||||||
|
|
||||||
updateTextGroups();
|
updateTextGroups();
|
||||||
@@ -3377,20 +3376,18 @@ InteractiveSequencePtr MainSequence::createInteractiveSequence( const ::com::sun
|
|||||||
InteractiveSequencePtr pIS;
|
InteractiveSequencePtr pIS;
|
||||||
|
|
||||||
// create a new interactive sequence container
|
// create a new interactive sequence container
|
||||||
Reference< XTimeContainer > xISRoot( ::comphelper::getProcessServiceFactory()->createInstance("com.sun.star.animations.SequenceTimeContainer"), UNO_QUERY );
|
Reference< XTimeContainer > xISRoot = SequenceTimeContainer::create( ::comphelper::getProcessComponentContext() );
|
||||||
DBG_ASSERT( xISRoot.is(), "sd::MainSequence::createInteractiveSequence(), could not create \"com.sun.star.animations.SequenceTimeContainer\"!");
|
|
||||||
if( xISRoot.is() )
|
uno::Sequence< ::com::sun::star::beans::NamedValue > aUserData( 1 );
|
||||||
{
|
aUserData[0].Name = "node-type";
|
||||||
uno::Sequence< ::com::sun::star::beans::NamedValue > aUserData( 1 );
|
aUserData[0].Value <<= ::com::sun::star::presentation::EffectNodeType::INTERACTIVE_SEQUENCE ;
|
||||||
aUserData[0].Name = "node-type";
|
xISRoot->setUserData( aUserData );
|
||||||
aUserData[0].Value <<= ::com::sun::star::presentation::EffectNodeType::INTERACTIVE_SEQUENCE ;
|
|
||||||
xISRoot->setUserData( aUserData );
|
Reference< XChild > xChild( mxSequenceRoot, UNO_QUERY_THROW );
|
||||||
|
Reference< XAnimationNode > xISNode( xISRoot, UNO_QUERY_THROW );
|
||||||
|
Reference< XTimeContainer > xParent( xChild->getParent(), UNO_QUERY_THROW );
|
||||||
|
xParent->appendChild( xISNode );
|
||||||
|
|
||||||
Reference< XChild > xChild( mxSequenceRoot, UNO_QUERY_THROW );
|
|
||||||
Reference< XAnimationNode > xISNode( xISRoot, UNO_QUERY_THROW );
|
|
||||||
Reference< XTimeContainer > xParent( xChild->getParent(), UNO_QUERY_THROW );
|
|
||||||
xParent->appendChild( xISNode );
|
|
||||||
}
|
|
||||||
pIS.reset( new InteractiveSequence( xISRoot, this) );
|
pIS.reset( new InteractiveSequence( xISRoot, this) );
|
||||||
pIS->setTriggerShape( xShape );
|
pIS->setTriggerShape( xShape );
|
||||||
pIS->addListener( this );
|
pIS->addListener( this );
|
||||||
|
@@ -26,6 +26,7 @@
|
|||||||
#include <com/sun/star/presentation/AnimationEffect.hpp>
|
#include <com/sun/star/presentation/AnimationEffect.hpp>
|
||||||
#include <com/sun/star/presentation/AnimationSpeed.hpp>
|
#include <com/sun/star/presentation/AnimationSpeed.hpp>
|
||||||
#include <com/sun/star/animations/AnimationNodeType.hpp>
|
#include <com/sun/star/animations/AnimationNodeType.hpp>
|
||||||
|
#include <com/sun/star/animations/SequenceTimeContainer.hpp>
|
||||||
#include <com/sun/star/animations/XIterateContainer.hpp>
|
#include <com/sun/star/animations/XIterateContainer.hpp>
|
||||||
#include <com/sun/star/animations/XAnimateMotion.hpp>
|
#include <com/sun/star/animations/XAnimateMotion.hpp>
|
||||||
#include <com/sun/star/animations/XAnimateColor.hpp>
|
#include <com/sun/star/animations/XAnimateColor.hpp>
|
||||||
@@ -75,19 +76,10 @@ using namespace ::com::sun::star::beans;
|
|||||||
using namespace ::com::sun::star::animations;
|
using namespace ::com::sun::star::animations;
|
||||||
using namespace ::com::sun::star::presentation;
|
using namespace ::com::sun::star::presentation;
|
||||||
using namespace ::com::sun::star::drawing;
|
using namespace ::com::sun::star::drawing;
|
||||||
|
using namespace ::com::sun::star::uno;
|
||||||
using namespace ::xmloff::token;
|
using namespace ::xmloff::token;
|
||||||
|
|
||||||
using ::com::sun::star::xml::sax::XAttributeList;
|
using ::com::sun::star::xml::sax::XAttributeList;
|
||||||
using ::com::sun::star::uno::Any;
|
|
||||||
using ::com::sun::star::uno::makeAny;
|
|
||||||
using ::com::sun::star::uno::UNO_QUERY;
|
|
||||||
using ::com::sun::star::uno::UNO_QUERY_THROW;
|
|
||||||
using ::com::sun::star::uno::Reference;
|
|
||||||
using ::com::sun::star::uno::Sequence;
|
|
||||||
using ::com::sun::star::uno::RuntimeException;
|
|
||||||
using ::com::sun::star::uno::Exception;
|
|
||||||
using ::com::sun::star::uno::XInterface;
|
|
||||||
using ::com::sun::star::uno::Type;
|
|
||||||
using ::com::sun::star::beans::NamedValue;
|
using ::com::sun::star::beans::NamedValue;
|
||||||
using ::com::sun::star::text::XTextRange;
|
using ::com::sun::star::text::XTextRange;
|
||||||
using ::com::sun::star::text::XTextCursor;
|
using ::com::sun::star::text::XTextCursor;
|
||||||
@@ -1267,7 +1259,7 @@ SvXMLImportContext * AnimationNodeContext::CreateChildContext( sal_uInt16 nPrefi
|
|||||||
class AnimationsImport: public SvXMLImport, public XAnimationNodeSupplier
|
class AnimationsImport: public SvXMLImport, public XAnimationNodeSupplier
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
AnimationsImport( const Reference< XMultiServiceFactory > & rSMgr );
|
AnimationsImport( const Reference< XComponentContext > & rxContext );
|
||||||
~AnimationsImport() throw ();
|
~AnimationsImport() throw ();
|
||||||
|
|
||||||
SvXMLImportContext* CreateContext(sal_uInt16 nPrefix, const OUString& rLocalName, const Reference<XAttributeList>& xAttrList);
|
SvXMLImportContext* CreateContext(sal_uInt16 nPrefix, const OUString& rLocalName, const Reference<XAttributeList>& xAttrList);
|
||||||
@@ -1289,8 +1281,8 @@ private:
|
|||||||
Reference< XAnimationNode > mxRootNode;
|
Reference< XAnimationNode > mxRootNode;
|
||||||
};
|
};
|
||||||
|
|
||||||
AnimationsImport::AnimationsImport( const Reference< XMultiServiceFactory > & rSMgr )
|
AnimationsImport::AnimationsImport( const Reference< XComponentContext > & rxContext )
|
||||||
: SvXMLImport( rSMgr, true )
|
: SvXMLImport( Reference<XMultiServiceFactory>(rxContext->getServiceManager(), UNO_QUERY_THROW) , true )
|
||||||
{
|
{
|
||||||
// add namespaces
|
// add namespaces
|
||||||
GetNamespaceMap().Add(
|
GetNamespaceMap().Add(
|
||||||
@@ -1308,8 +1300,7 @@ AnimationsImport::AnimationsImport( const Reference< XMultiServiceFactory > & rS
|
|||||||
GetXMLToken(XML_N_ANIMATION),
|
GetXMLToken(XML_N_ANIMATION),
|
||||||
XML_NAMESPACE_ANIMATION);
|
XML_NAMESPACE_ANIMATION);
|
||||||
|
|
||||||
mxRootNode = Reference< XAnimationNode >::query(rSMgr->createInstance(
|
mxRootNode = Reference<XAnimationNode>( SequenceTimeContainer::create(rxContext), UNO_QUERY_THROW );
|
||||||
OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.animations.SequenceTimeContainer"))));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
AnimationsImport::~AnimationsImport() throw ()
|
AnimationsImport::~AnimationsImport() throw ()
|
||||||
@@ -1456,8 +1447,7 @@ OUString SAL_CALL AnimationsImport_getImplementationName() throw()
|
|||||||
|
|
||||||
Reference< XInterface > SAL_CALL AnimationsImport_createInstance(const Reference< XMultiServiceFactory > & rSMgr) throw( Exception )
|
Reference< XInterface > SAL_CALL AnimationsImport_createInstance(const Reference< XMultiServiceFactory > & rSMgr) throw( Exception )
|
||||||
{
|
{
|
||||||
return (cppu::OWeakObject*)new xmloff::AnimationsImport( rSMgr );
|
return (cppu::OWeakObject*)new xmloff::AnimationsImport( comphelper::getComponentContext(rSMgr) );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace xmloff
|
namespace xmloff
|
||||||
|
Reference in New Issue
Block a user