diff options
author | Kurt Zenker <kz@openoffice.org> | 2005-07-14 09:46:18 +0000 |
---|---|---|
committer | Kurt Zenker <kz@openoffice.org> | 2005-07-14 09:46:18 +0000 |
commit | 71bda48e52417bfc9b67c0cda5eb29d115d9fa26 (patch) | |
tree | e8c157d918c0261800339c7e3f1245c1c2fc5744 /animations/inc | |
parent | 4e892325fe884538a19cfc4ccae14ede3fcbebf9 (diff) |
INTEGRATION: CWS impress61 (1.2.6); FILE MERGED
2005/06/28 11:53:21 cl 1.2.6.1: #i44633# added correct cloning of animations
Diffstat (limited to 'animations/inc')
-rw-r--r-- | animations/inc/animations/animationnodehelper.hxx | 44 |
1 files changed, 42 insertions, 2 deletions
diff --git a/animations/inc/animations/animationnodehelper.hxx b/animations/inc/animations/animationnodehelper.hxx index 78ff26e80cf0..7417a6ca67a4 100644 --- a/animations/inc/animations/animationnodehelper.hxx +++ b/animations/inc/animations/animationnodehelper.hxx @@ -2,9 +2,9 @@ * * $RCSfile: animationnodehelper.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: rt $ $Date: 2004-11-29 10:36:46 $ + * last change: $Author: kz $ $Date: 2005-07-14 10:46:18 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -76,6 +76,7 @@ #include <com/sun/star/container/XEnumeration.hpp> #endif +#include <vector> /* Declaration and definition of AnimationNode helper */ @@ -128,6 +129,45 @@ namespace anim return false; } } + + + /** pushes the given node to the given vector and recursivly calls itself for each child node. + */ + void create_deep_vector( const ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode >& xNode, + std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode > >& rVector ) + { + rVector.push_back( xNode ); + + try + { + // get an XEnumerationAccess to the children + ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumerationAccess > + xEnumerationAccess( xNode, + ::com::sun::star::uno::UNO_QUERY ); + + if( xEnumerationAccess.is() ) + { + ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > + xEnumeration( xEnumerationAccess->createEnumeration(), + ::com::sun::star::uno::UNO_QUERY ); + + if( xEnumeration.is() ) + { + while( xEnumeration->hasMoreElements() ) + { + ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode > + xChildNode( xEnumeration->nextElement(), + ::com::sun::star::uno::UNO_QUERY_THROW ); + + create_deep_vector( xChildNode, rVector ); + } + } + } + } + catch( ::com::sun::star::uno::Exception& ) + { + } + } } #endif /* INCLUDED_ANIMATIONS_ANIMATIONNODEHELPER_HXX */ |