1*b1cdbd2cSJim Jagielski /************************************************************** 2*b1cdbd2cSJim Jagielski * 3*b1cdbd2cSJim Jagielski * Licensed to the Apache Software Foundation (ASF) under one 4*b1cdbd2cSJim Jagielski * or more contributor license agreements. See the NOTICE file 5*b1cdbd2cSJim Jagielski * distributed with this work for additional information 6*b1cdbd2cSJim Jagielski * regarding copyright ownership. The ASF licenses this file 7*b1cdbd2cSJim Jagielski * to you under the Apache License, Version 2.0 (the 8*b1cdbd2cSJim Jagielski * "License"); you may not use this file except in compliance 9*b1cdbd2cSJim Jagielski * with the License. You may obtain a copy of the License at 10*b1cdbd2cSJim Jagielski * 11*b1cdbd2cSJim Jagielski * http://www.apache.org/licenses/LICENSE-2.0 12*b1cdbd2cSJim Jagielski * 13*b1cdbd2cSJim Jagielski * Unless required by applicable law or agreed to in writing, 14*b1cdbd2cSJim Jagielski * software distributed under the License is distributed on an 15*b1cdbd2cSJim Jagielski * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*b1cdbd2cSJim Jagielski * KIND, either express or implied. See the License for the 17*b1cdbd2cSJim Jagielski * specific language governing permissions and limitations 18*b1cdbd2cSJim Jagielski * under the License. 19*b1cdbd2cSJim Jagielski * 20*b1cdbd2cSJim Jagielski *************************************************************/ 21*b1cdbd2cSJim Jagielski 22*b1cdbd2cSJim Jagielski 23*b1cdbd2cSJim Jagielski 24*b1cdbd2cSJim Jagielski // MARKER(update_precomp.py): autogen include statement, do not remove 25*b1cdbd2cSJim Jagielski #include "precompiled_sd.hxx" 26*b1cdbd2cSJim Jagielski #include <com/sun/star/animations/XAnimationNode.hpp> 27*b1cdbd2cSJim Jagielski #include <com/sun/star/animations/Event.hpp> 28*b1cdbd2cSJim Jagielski #ifndef _COM_SUN_STAR_ANIMATIONS_XAnimateColor_HPP_ 29*b1cdbd2cSJim Jagielski #include <com/sun/star/animations/XAnimateColor.hpp> 30*b1cdbd2cSJim Jagielski #endif 31*b1cdbd2cSJim Jagielski #ifndef _COM_SUN_STAR_ANIMATIONS_XAnimateSet_HPP_ 32*b1cdbd2cSJim Jagielski #include <com/sun/star/animations/XAnimateSet.hpp> 33*b1cdbd2cSJim Jagielski #endif 34*b1cdbd2cSJim Jagielski #include <com/sun/star/animations/XCommand.hpp> 35*b1cdbd2cSJim Jagielski #ifndef _COM_SUN_STAR_ANIMATIONS_XAnimateMotion_HPP_ 36*b1cdbd2cSJim Jagielski #include <com/sun/star/animations/XAnimateMotion.hpp> 37*b1cdbd2cSJim Jagielski #endif 38*b1cdbd2cSJim Jagielski #ifndef _COM_SUN_STAR_ANIMATIONS_XAnimateTransform_HPP_ 39*b1cdbd2cSJim Jagielski #include <com/sun/star/animations/XAnimateTransform.hpp> 40*b1cdbd2cSJim Jagielski #endif 41*b1cdbd2cSJim Jagielski #ifndef _COM_SUN_STAR_ANIMATIONS_XTransitionFilter_HPP_ 42*b1cdbd2cSJim Jagielski #include <com/sun/star/animations/XTransitionFilter.hpp> 43*b1cdbd2cSJim Jagielski #endif 44*b1cdbd2cSJim Jagielski #include <com/sun/star/animations/XIterateContainer.hpp> 45*b1cdbd2cSJim Jagielski #include <com/sun/star/animations/XAudio.hpp> 46*b1cdbd2cSJim Jagielski #include <com/sun/star/animations/AnimationNodeType.hpp> 47*b1cdbd2cSJim Jagielski #include <com/sun/star/animations/ValuePair.hpp> 48*b1cdbd2cSJim Jagielski #include <com/sun/star/presentation/EffectNodeType.hpp> 49*b1cdbd2cSJim Jagielski #include <com/sun/star/util/XCloneable.hpp> 50*b1cdbd2cSJim Jagielski #include <com/sun/star/presentation/ParagraphTarget.hpp> 51*b1cdbd2cSJim Jagielski #include <com/sun/star/container/XEnumerationAccess.hpp> 52*b1cdbd2cSJim Jagielski #include <com/sun/star/beans/NamedValue.hpp> 53*b1cdbd2cSJim Jagielski 54*b1cdbd2cSJim Jagielski #include <map> 55*b1cdbd2cSJim Jagielski 56*b1cdbd2cSJim Jagielski #include "comphelper/anytostring.hxx" 57*b1cdbd2cSJim Jagielski #include "cppuhelper/exc_hlp.hxx" 58*b1cdbd2cSJim Jagielski #include "rtl/ref.hxx" 59*b1cdbd2cSJim Jagielski #include <animations/animationnodehelper.hxx> 60*b1cdbd2cSJim Jagielski 61*b1cdbd2cSJim Jagielski // header for class SdrObjListIter 62*b1cdbd2cSJim Jagielski #include <svx/svditer.hxx> 63*b1cdbd2cSJim Jagielski 64*b1cdbd2cSJim Jagielski #include "sdpage.hxx" 65*b1cdbd2cSJim Jagielski 66*b1cdbd2cSJim Jagielski using namespace ::com::sun::star::uno; 67*b1cdbd2cSJim Jagielski using namespace ::com::sun::star::animations; 68*b1cdbd2cSJim Jagielski using namespace ::com::sun::star::presentation; 69*b1cdbd2cSJim Jagielski using namespace ::com::sun::star::container; 70*b1cdbd2cSJim Jagielski 71*b1cdbd2cSJim Jagielski using ::rtl::OUString; 72*b1cdbd2cSJim Jagielski using ::rtl::OString; 73*b1cdbd2cSJim Jagielski using ::com::sun::star::drawing::XShape; 74*b1cdbd2cSJim Jagielski using ::com::sun::star::beans::NamedValue; 75*b1cdbd2cSJim Jagielski 76*b1cdbd2cSJim Jagielski namespace sd 77*b1cdbd2cSJim Jagielski { 78*b1cdbd2cSJim Jagielski class CustomAnimationClonerImpl 79*b1cdbd2cSJim Jagielski { 80*b1cdbd2cSJim Jagielski public: 81*b1cdbd2cSJim Jagielski CustomAnimationClonerImpl(); 82*b1cdbd2cSJim Jagielski Reference< XAnimationNode > Clone( const Reference< XAnimationNode >& xSourceNode, const SdPage* pSource = 0, const SdPage* pTarget = 0 ); 83*b1cdbd2cSJim Jagielski 84*b1cdbd2cSJim Jagielski private: 85*b1cdbd2cSJim Jagielski void transformNode( const Reference< XAnimationNode >& xNode ); 86*b1cdbd2cSJim Jagielski Any transformValue( const Any& rValue ); 87*b1cdbd2cSJim Jagielski 88*b1cdbd2cSJim Jagielski Reference< XShape > getClonedShape( const Reference< XShape >& xSource ) const; 89*b1cdbd2cSJim Jagielski Reference< XAnimationNode > getClonedNode( const Reference< XAnimationNode >& xSource ) const; 90*b1cdbd2cSJim Jagielski 91*b1cdbd2cSJim Jagielski mutable ::std::map< Reference< XShape >, Reference< XShape > > maShapeMap; 92*b1cdbd2cSJim Jagielski std::vector< Reference< XAnimationNode > > maSourceNodeVector; 93*b1cdbd2cSJim Jagielski std::vector< Reference< XAnimationNode > > maCloneNodeVector; 94*b1cdbd2cSJim Jagielski }; 95*b1cdbd2cSJim Jagielski CustomAnimationClonerImpl()96*b1cdbd2cSJim Jagielski CustomAnimationClonerImpl::CustomAnimationClonerImpl() 97*b1cdbd2cSJim Jagielski { 98*b1cdbd2cSJim Jagielski } 99*b1cdbd2cSJim Jagielski Clone(const Reference<XAnimationNode> & xSourceNode,const SdPage * pSource,const SdPage * pTarget)100*b1cdbd2cSJim Jagielski Reference< XAnimationNode > Clone( const Reference< XAnimationNode >& xSourceNode, const SdPage* pSource, const SdPage* pTarget ) 101*b1cdbd2cSJim Jagielski { 102*b1cdbd2cSJim Jagielski CustomAnimationClonerImpl aCloner; 103*b1cdbd2cSJim Jagielski return aCloner.Clone( xSourceNode, pSource, pTarget ); 104*b1cdbd2cSJim Jagielski } 105*b1cdbd2cSJim Jagielski Clone(const Reference<XAnimationNode> & xSourceNode,const SdPage * pSourcePage,const SdPage * pTargetPage)106*b1cdbd2cSJim Jagielski Reference< XAnimationNode > CustomAnimationClonerImpl::Clone( const Reference< XAnimationNode >& xSourceNode, const SdPage* pSourcePage, const SdPage* pTargetPage ) 107*b1cdbd2cSJim Jagielski { 108*b1cdbd2cSJim Jagielski try 109*b1cdbd2cSJim Jagielski { 110*b1cdbd2cSJim Jagielski // clone animation hierarchie 111*b1cdbd2cSJim Jagielski Reference< ::com::sun::star::util::XCloneable > xClonable( xSourceNode, UNO_QUERY_THROW ); 112*b1cdbd2cSJim Jagielski Reference< XAnimationNode > xCloneNode( xClonable->createClone(), UNO_QUERY_THROW ); 113*b1cdbd2cSJim Jagielski 114*b1cdbd2cSJim Jagielski // create a dictionary to map source to cloned shapes 115*b1cdbd2cSJim Jagielski if( pSourcePage && pTargetPage ) 116*b1cdbd2cSJim Jagielski { 117*b1cdbd2cSJim Jagielski SdrObjListIter aSourceIter( *pSourcePage, IM_DEEPWITHGROUPS ); 118*b1cdbd2cSJim Jagielski SdrObjListIter aTargetIter( *pTargetPage, IM_DEEPWITHGROUPS ); 119*b1cdbd2cSJim Jagielski 120*b1cdbd2cSJim Jagielski while( aSourceIter.IsMore() && aTargetIter.IsMore() ) 121*b1cdbd2cSJim Jagielski { 122*b1cdbd2cSJim Jagielski SdrObject* pSource = aSourceIter.Next(); 123*b1cdbd2cSJim Jagielski SdrObject* pTarget = aTargetIter.Next(); 124*b1cdbd2cSJim Jagielski 125*b1cdbd2cSJim Jagielski if( pSource && pTarget) 126*b1cdbd2cSJim Jagielski { 127*b1cdbd2cSJim Jagielski Reference< XShape > xSource( pSource->getUnoShape(), UNO_QUERY ); 128*b1cdbd2cSJim Jagielski Reference< XShape > xTarget( pTarget->getUnoShape(), UNO_QUERY ); 129*b1cdbd2cSJim Jagielski if( xSource.is() && xTarget.is() ) 130*b1cdbd2cSJim Jagielski { 131*b1cdbd2cSJim Jagielski maShapeMap[xSource] = xTarget; 132*b1cdbd2cSJim Jagielski } 133*b1cdbd2cSJim Jagielski } 134*b1cdbd2cSJim Jagielski } 135*b1cdbd2cSJim Jagielski } 136*b1cdbd2cSJim Jagielski 137*b1cdbd2cSJim Jagielski // create a dictionary to map source to cloned nodes 138*b1cdbd2cSJim Jagielski ::anim::create_deep_vector( xSourceNode, maSourceNodeVector ); 139*b1cdbd2cSJim Jagielski ::anim::create_deep_vector( xCloneNode, maCloneNodeVector ); 140*b1cdbd2cSJim Jagielski 141*b1cdbd2cSJim Jagielski transformNode( xCloneNode ); 142*b1cdbd2cSJim Jagielski 143*b1cdbd2cSJim Jagielski return xCloneNode; 144*b1cdbd2cSJim Jagielski } 145*b1cdbd2cSJim Jagielski catch( Exception& e ) 146*b1cdbd2cSJim Jagielski { 147*b1cdbd2cSJim Jagielski (void)e; 148*b1cdbd2cSJim Jagielski DBG_ERROR( 149*b1cdbd2cSJim Jagielski (OString("sd::CustomAnimationClonerImpl::Clone(), " 150*b1cdbd2cSJim Jagielski "exception caught: ") + 151*b1cdbd2cSJim Jagielski rtl::OUStringToOString( 152*b1cdbd2cSJim Jagielski comphelper::anyToString( cppu::getCaughtException() ), 153*b1cdbd2cSJim Jagielski RTL_TEXTENCODING_UTF8 )).getStr() ); 154*b1cdbd2cSJim Jagielski 155*b1cdbd2cSJim Jagielski Reference< XAnimationNode > xEmpty; 156*b1cdbd2cSJim Jagielski return xEmpty; 157*b1cdbd2cSJim Jagielski } 158*b1cdbd2cSJim Jagielski } 159*b1cdbd2cSJim Jagielski transformNode(const Reference<XAnimationNode> & xNode)160*b1cdbd2cSJim Jagielski void CustomAnimationClonerImpl::transformNode( const Reference< XAnimationNode >& xNode ) 161*b1cdbd2cSJim Jagielski { 162*b1cdbd2cSJim Jagielski try 163*b1cdbd2cSJim Jagielski { 164*b1cdbd2cSJim Jagielski xNode->setBegin( transformValue( xNode->getBegin() ) ); 165*b1cdbd2cSJim Jagielski xNode->setEnd( transformValue( xNode->getEnd() ) ); 166*b1cdbd2cSJim Jagielski 167*b1cdbd2cSJim Jagielski sal_Int16 nNodeType( xNode->getType() ); 168*b1cdbd2cSJim Jagielski switch( nNodeType ) 169*b1cdbd2cSJim Jagielski { 170*b1cdbd2cSJim Jagielski case AnimationNodeType::ITERATE: 171*b1cdbd2cSJim Jagielski { 172*b1cdbd2cSJim Jagielski Reference< XIterateContainer > xIter( xNode, UNO_QUERY_THROW ); 173*b1cdbd2cSJim Jagielski xIter->setTarget( transformValue( xIter->getTarget() ) ); 174*b1cdbd2cSJim Jagielski } 175*b1cdbd2cSJim Jagielski // its intended that here is no break! 176*b1cdbd2cSJim Jagielski case AnimationNodeType::PAR: 177*b1cdbd2cSJim Jagielski case AnimationNodeType::SEQ: 178*b1cdbd2cSJim Jagielski { 179*b1cdbd2cSJim Jagielski Reference< XEnumerationAccess > xEnumerationAccess( xNode, UNO_QUERY_THROW ); 180*b1cdbd2cSJim Jagielski Reference< XEnumeration > xEnumeration( xEnumerationAccess->createEnumeration(), UNO_QUERY_THROW ); 181*b1cdbd2cSJim Jagielski while( xEnumeration->hasMoreElements() ) 182*b1cdbd2cSJim Jagielski { 183*b1cdbd2cSJim Jagielski Reference< XAnimationNode > xChildNode( xEnumeration->nextElement(), UNO_QUERY_THROW ); 184*b1cdbd2cSJim Jagielski transformNode( xChildNode ); 185*b1cdbd2cSJim Jagielski } 186*b1cdbd2cSJim Jagielski } 187*b1cdbd2cSJim Jagielski break; 188*b1cdbd2cSJim Jagielski 189*b1cdbd2cSJim Jagielski case AnimationNodeType::ANIMATE: 190*b1cdbd2cSJim Jagielski case AnimationNodeType::SET: 191*b1cdbd2cSJim Jagielski case AnimationNodeType::ANIMATEMOTION: 192*b1cdbd2cSJim Jagielski case AnimationNodeType::ANIMATECOLOR: 193*b1cdbd2cSJim Jagielski case AnimationNodeType::ANIMATETRANSFORM: 194*b1cdbd2cSJim Jagielski case AnimationNodeType::TRANSITIONFILTER: 195*b1cdbd2cSJim Jagielski { 196*b1cdbd2cSJim Jagielski Reference< XAnimate > xAnimate( xNode, UNO_QUERY_THROW ); 197*b1cdbd2cSJim Jagielski xAnimate->setTarget( transformValue( xAnimate->getTarget() ) ); 198*b1cdbd2cSJim Jagielski } 199*b1cdbd2cSJim Jagielski break; 200*b1cdbd2cSJim Jagielski 201*b1cdbd2cSJim Jagielski case AnimationNodeType::COMMAND: 202*b1cdbd2cSJim Jagielski { 203*b1cdbd2cSJim Jagielski Reference< XCommand > xCommand( xNode, UNO_QUERY_THROW ); 204*b1cdbd2cSJim Jagielski xCommand->setTarget( transformValue( xCommand->getTarget() ) ); 205*b1cdbd2cSJim Jagielski } 206*b1cdbd2cSJim Jagielski break; 207*b1cdbd2cSJim Jagielski 208*b1cdbd2cSJim Jagielski case AnimationNodeType::AUDIO: 209*b1cdbd2cSJim Jagielski { 210*b1cdbd2cSJim Jagielski Reference< XAudio > xAudio( xNode, UNO_QUERY_THROW ); 211*b1cdbd2cSJim Jagielski xAudio->setSource( transformValue( xAudio->getSource() ) ); 212*b1cdbd2cSJim Jagielski } 213*b1cdbd2cSJim Jagielski break; 214*b1cdbd2cSJim Jagielski } 215*b1cdbd2cSJim Jagielski 216*b1cdbd2cSJim Jagielski Sequence< NamedValue > aUserData( xNode->getUserData() ); 217*b1cdbd2cSJim Jagielski if( aUserData.hasElements() ) 218*b1cdbd2cSJim Jagielski { 219*b1cdbd2cSJim Jagielski NamedValue* pValue = aUserData.getArray(); 220*b1cdbd2cSJim Jagielski const sal_Int32 nLength = aUserData.getLength(); 221*b1cdbd2cSJim Jagielski sal_Int32 nElement; 222*b1cdbd2cSJim Jagielski for( nElement = 0; nElement < nLength; nElement++, pValue++ ) 223*b1cdbd2cSJim Jagielski { 224*b1cdbd2cSJim Jagielski pValue->Value = transformValue( pValue->Value ); 225*b1cdbd2cSJim Jagielski } 226*b1cdbd2cSJim Jagielski 227*b1cdbd2cSJim Jagielski xNode->setUserData( aUserData ); 228*b1cdbd2cSJim Jagielski } 229*b1cdbd2cSJim Jagielski } 230*b1cdbd2cSJim Jagielski catch( Exception& e ) 231*b1cdbd2cSJim Jagielski { 232*b1cdbd2cSJim Jagielski (void)e; 233*b1cdbd2cSJim Jagielski DBG_ERROR( 234*b1cdbd2cSJim Jagielski (OString("sd::CustomAnimationClonerImpl::transformNode(), " 235*b1cdbd2cSJim Jagielski "exception caught: ") + 236*b1cdbd2cSJim Jagielski rtl::OUStringToOString( 237*b1cdbd2cSJim Jagielski comphelper::anyToString( cppu::getCaughtException() ), 238*b1cdbd2cSJim Jagielski RTL_TEXTENCODING_UTF8 )).getStr() ); 239*b1cdbd2cSJim Jagielski } 240*b1cdbd2cSJim Jagielski } 241*b1cdbd2cSJim Jagielski transformValue(const Any & rValue)242*b1cdbd2cSJim Jagielski Any CustomAnimationClonerImpl::transformValue( const Any& rValue ) 243*b1cdbd2cSJim Jagielski { 244*b1cdbd2cSJim Jagielski if( rValue.hasValue() ) try 245*b1cdbd2cSJim Jagielski { 246*b1cdbd2cSJim Jagielski if( rValue.getValueType() == ::getCppuType((const ValuePair*)0) ) 247*b1cdbd2cSJim Jagielski { 248*b1cdbd2cSJim Jagielski ValuePair aValuePair; 249*b1cdbd2cSJim Jagielski rValue >>= aValuePair; 250*b1cdbd2cSJim Jagielski 251*b1cdbd2cSJim Jagielski aValuePair.First = transformValue( aValuePair.First ); 252*b1cdbd2cSJim Jagielski aValuePair.Second = transformValue( aValuePair.Second ); 253*b1cdbd2cSJim Jagielski 254*b1cdbd2cSJim Jagielski return makeAny( aValuePair ); 255*b1cdbd2cSJim Jagielski } 256*b1cdbd2cSJim Jagielski else if( rValue.getValueType() == ::getCppuType((Sequence<Any>*)0) ) 257*b1cdbd2cSJim Jagielski { 258*b1cdbd2cSJim Jagielski Sequence<Any> aSequence; 259*b1cdbd2cSJim Jagielski rValue >>= aSequence; 260*b1cdbd2cSJim Jagielski 261*b1cdbd2cSJim Jagielski const sal_Int32 nLength = aSequence.getLength(); 262*b1cdbd2cSJim Jagielski sal_Int32 nElement; 263*b1cdbd2cSJim Jagielski Any* pAny = aSequence.getArray(); 264*b1cdbd2cSJim Jagielski 265*b1cdbd2cSJim Jagielski for( nElement = 0; nElement < nLength; nElement++, pAny++ ) 266*b1cdbd2cSJim Jagielski *pAny = transformValue( *pAny ); 267*b1cdbd2cSJim Jagielski 268*b1cdbd2cSJim Jagielski return makeAny( aSequence ); 269*b1cdbd2cSJim Jagielski } 270*b1cdbd2cSJim Jagielski else if( rValue.getValueTypeClass() == TypeClass_INTERFACE ) 271*b1cdbd2cSJim Jagielski { 272*b1cdbd2cSJim Jagielski Reference< XShape > xShape; 273*b1cdbd2cSJim Jagielski rValue >>= xShape; 274*b1cdbd2cSJim Jagielski if( xShape.is() ) 275*b1cdbd2cSJim Jagielski { 276*b1cdbd2cSJim Jagielski return makeAny( getClonedShape( xShape ) ); 277*b1cdbd2cSJim Jagielski } 278*b1cdbd2cSJim Jagielski else 279*b1cdbd2cSJim Jagielski { 280*b1cdbd2cSJim Jagielski Reference< XAnimationNode > xNode; 281*b1cdbd2cSJim Jagielski rValue >>= xNode; 282*b1cdbd2cSJim Jagielski if( xNode.is() ) 283*b1cdbd2cSJim Jagielski return makeAny( getClonedNode( xNode ) ); 284*b1cdbd2cSJim Jagielski } 285*b1cdbd2cSJim Jagielski } 286*b1cdbd2cSJim Jagielski else if( rValue.getValueType() == ::getCppuType((const ParagraphTarget*)0) ) 287*b1cdbd2cSJim Jagielski { 288*b1cdbd2cSJim Jagielski ParagraphTarget aParaTarget; 289*b1cdbd2cSJim Jagielski rValue >>= aParaTarget; 290*b1cdbd2cSJim Jagielski 291*b1cdbd2cSJim Jagielski aParaTarget.Shape = getClonedShape( aParaTarget.Shape ); 292*b1cdbd2cSJim Jagielski 293*b1cdbd2cSJim Jagielski return makeAny( aParaTarget ); 294*b1cdbd2cSJim Jagielski } 295*b1cdbd2cSJim Jagielski else if( rValue.getValueType() == ::getCppuType((const Event*)0) ) 296*b1cdbd2cSJim Jagielski { 297*b1cdbd2cSJim Jagielski Event aEvent; 298*b1cdbd2cSJim Jagielski rValue >>= aEvent; 299*b1cdbd2cSJim Jagielski 300*b1cdbd2cSJim Jagielski aEvent.Source = transformValue( aEvent.Source ); 301*b1cdbd2cSJim Jagielski 302*b1cdbd2cSJim Jagielski return makeAny( aEvent ); 303*b1cdbd2cSJim Jagielski } 304*b1cdbd2cSJim Jagielski } 305*b1cdbd2cSJim Jagielski catch( Exception& e ) 306*b1cdbd2cSJim Jagielski { 307*b1cdbd2cSJim Jagielski (void)e; 308*b1cdbd2cSJim Jagielski DBG_ERROR( 309*b1cdbd2cSJim Jagielski (OString("sd::CustomAnimationClonerImpl::transformValue(), " 310*b1cdbd2cSJim Jagielski "exception caught: ") + 311*b1cdbd2cSJim Jagielski rtl::OUStringToOString( 312*b1cdbd2cSJim Jagielski comphelper::anyToString( cppu::getCaughtException() ), 313*b1cdbd2cSJim Jagielski RTL_TEXTENCODING_UTF8 )).getStr() ); 314*b1cdbd2cSJim Jagielski } 315*b1cdbd2cSJim Jagielski 316*b1cdbd2cSJim Jagielski return rValue; 317*b1cdbd2cSJim Jagielski } 318*b1cdbd2cSJim Jagielski getClonedShape(const Reference<XShape> & xSource) const319*b1cdbd2cSJim Jagielski Reference< XShape > CustomAnimationClonerImpl::getClonedShape( const Reference< XShape >& xSource ) const 320*b1cdbd2cSJim Jagielski { 321*b1cdbd2cSJim Jagielski if( xSource.is() ) 322*b1cdbd2cSJim Jagielski { 323*b1cdbd2cSJim Jagielski if( maShapeMap.find(xSource) != maShapeMap.end() ) 324*b1cdbd2cSJim Jagielski { 325*b1cdbd2cSJim Jagielski return maShapeMap[xSource]; 326*b1cdbd2cSJim Jagielski } 327*b1cdbd2cSJim Jagielski 328*b1cdbd2cSJim Jagielski DBG_ASSERT( maShapeMap.empty(), "sd::CustomAnimationClonerImpl::getClonedShape() failed!" ); 329*b1cdbd2cSJim Jagielski } 330*b1cdbd2cSJim Jagielski return xSource; 331*b1cdbd2cSJim Jagielski } 332*b1cdbd2cSJim Jagielski getClonedNode(const Reference<XAnimationNode> & xSource) const333*b1cdbd2cSJim Jagielski Reference< XAnimationNode > CustomAnimationClonerImpl::getClonedNode( const Reference< XAnimationNode >& xSource ) const 334*b1cdbd2cSJim Jagielski { 335*b1cdbd2cSJim Jagielski sal_Int32 nNode, nNodeCount = maSourceNodeVector.size(); 336*b1cdbd2cSJim Jagielski 337*b1cdbd2cSJim Jagielski for( nNode = 0; nNode < nNodeCount; nNode++ ) 338*b1cdbd2cSJim Jagielski { 339*b1cdbd2cSJim Jagielski if( maSourceNodeVector[nNode] == xSource ) 340*b1cdbd2cSJim Jagielski return maCloneNodeVector[nNode]; 341*b1cdbd2cSJim Jagielski } 342*b1cdbd2cSJim Jagielski 343*b1cdbd2cSJim Jagielski DBG_ERROR( "sd::CustomAnimationClonerImpl::getClonedNode() failed!" ); 344*b1cdbd2cSJim Jagielski return xSource; 345*b1cdbd2cSJim Jagielski } 346*b1cdbd2cSJim Jagielski } 347