21#include <com/sun/star/animations/XAnimateColor.hpp>
22#include <com/sun/star/animations/XCommand.hpp>
23#include <com/sun/star/animations/Timing.hpp>
24#include <com/sun/star/animations/Event.hpp>
25#include <com/sun/star/animations/XAnimateMotion.hpp>
26#include <com/sun/star/animations/XAnimatePhysics.hpp>
27#include <com/sun/star/animations/XAnimateTransform.hpp>
28#include <com/sun/star/animations/XTransitionFilter.hpp>
29#include <com/sun/star/animations/XIterateContainer.hpp>
30#include <com/sun/star/animations/XAudio.hpp>
31#include <com/sun/star/animations/AnimationColorSpace.hpp>
32#include <com/sun/star/animations/AnimationNodeType.hpp>
33#include <com/sun/star/animations/AnimationRestart.hpp>
34#include <com/sun/star/animations/EventTrigger.hpp>
35#include <com/sun/star/animations/AnimationFill.hpp>
36#include <com/sun/star/animations/AnimationEndSync.hpp>
37#include <com/sun/star/animations/AnimationCalcMode.hpp>
38#include <com/sun/star/animations/AnimationAdditiveMode.hpp>
39#include <com/sun/star/animations/AnimationTransformType.hpp>
40#include <com/sun/star/animations/TransitionType.hpp>
41#include <com/sun/star/animations/TransitionSubType.hpp>
42#include <com/sun/star/animations/ValuePair.hpp>
43#include <com/sun/star/container/XEnumerationAccess.hpp>
44#include <com/sun/star/beans/NamedValue.hpp>
45#include <com/sun/star/beans/XPropertySet.hpp>
46#include <com/sun/star/document/XStorageBasedDocument.hpp>
47#include <com/sun/star/embed/ElementModes.hpp>
48#include <com/sun/star/embed/XTransactedObject.hpp>
49#include <com/sun/star/presentation/EffectNodeType.hpp>
50#include <com/sun/star/presentation/EffectPresetClass.hpp>
51#include <com/sun/star/presentation/ParagraphTarget.hpp>
52#include <com/sun/star/presentation/TextAnimationType.hpp>
53#include <com/sun/star/presentation/ShapeAnimationSubType.hpp>
54#include <com/sun/star/presentation/EffectCommands.hpp>
70#include <animations.hxx>
74using namespace ::
cppu;
81using ::com::sun::star::uno::Any;
82using ::com::sun::star::uno::UNO_QUERY;
83using ::com::sun::star::uno::UNO_QUERY_THROW;
84using ::com::sun::star::uno::Reference;
85using ::com::sun::star::uno::Sequence;
86using ::com::sun::star::uno::Exception;
87using ::com::sun::star::uno::RuntimeException;
88using ::com::sun::star::uno::XInterface;
89using ::com::sun::star::beans::NamedValue;
90using ::com::sun::star::container::XEnumerationAccess;
91using ::com::sun::star::container::XEnumeration;
135 {
XML_LAST, AnimationEndSync::LAST },
136 {
XML_ALL, AnimationEndSync::ALL },
150 {
XML_BASE, AnimationAdditiveMode::BASE },
151 {
XML_SUM, AnimationAdditiveMode::SUM },
154 {
XML_NONE, AnimationAdditiveMode::NONE },
160 {
XML_SCALE, AnimationTransformType::SCALE },
161 {
XML_ROTATE, AnimationTransformType::ROTATE },
162 {
XML_SKEWX, AnimationTransformType::SKEWX },
163 {
XML_SKEWY, AnimationTransformType::SKEWY },
234 {
XML_DOWN, TransitionSubType::DOWN },
235 {
XML_LEFT, TransitionSubType::LEFT },
236 {
XML_UP, TransitionSubType::UP },
263 {
XML_TOP, TransitionSubType::TOP },
323 {
XML_IN, TransitionSubType::IN },
324 {
XML_OUT, TransitionSubType::OUT },
338 {
XML_BEGIN, EventTrigger::BEGIN_EVENT },
339 {
XML_END, EventTrigger::END_EVENT },
344 {
XML_NEXT, EventTrigger::ON_NEXT },
354 {
XML_EXIT, EffectPresetClass::EXIT },
374 {
XML_WHOLE, ShapeAnimationSubType::AS_WHOLE },
376 {
XML_TEXT, ShapeAnimationSubType::ONLY_TEXT },
424 return gImplConversionList;
433 void prepareNode(
const Reference< XAnimationNode >& xNode );
434 void exportNode(
const Reference< XAnimationNode >& xNode );
436 void exportContainer(
const Reference< XTimeContainer >& xNode, sal_Int16 nContainerNodeType );
438 void exportAudio(
const Reference< XAudio >& xAudio );
443 static void convertPath( OUStringBuffer& sTmp,
const Any& rPath );
461: mbHasTransition(false)
462, mxExport( &rExport )
463, mxPageProps( xPageProps )
471 OUString & o_rDir, OUString& o_rRest)
473 const sal_Int32
idx(i_rPath.indexOf(
u'/'));
474 if (idx < 0 || idx >= i_rPath.getLength()) {
478 }
else if (
idx == 0 ||
idx == i_rPath.getLength() - 1) {
482 o_rDir = i_rPath.copy(0,
idx);
483 o_rRest = i_rPath.copy(
idx+1);
489 uno::Reference<embed::XStorage>
const& xSource,
490 uno::Reference<embed::XStorage>
const& xTarget,
491 OUString
const& rPath)
496 throw uno::RuntimeException();
498 if (dir.getLength() == 0)
499 xSource->copyElementTo(rPath,
xTarget, rPath);
502 uno::Reference<embed::XStorage>
const xSubSource(
503 xSource->openStorageElement(dir, embed::ElementModes::READ));
504 uno::Reference<embed::XStorage>
const xSubTarget(
505 xTarget->openStorageElement(dir, embed::ElementModes::WRITE));
508 uno::Reference<embed::XTransactedObject>
const xTransaction(
xTarget, uno::UNO_QUERY);
509 if (xTransaction.is())
510 xTransaction->commit();
518 if (rURL.startsWithIgnoreAsciiCase(
s_PkgScheme, &urlPath))
524 uno::Reference<document::XStorageBasedDocument>
const xSBD(
525 rExport.
GetModel(), uno::UNO_QUERY_THROW);
526 uno::Reference<embed::XStorage>
const xSource(
527 xSBD->getDocumentStorage(), uno::UNO_SET_THROW);
528 uno::Reference<embed::XStorage>
const xTarget(
537 catch (uno::Exception
const&)
554 sal_Int16 nTransition = 0;
555 mxPageProps->getPropertyValue(
"TransitionType") >>= nTransition;
559 aSound >>= sSoundURL;
560 bool bStopSound =
false;
561 if( !(aSound >>= bStopSound) )
566 if( !((nTransition != 0) || !sSoundURL.isEmpty() || bStopSound) )
571 aEvent.Source <<= xSource;
572 aEvent.Trigger = EventTrigger::BEGIN_EVENT;
580 if( nTransition != 0 )
582 sal_Int16 nSubtype = 0;
583 bool bDirection =
false;
584 sal_Int32 nFadeColor = 0;
585 double fDuration = 0.0;
586 mxPageProps->getPropertyValue(
"TransitionSubtype") >>= nSubtype;
587 mxPageProps->getPropertyValue(
"TransitionDirection") >>= bDirection;
588 mxPageProps->getPropertyValue(
"TransitionFadeColor") >>= nFadeColor;
589 mxPageProps->getPropertyValue(
"TransitionDuration") >>= fDuration;
598 if( nSubtype != TransitionSubType::DEFAULT )
607 if( (nTransition == TransitionType::FADE)
608 && ((nSubtype == TransitionSubType::FADETOCOLOR) || (nSubtype == TransitionSubType::FADEFROMCOLOR)
609 || (nSubtype == TransitionSubType::FADEOVERCOLOR)))
622 else if( !sSoundURL.isEmpty())
627 bool bLoopSound =
false;
628 mxPageProps->getPropertyValue(
"LoopSound") >>= bLoopSound;
643 sal_Int16 nTransition = 0;
644 mxPageProps->getPropertyValue(
"TransitionType") >>= nTransition;
646 bool bStopSound =
false;
649 if( nTransition == 0 )
652 aSound >>= sSoundURL;
654 if( !(aSound >>= bStopSound) )
658 if( (nTransition != 0) || !sSoundURL.isEmpty() || bStopSound )
662 mxExport->getInterfaceToIdentifierMapper().registerReference( xInt );
678 sal_Int16 nNodeType = xNode->getType();
681 case AnimationNodeType::ITERATE:
683 Reference< XIterateContainer > xIter( xNode, UNO_QUERY_THROW );
687 case AnimationNodeType::PAR:
688 case AnimationNodeType::SEQ:
690 Reference< XEnumerationAccess > xEnumerationAccess( xNode, UNO_QUERY_THROW );
691 Reference< XEnumeration > xEnumeration( xEnumerationAccess->createEnumeration(), css::uno::UNO_SET_THROW );
692 while( xEnumeration->hasMoreElements() )
694 Reference< XAnimationNode > xChildNode( xEnumeration->nextElement(), UNO_QUERY_THROW );
700 case AnimationNodeType::ANIMATE:
701 case AnimationNodeType::SET:
702 case AnimationNodeType::ANIMATEMOTION:
703 case AnimationNodeType::ANIMATEPHYSICS:
704 case AnimationNodeType::ANIMATECOLOR:
705 case AnimationNodeType::ANIMATETRANSFORM:
706 case AnimationNodeType::TRANSITIONFILTER:
708 Reference< XAnimate > xAnimate( xNode, UNO_QUERY_THROW );
713 case AnimationNodeType::COMMAND:
715 Reference< XCommand > xCommand( xNode, UNO_QUERY_THROW );
720 case AnimationNodeType::AUDIO:
722 Reference< XAudio > xAudio( xNode, UNO_QUERY_THROW );
728 const Sequence< NamedValue > aUserData( xNode->getUserData() );
729 for(
const auto& rValue : aUserData )
733 Reference< XInterface > xMaster;
734 rValue.Value >>= xMaster;
736 mxExport->getInterfaceToIdentifierMapper().registerReference( xMaster );
752 const OUString& rExportIdentifier =
mxExport->getInterfaceToIdentifierMapper().getIdentifier( xNode );
753 if( !rExportIdentifier.isEmpty() )
759 Any aTemp( xNode->getBegin() );
760 if( aTemp.hasValue() )
769 aTemp = xNode->getDuration();
770 if( aTemp.hasValue() )
772 if( aTemp >>= fTemp )
781 if( aTemp >>= eTiming )
786 aTemp = xNode->getEnd();
787 if( aTemp.hasValue() )
793 nTemp = xNode->getFill();
794 if( nTemp != AnimationFill::DEFAULT )
800 nTemp = xNode->getFillDefault();
801 if( nTemp != AnimationFill::INHERIT )
807 nTemp = xNode->getRestart();
808 if( nTemp != AnimationRestart::DEFAULT )
814 nTemp = xNode->getRestartDefault();
815 if( nTemp != AnimationRestart::INHERIT )
821 fTemp = xNode->getAcceleration();
828 fTemp = xNode->getDecelerate();
835 bool bTemp = xNode->getAutoReverse();
842 aTemp = xNode->getRepeatCount();
843 if( aTemp.hasValue() )
846 if( (aTemp >>= eTiming ) && (eTiming == Timing_INDEFINITE ) )
848 else if( aTemp >>= fTemp )
855 aTemp = xNode->getRepeatDuration();
856 if( aTemp.hasValue() )
859 if( ( aTemp >>= eTiming ) && (eTiming == Timing_INDEFINITE) )
863 else if( aTemp >>= fTemp )
870 aTemp = xNode->getEndSync();
871 if( aTemp.hasValue() && (aTemp >>= nTemp) )
877 sal_Int16 nContainerNodeType = EffectNodeType::DEFAULT;
879 const Sequence< NamedValue > aUserData( xNode->getUserData() );
880 for(
const auto& rValue : aUserData )
884 if( (rValue.Value >>= nContainerNodeType) && (nContainerNodeType != EffectNodeType::DEFAULT) )
892 if( rValue.Value >>= aPresetId )
899 OUString aPresetSubType;
900 if( rValue.Value >>= aPresetSubType )
907 sal_Int16 nEffectPresetClass = sal_uInt16();
908 if( rValue.Value >>= nEffectPresetClass )
916 Reference< XInterface > xMaster;
917 rValue.Value >>= xMaster;
920 const OUString& rIdentifier =
mxExport->getInterfaceToIdentifierMapper().getIdentifier(xMaster);
921 if( !rIdentifier.isEmpty() )
927 sal_Int32 nGroupId = 0;
928 if( rValue.Value >>= nGroupId )
934 if( rValue.Value >>= aTmp )
939 nTemp = xNode->getType();
942 case AnimationNodeType::PAR:
943 case AnimationNodeType::SEQ:
944 case AnimationNodeType::ITERATE:
946 Reference< XTimeContainer > xContainer( xNode, UNO_QUERY_THROW );
951 case AnimationNodeType::ANIMATE:
952 case AnimationNodeType::SET:
953 case AnimationNodeType::ANIMATEMOTION:
954 case AnimationNodeType::ANIMATEPHYSICS:
955 case AnimationNodeType::ANIMATECOLOR:
956 case AnimationNodeType::ANIMATETRANSFORM:
957 case AnimationNodeType::TRANSITIONFILTER:
959 Reference< XAnimate > xAnimate( xNode, UNO_QUERY_THROW );
963 case AnimationNodeType::AUDIO:
965 Reference< XAudio > xAudio( xNode, UNO_QUERY_THROW );
969 case AnimationNodeType::COMMAND:
971 Reference< XCommand > xCommand( xNode, UNO_QUERY_THROW );
976 OSL_FAIL(
"xmloff::AnimationsExporterImpl::exportNode(), invalid AnimationNodeType!" );
992 const sal_Int32 nNodeType = xContainer->getType();
994 if( nNodeType == AnimationNodeType::ITERATE )
997 Reference< XIterateContainer > xIter( xContainer, UNO_QUERY_THROW );
999 Any aTemp( xIter->getTarget() );
1000 if( aTemp.hasValue() )
1006 sal_Int16 nTemp = xIter->getSubItem();
1013 nTemp = xIter->getIterateType();
1020 double fTemp = xIter->getIterateInterval();
1033 case AnimationNodeType::PAR: eElementToken =
XML_PAR;
break;
1034 case AnimationNodeType::SEQ: eElementToken =
XML_SEQ;
break;
1035 case AnimationNodeType::ITERATE:eElementToken =
XML_ITERATE;
break;
1037 OSL_FAIL(
"xmloff::AnimationsExporterImpl::exportContainer(), invalid TimeContainerType!" );
1042 if( nContainerNodeType == EffectNodeType::TIMING_ROOT )
1045 Reference< XEnumerationAccess > xEnumerationAccess( xContainer, UNO_QUERY_THROW );
1046 Reference< XEnumeration > xEnumeration( xEnumerationAccess->createEnumeration(), css::uno::UNO_SET_THROW );
1047 while( xEnumeration->hasMoreElements() )
1049 Reference< XAnimationNode > xChildNode( xEnumeration->nextElement(), UNO_QUERY_THROW );
1063 const sal_Int16 nNodeType = xAnimate->getType();
1065 OUStringBuffer sTmp;
1069 Any aTemp( xAnimate->getTarget() );
1070 if( aTemp.hasValue() )
1076 nTemp = xAnimate->getSubItem();
1085 if( nNodeType == AnimationNodeType::TRANSITIONFILTER )
1089 else if( nNodeType == AnimationNodeType::ANIMATETRANSFORM )
1093 else if( nNodeType == AnimationNodeType::ANIMATEMOTION )
1097 else if( nNodeType == AnimationNodeType::ANIMATEPHYSICS )
1103 OUString sTemp( xAnimate->getAttributeName() );
1104 if( !sTemp.isEmpty() )
1107 while(
p->mpAPIName )
1109 if( sTemp.equalsAscii(
p->mpAPIName ) )
1112 eAttributeName =
p->meXMLToken;
1127 Sequence< Any > aValues( xAnimate->getValues() );
1128 if( aValues.hasElements() )
1136 aTemp = xAnimate->getFrom();
1137 if( aTemp.hasValue() )
1143 aTemp = xAnimate->getBy();
1144 if( aTemp.hasValue() )
1150 aTemp = xAnimate->getTo();
1151 if( aTemp.hasValue() )
1158 if(nNodeType != AnimationNodeType::SET)
1160 const Sequence< double > aKeyTimes( xAnimate->getKeyTimes() );
1161 if( aKeyTimes.hasElements() )
1163 for(
const auto& rKeyTime : aKeyTimes )
1165 if( !sTmp.isEmpty() )
1168 sTmp.append( rKeyTime );
1173 OUString sTemp( xAnimate->getFormula() );
1174 if( !sTemp.isEmpty() )
1177 if( (nNodeType != AnimationNodeType::TRANSITIONFILTER) &&
1178 (nNodeType != AnimationNodeType::AUDIO ) )
1181 nTemp = xAnimate->getCalcMode();
1182 if( ((nNodeType == AnimationNodeType::ANIMATEMOTION ) && (nTemp != AnimationCalcMode::PACED)) ||
1183 ((nNodeType != AnimationNodeType::ANIMATEMOTION ) && (nTemp != AnimationCalcMode::LINEAR)) )
1189 bTemp = xAnimate->getAccumulate();
1193 nTemp = xAnimate->getAdditive();
1194 if( nTemp != AnimationAdditiveMode::REPLACE )
1201 const Sequence< TimeFilterPair > aTimeFilter( xAnimate->getTimeFilter() );
1202 if( aTimeFilter.hasElements() )
1204 for(
const auto& rPair : aTimeFilter )
1206 if( !sTmp.isEmpty() )
1209 sTmp.append(OUString::number(rPair.Time) +
"," + OUString::number(rPair.Progress));
1220 case AnimationNodeType::ANIMATE:
1224 case AnimationNodeType::SET:
1228 case AnimationNodeType::ANIMATEMOTION:
1232 Reference< XAnimateMotion > xAnimateMotion( xAnimate, UNO_QUERY_THROW );
1234 aTemp = xAnimateMotion->getPath();
1235 if( aTemp.hasValue() )
1242 aTemp = xAnimateMotion->getOrigin();
1246 case AnimationNodeType::ANIMATEPHYSICS:
1251 Reference< XAnimatePhysics > xAnimatePhysics( xAnimate, UNO_QUERY_THROW );
1252 aTemp = xAnimatePhysics->getStartVelocityX();
1253 if( aTemp.hasValue() )
1260 aTemp = xAnimatePhysics->getStartVelocityY();
1261 if( aTemp.hasValue() )
1268 aTemp = xAnimatePhysics->getDensity();
1269 if( aTemp.hasValue() )
1276 aTemp = xAnimatePhysics->getBounciness();
1277 if( aTemp.hasValue() )
1286 case AnimationNodeType::ANIMATECOLOR:
1290 Reference< XAnimateColor > xAnimateColor( xAnimate, UNO_QUERY_THROW );
1292 nTemp = xAnimateColor->getColorInterpolation();
1295 bTemp = xAnimateColor->getDirection();
1300 case AnimationNodeType::ANIMATETRANSFORM:
1306 Reference< XAnimateTransform > xTransform( xAnimate, UNO_QUERY_THROW );
1307 nTemp = xTransform->getTransformType();
1313 case AnimationNodeType::TRANSITIONFILTER:
1315 Reference< XTransitionFilter > xTransitionFilter( xAnimate, UNO_QUERY );
1318 sal_Int16 nTransition = xTransitionFilter->getTransition();
1322 sal_Int16 nSubtype = xTransitionFilter->getSubtype();
1323 if( nSubtype != TransitionSubType::DEFAULT )
1329 bTemp = xTransitionFilter->getMode();
1333 bTemp = xTransitionFilter->getDirection();
1337 if( (nTransition == TransitionType::FADE) && ((nSubtype == TransitionSubType::FADETOCOLOR) || (nSubtype == TransitionSubType::FADEFROMCOLOR) ))
1339 nTemp = xTransitionFilter->getFadeColor();
1370 OUString aSourceURL;
1371 xAudio->getSource() >>= aSourceURL;
1372 if( !aSourceURL.isEmpty() )
1375 const double fVolume = xAudio->getVolume();
1376 if( fVolume != 1.0 )
1378 OUStringBuffer sTmp;
1400 if( !xCommand.is() )
1405 OUStringBuffer sTmp;
1406 Any aTemp( xCommand->getTarget() );
1407 if( aTemp.hasValue() )
1413 sal_Int16 nCommand = xCommand->getCommand();
1432 Reference< XEnumerationAccess > xParaEnumAccess( pTarget.Shape, UNO_QUERY_THROW );
1434 Reference< XEnumeration > xEnumeration( xParaEnumAccess->createEnumeration(), css::uno::UNO_SET_THROW );
1435 sal_Int32 nParagraph = pTarget.Paragraph;
1437 while( xEnumeration->hasMoreElements() )
1439 Reference< XInterface > xRef( xEnumeration->nextElement(), UNO_QUERY );
1440 if( nParagraph-- == 0 )
1449 Reference< XInterface > xRef;
1463 if( !rValue.hasValue() )
1466 if(
auto pValuePair = o3tl::tryAccess<ValuePair>(rValue) )
1468 OUStringBuffer sTmp2;
1469 convertValue( eAttributeName, sTmp, pValuePair->First );
1471 convertValue( eAttributeName, sTmp2, pValuePair->Second );
1472 sTmp.append( sTmp2 );
1476 const sal_Int32
nLength = pSequence->getLength();
1478 const Any* pAny = pSequence->getConstArray();
1480 OUStringBuffer sTmp2;
1482 for( nElement = 0; nElement <
nLength; nElement++, pAny++ )
1484 if( !sTmp.isEmpty() )
1487 sTmp.append( sTmp2 );
1495 switch( eAttributeName )
1505 if(
auto aString = o3tl::tryAccess<OUString>(rValue) )
1507 sTmp.append( *aString );
1515 OSL_FAIL(
"xmloff::AnimationsExporterImpl::convertValue(), invalid value type!" );
1537 OSL_FAIL(
"xmloff::AnimationsExporterImpl::convertValue(), invalid AttributeName!" );
1547 sTmp.append( aString );
1554 if( !rValue.hasValue() )
1559 const sal_Int32
nLength = pSequence->getLength();
1561 const Any* pAny = pSequence->getConstArray();
1563 OUStringBuffer sTmp2;
1565 for( nElement = 0; nElement <
nLength; nElement++, pAny++ )
1567 if( !sTmp.isEmpty() )
1570 sTmp.append( sTmp2 );
1579 else if(
auto pTiming = o3tl::tryAccess<Timing>(rValue) )
1583 else if(
auto pEvent = o3tl::tryAccess<Event>(rValue) )
1585 OUStringBuffer sTmp2;
1587 if( pEvent->Trigger != EventTrigger::NONE )
1589 if( pEvent->Source.hasValue() )
1597 sTmp.append( sTmp2 );
1601 if( pEvent->Offset.hasValue() )
1605 if( !sTmp.isEmpty() )
1608 sTmp.append( sTmp2 );
1614 OSL_FAIL(
"xmloff::AnimationsExporterImpl::convertTiming(), invalid value type!" );
1623 Reference< XInterface > xRef;
1627 if(
auto pt = o3tl::tryAccess<ParagraphTarget>(
rTarget) )
1633 SAL_WARN_IF( !xRef.is(),
"xmloff",
"xmloff::AnimationsExporterImpl::convertTarget(), invalid target type!" );
1636 const OUString& rIdentifier =
mxExport->getInterfaceToIdentifierMapper().getIdentifier(xRef);
1637 if( !rIdentifier.isEmpty() )
1638 sTmp.append( rIdentifier );
1644 if( !rValue.hasValue() )
1647 if(
auto pValuePair = o3tl::tryAccess<ValuePair>(rValue) )
1654 const sal_Int32
nLength = pSequence->getLength();
1656 const Any* pAny = pSequence->getConstArray();
1658 for( nElement = 0; nElement <
nLength; nElement++, pAny++ )
1661 else if( rValue.getValueTypeClass() == css::uno::TypeClass_INTERFACE )
1663 Reference< XInterface> xRef( rValue, UNO_QUERY );
1665 mxExport->getInterfaceToIdentifierMapper().registerReference( xRef );
1667 else if(
auto pt = o3tl::tryAccess<ParagraphTarget>(rValue) )
1671 mxExport->getInterfaceToIdentifierMapper().registerReference( xRef );
1673 else if(
auto pEvent = o3tl::tryAccess<Event>(rValue) )
1692 if( xRootNode.is() )
1694 mpImpl->prepareTransitionNode();
1695 mpImpl->prepareNode( xRootNode );
1708 if( xRootNode.is() )
1710 bool bHasEffects =
mpImpl->mbHasTransition;
1715 Reference< XEnumerationAccess > xEnumerationAccess( xRootNode, UNO_QUERY_THROW );
1716 Reference< XEnumeration > xEnumeration( xEnumerationAccess->createEnumeration(), css::uno::UNO_SET_THROW );
1717 if( xEnumeration->hasMoreElements() )
1720 Reference< XAnimationNode > xMainNode( xEnumeration->nextElement(), UNO_QUERY_THROW );
1721 Reference< XEnumerationAccess > xMainEnumerationAccess( xMainNode, UNO_QUERY_THROW );
1722 Reference< XEnumeration > xMainEnumeration( xMainEnumerationAccess->createEnumeration(), css::uno::UNO_SET_THROW );
1726 bHasEffects = xMainEnumeration->hasMoreElements() || xEnumeration->hasMoreElements();
1731 mpImpl->exportNode( xRootNode );
OUString GetRelativeReference(const OUString &rValue)
const css::uno::Reference< css::frame::XModel > & GetModel() const
css::uno::Reference< css::embed::XStorage > const & GetTargetStorage() const
static bool convertEnum(EnumT &rEnum, std::u16string_view rValue, const SvXMLEnumMapEntry< EnumT > *pMap)
convert string to enum using given enum map, if the enum is not found in the map, this method will re...
Abstract base-class for different XML-types.
virtual bool exportXML(OUString &rStrExpValue, const css::uno::Any &rValue, const SvXMLUnitConverter &rUnitConverter) const =0
Exports the given value according to the XML-data-type corresponding to the derived class.
static void convertDouble(OUStringBuffer &rBuffer, double fNumber, bool bWriteUnits, sal_Int16 nSourceUnit, sal_Int16 nTargetUnit)
static bool convertColor(sal_Int32 &rColor, std::u16string_view rValue)
static void convertDuration(OUStringBuffer &rBuffer, const double fTime)
static bool convertBool(bool &rBool, std::u16string_view rString)
rtl::Reference< SvXMLExport > mxExport
Reference< XPropertySet > mxPageProps
void exportCommand(const Reference< XCommand > &xCommand)
rtl::Reference< XMLSdPropHdlFactory > mxSdPropHdlFactory
void convertTarget(OUStringBuffer &sTmp, const Any &rTarget) const
void exportNode(const Reference< XAnimationNode > &xNode)
AnimationsExporterImpl(SvXMLExport &rExport, const Reference< XPropertySet > &xPageProps)
void exportTransitionNode()
void convertValue(XMLTokenEnum eAttributeName, OUStringBuffer &sTmp, const Any &rValue) const
static Reference< XInterface > getParagraphTarget(const ParagraphTarget &pTarget)
void exportAnimate(const Reference< XAnimate > &xNode)
void exportContainer(const Reference< XTimeContainer > &xNode, sal_Int16 nContainerNodeType)
static void convertPath(OUStringBuffer &sTmp, const Any &rPath)
void exportAudio(const Reference< XAudio > &xAudio)
void prepareNode(const Reference< XAnimationNode > &xNode)
void convertTiming(OUStringBuffer &sTmp, const Any &rTiming) const
void prepareValue(const Any &rValue)
void prepareTransitionNode()
std::unique_ptr< AnimationsExporterImpl > mpImpl
void prepare(const css::uno::Reference< css::animations::XAnimationNode > &xRootNode)
virtual SAL_DLLPRIVATE ~AnimationsExporter() override
void exportAnimations(const css::uno::Reference< css::animations::XAnimationNode > &xRootNode)
AnimationsExporter(SvXMLExport &rExport, const css::uno::Reference< css::beans::XPropertySet > &xPageProps)
#define TOOLS_WARN_EXCEPTION(area, stream)
#define TOOLS_INFO_EXCEPTION(area, stream)
Reference< XInterface > xTarget
#define SAL_WARN_IF(condition, area, stream)
#define SAL_N_ELEMENTS(arr)
detail::Optional< double >::type tryAccess< double >(css::uno::Any const &any)
std::enable_if<!(detail::IsDerivedReference< T >::value||detail::IsUnoSequenceType< T >::value||std::is_base_of< css::uno::XInterface, T >::value), typenamedetail::Optional< T >::type >::type tryAccess(css::uno::Any const &any)
Handling of tokens in XML:
XMLTokenEnum
The enumeration of all XML tokens.
@ XML_PHYSICS_ANIMATION_START_VELOCITY_X
@ XML_PHYSICS_ANIMATION_START_VELOCITY_Y
@ XML_HORIZONTALRIGHTSAME
@ XML_BOTTOMRIGHTDIAGONAL
@ XML_PARALLELDIAGONALTOPLEFT
@ XML_HORIZONTALTOPRIGHTOPPOSITE
@ XML_COLOR_INTERPOLATION
@ XML_TOPRIGHTCOUNTERCLOCKWISE
@ XML_CLOCKWISEBOTTOMRIGHT
@ XML_COUNTERCLOCKWISETOPRIGHT
@ XML_DIAGONALBOTTOMLEFTOPPOSITE
@ XML_HORIZONTALTOPLEFTOPPOSITE
@ XML_INTERACTIVE_SEQUENCE
@ XML_DIAGONALTOPLEFTOPPOSITE
@ XML_BOTTOMLEFTCLOCKWISE
@ XML_VERTICALBOTTOMLEFTOPPOSITE
@ XML_PHYSICS_ANIMATION_DENSITY
@ XML_PHYSICS_ANIMATION_BOUNCINESS
@ XML_VERTICALTOPLEFTOPPOSITE
@ XML_BOTTOMRIGHTCOUNTERCLOCKWISE
@ XML_BOTTOMLEFTCOUNTERCLOCKWISE
@ XML_BOTTOMRIGHTCLOCKWISE
@ XML_PARALLELDIAGONALBOTTOMLEFT
@ XML_TEXT_ROTATION_ANGLE
@ XML_TOPLEFTCOUNTERCLOCKWISE
@ XML_COLOR_INTERPOLATION_DIRECTION
@ XML_COUNTERCLOCKWISEBOTTOMLEFT
bool IsXMLToken(std::u16string_view rString, enum XMLTokenEnum eToken)
compare eToken to the string
const OUString & GetXMLToken(enum XMLTokenEnum eToken)
return the OUString representation for eToken
const SvXMLEnumMapEntry< sal_Int16 > aAnimations_EnumMap_Endsync[]
const SvXMLEnumMapEntry< sal_Int16 > aAnimations_EnumMap_EventTrigger[]
const SvXMLEnumMapEntry< sal_Int16 > aAnimations_EnumMap_Fill[]
const SvXMLEnumMapEntry< sal_Int16 > aAnimations_EnumMap_TransitionSubType[]
const SvXMLEnumMapEntry< sal_Int16 > aAnimations_EnumMap_Command[]
const SvXMLEnumMapEntry< sal_Int16 > aAnimations_EnumMap_TransformType[]
const SvXMLEnumMapEntry< sal_Int16 > aAnimations_EnumMap_AdditiveMode[]
const SvXMLEnumMapEntry< sal_Int16 > aAnimations_EnumMap_FillDefault[]
static void lcl_CopyStream(uno::Reference< embed::XStorage > const &xSource, uno::Reference< embed::XStorage > const &xTarget, OUString const &rPath)
static OUString lcl_StoreMediaAndGetURL(SvXMLExport &rExport, OUString const &rURL)
static bool splitPath(OUString const &i_rPath, OUString &o_rDir, OUString &o_rRest)
split a uri hierarchy into first segment and rest
const SvXMLEnumMapEntry< sal_Int16 > aAnimations_EnumMap_RestartDefault[]
const SvXMLEnumMapEntry< sal_Int16 > aAnimations_EnumMap_CalcMode[]
const struct ImplAttributeNameConversion * getAnimationAttributeNamesConversionList()
const SvXMLEnumMapEntry< sal_Int16 > aAnimations_EnumMap_EffectNodeType[]
const SvXMLEnumMapEntry< sal_Int16 > aAnimations_EnumMap_Restart[]
const SvXMLEnumMapEntry< sal_Int16 > aAnimations_EnumMap_EffectPresetClass[]
const SvXMLEnumMapEntry< sal_Int16 > aAnimations_EnumMap_SubItem[]
const SvXMLEnumMapEntry< sal_Int16 > aAnimations_EnumMap_TransitionType[]
const SvXMLEnumMapEntry< sal_Int16 > aAnimations_EnumMap_IterateType[]
constexpr sal_uInt16 XML_NAMESPACE_SMIL
constexpr sal_uInt16 XML_NAMESPACE_XLINK
constexpr sal_uInt16 XML_NAMESPACE_ANIMATION
constexpr sal_uInt16 XML_NAMESPACE_SVG
constexpr sal_uInt16 XML_NAMESPACE_LO_EXT
constexpr sal_uInt16 XML_NAMESPACE_PRESENTATION
#define XML_SD_TYPE_PRESPAGE_VISIBILITY
#define XML_SD_TYPE_STROKE
#define XML_SD_TYPE_FILLSTYLE
#define XML_TYPE_TEXT_POSTURE
#define XML_TYPE_NUMBER16
#define XML_TYPE_TEXT_UNDERLINE_STYLE
#define XML_TYPE_TEXT_WEIGHT
#define XML_TYPE_DOUBLE_PERCENT