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>
74 using namespace ::
std;
75 using namespace ::
cppu;
82 using ::com::sun::star::uno::Any;
83 using ::com::sun::star::uno::UNO_QUERY;
84 using ::com::sun::star::uno::UNO_QUERY_THROW;
85 using ::com::sun::star::uno::Reference;
86 using ::com::sun::star::uno::Sequence;
87 using ::com::sun::star::uno::Exception;
88 using ::com::sun::star::uno::RuntimeException;
89 using ::com::sun::star::uno::XInterface;
90 using ::com::sun::star::beans::NamedValue;
91 using ::com::sun::star::container::XEnumerationAccess;
92 using ::com::sun::star::container::XEnumeration;
136 {
XML_LAST, AnimationEndSync::LAST },
137 {
XML_ALL, AnimationEndSync::ALL },
151 {
XML_BASE, AnimationAdditiveMode::BASE },
152 {
XML_SUM, AnimationAdditiveMode::SUM },
155 {
XML_NONE, AnimationAdditiveMode::NONE },
161 {
XML_SCALE, AnimationTransformType::SCALE },
162 {
XML_ROTATE, AnimationTransformType::ROTATE },
163 {
XML_SKEWX, AnimationTransformType::SKEWX },
164 {
XML_SKEWY, AnimationTransformType::SKEWY },
235 {
XML_DOWN, TransitionSubType::DOWN },
236 {
XML_LEFT, TransitionSubType::LEFT },
237 {
XML_UP, TransitionSubType::UP },
264 {
XML_TOP, TransitionSubType::TOP },
324 {
XML_IN, TransitionSubType::IN },
325 {
XML_OUT, TransitionSubType::OUT },
339 {
XML_BEGIN, EventTrigger::BEGIN_EVENT },
340 {
XML_END, EventTrigger::END_EVENT },
345 {
XML_NEXT, EventTrigger::ON_NEXT },
355 {
XML_EXIT, EffectPresetClass::EXIT },
375 {
XML_WHOLE, ShapeAnimationSubType::AS_WHOLE },
377 {
XML_TEXT, ShapeAnimationSubType::ONLY_TEXT },
425 return gImplConversionList;
434 void prepareNode(
const Reference< XAnimationNode >& xNode );
435 void exportNode(
const Reference< XAnimationNode >& xNode );
437 void exportContainer(
const Reference< XTimeContainer >& xNode, sal_Int16 nContainerNodeType );
438 void exportAnimate(
const Reference< XAnimate >& xNode );
439 void exportAudio(
const Reference< XAudio >& xAudio );
440 void exportCommand(
const Reference< XCommand >& xCommand );
442 static Reference< XInterface > getParagraphTarget(
const ParagraphTarget& pTarget );
444 static void convertPath( OUStringBuffer& sTmp,
const Any& rPath );
446 void convertTiming( OUStringBuffer& sTmp,
const Any& rTiming )
const;
447 void convertTarget( OUStringBuffer& sTmp,
const Any&
rTarget )
const;
449 void prepareValue(
const Any& rValue );
451 void exportTransitionNode();
452 void prepareTransitionNode();
462 : mbHasTransition(false)
463 , mxExport( &rExport )
464 , mxPageProps( xPageProps )
472 OUString & o_rDir, OUString& o_rRest)
474 const sal_Int32
idx(i_rPath.indexOf(
u'/'));
475 if (idx < 0 || idx >= i_rPath.getLength()) {
479 }
else if (
idx == 0 ||
idx == i_rPath.getLength() - 1) {
483 o_rDir = i_rPath.copy(0,
idx);
484 o_rRest = i_rPath.copy(
idx+1);
490 uno::Reference<embed::XStorage>
const& xSource,
491 uno::Reference<embed::XStorage>
const& xTarget,
492 OUString
const& rPath)
497 throw uno::RuntimeException();
499 if (dir.getLength() == 0)
500 xSource->copyElementTo(rPath, xTarget, rPath);
503 uno::Reference<embed::XStorage>
const xSubSource(
504 xSource->openStorageElement(dir, embed::ElementModes::READ));
505 uno::Reference<embed::XStorage>
const xSubTarget(
506 xTarget->openStorageElement(dir, embed::ElementModes::WRITE));
509 uno::Reference<embed::XTransactedObject>
const xTransaction(xTarget, uno::UNO_QUERY);
510 if (xTransaction.is())
511 xTransaction->commit();
519 if (rURL.startsWithIgnoreAsciiCase(s_PkgScheme, &urlPath))
525 uno::Reference<document::XStorageBasedDocument>
const xSBD(
526 rExport.
GetModel(), uno::UNO_QUERY_THROW);
527 uno::Reference<embed::XStorage>
const xSource(
528 xSBD->getDocumentStorage(), uno::UNO_SET_THROW);
529 uno::Reference<embed::XStorage>
const xTarget(
538 catch (uno::Exception
const&)
555 sal_Int16 nTransition = 0;
556 mxPageProps->getPropertyValue(
"TransitionType") >>= nTransition;
560 aSound >>= sSoundURL;
561 bool bStopSound =
false;
562 if( !(aSound >>= bStopSound) )
567 if( !((nTransition != 0) || !sSoundURL.isEmpty() || bStopSound) )
572 aEvent.Source <<= xSource;
573 aEvent.Trigger = EventTrigger::BEGIN_EVENT;
581 if( nTransition != 0 )
583 sal_Int16 nSubtype = 0;
584 bool bDirection =
false;
585 sal_Int32 nFadeColor = 0;
586 double fDuration = 0.0;
587 mxPageProps->getPropertyValue(
"TransitionSubtype") >>= nSubtype;
588 mxPageProps->getPropertyValue(
"TransitionDirection") >>= bDirection;
589 mxPageProps->getPropertyValue(
"TransitionFadeColor") >>= nFadeColor;
590 mxPageProps->getPropertyValue(
"TransitionDuration") >>= fDuration;
599 if( nSubtype != TransitionSubType::DEFAULT )
608 if( (nTransition == TransitionType::FADE)
609 && ((nSubtype == TransitionSubType::FADETOCOLOR) || (nSubtype == TransitionSubType::FADEFROMCOLOR)
610 || (nSubtype == TransitionSubType::FADEOVERCOLOR)))
623 else if( !sSoundURL.isEmpty())
628 bool bLoopSound =
false;
629 mxPageProps->getPropertyValue(
"LoopSound") >>= bLoopSound;
644 sal_Int16 nTransition = 0;
645 mxPageProps->getPropertyValue(
"TransitionType") >>= nTransition;
647 bool bStopSound =
false;
650 if( nTransition == 0 )
653 aSound >>= sSoundURL;
655 if( !(aSound >>= bStopSound) )
659 if( (nTransition != 0) || !sSoundURL.isEmpty() || bStopSound )
663 mxExport->getInterfaceToIdentifierMapper().registerReference( xInt );
679 sal_Int16 nNodeType = xNode->getType();
682 case AnimationNodeType::ITERATE:
684 Reference< XIterateContainer > xIter( xNode, UNO_QUERY_THROW );
688 case AnimationNodeType::PAR:
689 case AnimationNodeType::SEQ:
691 Reference< XEnumerationAccess > xEnumerationAccess( xNode, UNO_QUERY_THROW );
692 Reference< XEnumeration > xEnumeration( xEnumerationAccess->createEnumeration(), css::uno::UNO_SET_THROW );
693 while( xEnumeration->hasMoreElements() )
695 Reference< XAnimationNode > xChildNode( xEnumeration->nextElement(), UNO_QUERY_THROW );
701 case AnimationNodeType::ANIMATE:
702 case AnimationNodeType::SET:
703 case AnimationNodeType::ANIMATEMOTION:
704 case AnimationNodeType::ANIMATEPHYSICS:
705 case AnimationNodeType::ANIMATECOLOR:
706 case AnimationNodeType::ANIMATETRANSFORM:
707 case AnimationNodeType::TRANSITIONFILTER:
709 Reference< XAnimate > xAnimate( xNode, UNO_QUERY_THROW );
714 case AnimationNodeType::COMMAND:
716 Reference< XCommand > xCommand( xNode, UNO_QUERY_THROW );
721 case AnimationNodeType::AUDIO:
723 Reference< XAudio > xAudio( xNode, UNO_QUERY_THROW );
729 const Sequence< NamedValue > aUserData( xNode->getUserData() );
730 for(
const auto&
rValue : aUserData )
734 Reference< XInterface > xMaster;
737 mxExport->getInterfaceToIdentifierMapper().registerReference( xMaster );
753 const OUString& rExportIdentifier =
mxExport->getInterfaceToIdentifierMapper().getIdentifier( xNode );
754 if( !rExportIdentifier.isEmpty() )
760 Any aTemp( xNode->getBegin() );
761 if( aTemp.hasValue() )
770 aTemp = xNode->getDuration();
771 if( aTemp.hasValue() )
773 if( aTemp >>= fTemp )
782 if( aTemp >>= eTiming )
787 aTemp = xNode->getEnd();
788 if( aTemp.hasValue() )
794 nTemp = xNode->getFill();
795 if( nTemp != AnimationFill::DEFAULT )
801 nTemp = xNode->getFillDefault();
802 if( nTemp != AnimationFill::INHERIT )
808 nTemp = xNode->getRestart();
809 if( nTemp != AnimationRestart::DEFAULT )
815 nTemp = xNode->getRestartDefault();
816 if( nTemp != AnimationRestart::INHERIT )
822 fTemp = xNode->getAcceleration();
829 fTemp = xNode->getDecelerate();
836 bool bTemp = xNode->getAutoReverse();
843 aTemp = xNode->getRepeatCount();
844 if( aTemp.hasValue() )
847 if( (aTemp >>= eTiming ) && (eTiming == Timing_INDEFINITE ) )
849 else if( aTemp >>= fTemp )
856 aTemp = xNode->getRepeatDuration();
857 if( aTemp.hasValue() )
860 if( ( aTemp >>= eTiming ) && (eTiming == Timing_INDEFINITE) )
864 else if( aTemp >>= fTemp )
871 aTemp = xNode->getEndSync();
872 if( aTemp.hasValue() && (aTemp >>= nTemp) )
878 sal_Int16 nContainerNodeType = EffectNodeType::DEFAULT;
880 const Sequence< NamedValue > aUserData( xNode->getUserData() );
881 for(
const auto&
rValue : aUserData )
885 if( (
rValue.Value >>= nContainerNodeType) && (nContainerNodeType != EffectNodeType::DEFAULT) )
893 if(
rValue.Value >>= aPresetId )
900 OUString aPresetSubType;
901 if(
rValue.Value >>= aPresetSubType )
908 sal_Int16 nEffectPresetClass = sal_uInt16();
909 if(
rValue.Value >>= nEffectPresetClass )
917 Reference< XInterface > xMaster;
921 const OUString& rIdentifier =
mxExport->getInterfaceToIdentifierMapper().getIdentifier(xMaster);
922 if( !rIdentifier.isEmpty() )
928 sal_Int32 nGroupId = 0;
929 if(
rValue.Value >>= nGroupId )
935 if(
rValue.Value >>= aTmp )
940 nTemp = xNode->getType();
943 case AnimationNodeType::PAR:
944 case AnimationNodeType::SEQ:
945 case AnimationNodeType::ITERATE:
947 Reference< XTimeContainer > xContainer( xNode, UNO_QUERY_THROW );
952 case AnimationNodeType::ANIMATE:
953 case AnimationNodeType::SET:
954 case AnimationNodeType::ANIMATEMOTION:
955 case AnimationNodeType::ANIMATEPHYSICS:
956 case AnimationNodeType::ANIMATECOLOR:
957 case AnimationNodeType::ANIMATETRANSFORM:
958 case AnimationNodeType::TRANSITIONFILTER:
960 Reference< XAnimate > xAnimate( xNode, UNO_QUERY_THROW );
964 case AnimationNodeType::AUDIO:
966 Reference< XAudio > xAudio( xNode, UNO_QUERY_THROW );
970 case AnimationNodeType::COMMAND:
972 Reference< XCommand > xCommand( xNode, UNO_QUERY_THROW );
977 OSL_FAIL(
"xmloff::AnimationsExporterImpl::exportNode(), invalid AnimationNodeType!" );
993 const sal_Int32 nNodeType = xContainer->getType();
995 if( nNodeType == AnimationNodeType::ITERATE )
998 Reference< XIterateContainer > xIter( xContainer, UNO_QUERY_THROW );
1000 Any aTemp( xIter->getTarget() );
1001 if( aTemp.hasValue() )
1007 sal_Int16 nTemp = xIter->getSubItem();
1014 nTemp = xIter->getIterateType();
1021 double fTemp = xIter->getIterateInterval();
1034 case AnimationNodeType::PAR: eElementToken =
XML_PAR;
break;
1035 case AnimationNodeType::SEQ: eElementToken =
XML_SEQ;
break;
1036 case AnimationNodeType::ITERATE:eElementToken =
XML_ITERATE;
break;
1038 OSL_FAIL(
"xmloff::AnimationsExporterImpl::exportContainer(), invalid TimeContainerType!" );
1043 if( nContainerNodeType == EffectNodeType::TIMING_ROOT )
1046 Reference< XEnumerationAccess > xEnumerationAccess( xContainer, UNO_QUERY_THROW );
1047 Reference< XEnumeration > xEnumeration( xEnumerationAccess->createEnumeration(), css::uno::UNO_SET_THROW );
1048 while( xEnumeration->hasMoreElements() )
1050 Reference< XAnimationNode > xChildNode( xEnumeration->nextElement(), UNO_QUERY_THROW );
1064 const sal_Int16 nNodeType = xAnimate->getType();
1066 OUStringBuffer sTmp;
1070 Any aTemp( xAnimate->getTarget() );
1071 if( aTemp.hasValue() )
1077 nTemp = xAnimate->getSubItem();
1086 if( nNodeType == AnimationNodeType::TRANSITIONFILTER )
1090 else if( nNodeType == AnimationNodeType::ANIMATETRANSFORM )
1094 else if( nNodeType == AnimationNodeType::ANIMATEMOTION )
1098 else if( nNodeType == AnimationNodeType::ANIMATEPHYSICS )
1104 OUString sTemp( xAnimate->getAttributeName() );
1105 if( !sTemp.isEmpty() )
1128 Sequence< Any > aValues( xAnimate->getValues() );
1129 if( aValues.hasElements() )
1137 aTemp = xAnimate->getFrom();
1138 if( aTemp.hasValue() )
1144 aTemp = xAnimate->getBy();
1145 if( aTemp.hasValue() )
1151 aTemp = xAnimate->getTo();
1152 if( aTemp.hasValue() )
1159 if(nNodeType != AnimationNodeType::SET)
1161 const Sequence< double > aKeyTimes( xAnimate->getKeyTimes() );
1162 if( aKeyTimes.hasElements() )
1164 for(
const auto& rKeyTime : aKeyTimes )
1166 if( !sTmp.isEmpty() )
1169 sTmp.append( rKeyTime );
1174 OUString sTemp( xAnimate->getFormula() );
1175 if( !sTemp.isEmpty() )
1178 if( (nNodeType != AnimationNodeType::TRANSITIONFILTER) &&
1179 (nNodeType != AnimationNodeType::AUDIO ) )
1182 nTemp = xAnimate->getCalcMode();
1183 if( ((nNodeType == AnimationNodeType::ANIMATEMOTION ) && (nTemp != AnimationCalcMode::PACED)) ||
1184 ((nNodeType != AnimationNodeType::ANIMATEMOTION ) && (nTemp != AnimationCalcMode::LINEAR)) )
1190 bTemp = xAnimate->getAccumulate();
1194 nTemp = xAnimate->getAdditive();
1195 if( nTemp != AnimationAdditiveMode::REPLACE )
1202 const Sequence< TimeFilterPair > aTimeFilter( xAnimate->getTimeFilter() );
1203 if( aTimeFilter.hasElements() )
1205 for(
const auto& rPair : aTimeFilter )
1207 if( !sTmp.isEmpty() )
1210 sTmp.append( OUString::number(rPair.Time) ).append(
"," ).append( OUString::number(rPair.Progress) );
1221 case AnimationNodeType::ANIMATE:
1225 case AnimationNodeType::SET:
1229 case AnimationNodeType::ANIMATEMOTION:
1233 Reference< XAnimateMotion > xAnimateMotion( xAnimate, UNO_QUERY_THROW );
1235 aTemp = xAnimateMotion->getPath();
1236 if( aTemp.hasValue() )
1243 aTemp = xAnimateMotion->getOrigin();
1247 case AnimationNodeType::ANIMATEPHYSICS:
1252 Reference< XAnimatePhysics > xAnimatePhysics( xAnimate, UNO_QUERY_THROW );
1253 aTemp = xAnimatePhysics->getStartVelocityX();
1254 if( aTemp.hasValue() )
1261 aTemp = xAnimatePhysics->getStartVelocityY();
1262 if( aTemp.hasValue() )
1269 aTemp = xAnimatePhysics->getDensity();
1270 if( aTemp.hasValue() )
1277 aTemp = xAnimatePhysics->getBounciness();
1278 if( aTemp.hasValue() )
1287 case AnimationNodeType::ANIMATECOLOR:
1291 Reference< XAnimateColor > xAnimateColor( xAnimate, UNO_QUERY_THROW );
1293 nTemp = xAnimateColor->getColorInterpolation();
1296 bTemp = xAnimateColor->getDirection();
1301 case AnimationNodeType::ANIMATETRANSFORM:
1307 Reference< XAnimateTransform > xTransform( xAnimate, UNO_QUERY_THROW );
1308 nTemp = xTransform->getTransformType();
1314 case AnimationNodeType::TRANSITIONFILTER:
1316 Reference< XTransitionFilter > xTransitionFilter( xAnimate, UNO_QUERY );
1319 sal_Int16 nTransition = xTransitionFilter->getTransition();
1323 sal_Int16 nSubtype = xTransitionFilter->getSubtype();
1324 if( nSubtype != TransitionSubType::DEFAULT )
1330 bTemp = xTransitionFilter->getMode();
1334 bTemp = xTransitionFilter->getDirection();
1338 if( (nTransition == TransitionType::FADE) && ((nSubtype == TransitionSubType::FADETOCOLOR) || (nSubtype == TransitionSubType::FADEFROMCOLOR) ))
1340 nTemp = xTransitionFilter->getFadeColor();
1371 OUString aSourceURL;
1372 xAudio->getSource() >>= aSourceURL;
1373 if( !aSourceURL.isEmpty() )
1376 const double fVolume = xAudio->getVolume();
1377 if( fVolume != 1.0 )
1379 OUStringBuffer sTmp;
1401 if( !xCommand.is() )
1406 OUStringBuffer sTmp;
1407 Any aTemp( xCommand->getTarget() );
1408 if( aTemp.hasValue() )
1414 sal_Int16 nCommand = xCommand->getCommand();
1433 Reference< XEnumerationAccess > xParaEnumAccess( pTarget.Shape, UNO_QUERY_THROW );
1435 Reference< XEnumeration > xEnumeration( xParaEnumAccess->createEnumeration(), css::uno::UNO_SET_THROW );
1436 sal_Int32 nParagraph = pTarget.Paragraph;
1438 while( xEnumeration->hasMoreElements() )
1440 Reference< XInterface > xRef( xEnumeration->nextElement(), UNO_QUERY );
1441 if( nParagraph-- == 0 )
1450 Reference< XInterface > xRef;
1464 if( !rValue.hasValue() )
1467 if(
auto pValuePair = o3tl::tryAccess<ValuePair>(rValue) )
1469 OUStringBuffer sTmp2;
1470 convertValue( eAttributeName, sTmp, pValuePair->First );
1472 convertValue( eAttributeName, sTmp2, pValuePair->Second );
1473 sTmp.append( sTmp2.makeStringAndClear() );
1477 const sal_Int32
nLength = pSequence->getLength();
1479 const Any* pAny = pSequence->getConstArray();
1481 OUStringBuffer sTmp2;
1483 for( nElement = 0; nElement <
nLength; nElement++, pAny++ )
1485 if( !sTmp.isEmpty() )
1488 sTmp.append( sTmp2.makeStringAndClear() );
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.makeStringAndClear() );
1578 else if(
auto pTiming = o3tl::tryAccess<Timing>(rValue) )
1582 else if(
auto pEvent = o3tl::tryAccess<Event>(rValue) )
1584 OUStringBuffer sTmp2;
1586 if( pEvent->Trigger != EventTrigger::NONE )
1588 if( pEvent->Source.hasValue() )
1596 sTmp.append( sTmp2.makeStringAndClear() );
1599 if( pEvent->Offset.hasValue() )
1603 if( !sTmp.isEmpty() )
1606 sTmp.append( sTmp2.makeStringAndClear() );
1611 OSL_FAIL(
"xmloff::AnimationsExporterImpl::convertTiming(), invalid value type!" );
1617 if( !rTarget.hasValue() )
1620 Reference< XInterface > xRef;
1622 if( !(rTarget >>= xRef) )
1624 if(
auto pt = o3tl::tryAccess<ParagraphTarget>(rTarget) )
1630 SAL_WARN_IF( !xRef.is(),
"xmloff",
"xmloff::AnimationsExporterImpl::convertTarget(), invalid target type!" );
1633 const OUString& rIdentifier =
mxExport->getInterfaceToIdentifierMapper().getIdentifier(xRef);
1634 if( !rIdentifier.isEmpty() )
1635 sTmp.append( rIdentifier );
1641 if( !rValue.hasValue() )
1644 if(
auto pValuePair = o3tl::tryAccess<ValuePair>(rValue) )
1651 const sal_Int32
nLength = pSequence->getLength();
1653 const Any* pAny = pSequence->getConstArray();
1655 for( nElement = 0; nElement <
nLength; nElement++, pAny++ )
1658 else if( rValue.getValueTypeClass() == css::uno::TypeClass_INTERFACE )
1660 Reference< XInterface> xRef( rValue, UNO_QUERY );
1662 mxExport->getInterfaceToIdentifierMapper().registerReference( xRef );
1664 else if(
auto pt = o3tl::tryAccess<ParagraphTarget>(rValue) )
1668 mxExport->getInterfaceToIdentifierMapper().registerReference( xRef );
1670 else if(
auto pEvent = o3tl::tryAccess<Event>(rValue) )
1689 if( xRootNode.is() )
1691 mpImpl->prepareTransitionNode();
1692 mpImpl->prepareNode( xRootNode );
1705 if( xRootNode.is() )
1707 bool bHasEffects =
mpImpl->mbHasTransition;
1712 Reference< XEnumerationAccess > xEnumerationAccess( xRootNode, UNO_QUERY_THROW );
1713 Reference< XEnumeration > xEnumeration( xEnumerationAccess->createEnumeration(), css::uno::UNO_SET_THROW );
1714 if( xEnumeration->hasMoreElements() )
1717 Reference< XAnimationNode > xMainNode( xEnumeration->nextElement(), UNO_QUERY_THROW );
1718 Reference< XEnumerationAccess > xMainEnumerationAccess( xMainNode, UNO_QUERY_THROW );
1719 Reference< XEnumeration > xMainEnumeration( xMainEnumerationAccess->createEnumeration(), css::uno::UNO_SET_THROW );
1723 bHasEffects = xMainEnumeration->hasMoreElements() || xEnumeration->hasMoreElements();
1728 mpImpl->exportNode( xRootNode );
void exportCommand(const Reference< XCommand > &xCommand)
css::uno::Reference< css::embed::XStorage > const & GetTargetStorage() const
#define XML_TYPE_TEXT_UNDERLINE_STYLE
virtual ~AnimationsExporter() override
constexpr sal_uInt16 XML_NAMESPACE_ANIMATION
const SvXMLEnumMapEntry< sal_Int16 > aAnimations_EnumMap_TransitionSubType[]
const SvXMLEnumMapEntry< sal_Int16 > aAnimations_EnumMap_EffectPresetClass[]
void convertTiming(OUStringBuffer &sTmp, const Any &rTiming) const
void convertTarget(OUStringBuffer &sTmp, const Any &rTarget) const
std::unique_ptr< AnimationsExporterImpl > mpImpl
const SvXMLEnumMapEntry< sal_Int16 > aAnimations_EnumMap_TransitionType[]
detail::Optional< double >::type tryAccess< double >(css::uno::Any const &any)
void prepareNode(const Reference< XAnimationNode > &xNode)
Reference< XInterface > xTarget
void exportAnimations(const css::uno::Reference< css::animations::XAnimationNode > &xRootNode)
#define XML_TYPE_TEXT_POSTURE
void exportContainer(const Reference< XTimeContainer > &xNode, sal_Int16 nContainerNodeType)
const SvXMLEnumMapEntry< sal_Int16 > aAnimations_EnumMap_Restart[]
constexpr sal_uInt16 XML_NAMESPACE_XLINK
rtl::Reference< XMLSdPropHdlFactory > mxSdPropHdlFactory
const SvXMLEnumMapEntry< sal_Int16 > aAnimations_EnumMap_TransformType[]
constexpr sal_uInt16 XML_NAMESPACE_LO_EXT
bool IsXMLToken(std::u16string_view rString, enum XMLTokenEnum eToken)
compare eToken to the string
static void lcl_CopyStream(uno::Reference< embed::XStorage > const &xSource, uno::Reference< embed::XStorage > const &xTarget, OUString const &rPath)
rtl::Reference< SvXMLExport > mxExport
static void convertDouble(OUStringBuffer &rBuffer, double fNumber, bool bWriteUnits, sal_Int16 nSourceUnit, sal_Int16 nTargetUnit)
const SvXMLEnumMapEntry< sal_Int16 > aAnimations_EnumMap_Fill[]
css::uno::Any const & rValue
#define XML_TYPE_DOUBLE_PERCENT
const css::uno::Reference< css::frame::XModel > & GetModel() const
const SvXMLEnumMapEntry< sal_Int16 > aAnimations_EnumMap_Command[]
#define XML_SD_TYPE_STROKE
std::enable_if< !(detail::IsDerivedReference< T >::value||detail::IsUnoSequenceType< T >::value||std::is_base_of< css::uno::XInterface, T >::value), typename detail::Optional< T >::type >::type tryAccess(css::uno::Any const &any)
#define XML_SD_TYPE_PRESPAGE_VISIBILITY
static void convertPath(OUStringBuffer &sTmp, const Any &rPath)
static Reference< XInterface > getParagraphTarget(const ParagraphTarget &pTarget)
Reference< XPropertySet > mxPageProps
OUString GetRelativeReference(const OUString &rValue)
XMLTokenEnum
The enumeration of all XML tokens.
#define SAL_N_ELEMENTS(arr)
constexpr sal_uInt16 XML_NAMESPACE_SVG
#define TOOLS_WARN_EXCEPTION(area, stream)
const SvXMLEnumMapEntry< sal_Int16 > aAnimations_EnumMap_EffectNodeType[]
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_Endsync[]
const SvXMLEnumMapEntry< sal_Int16 > aAnimations_EnumMap_CalcMode[]
const SvXMLEnumMapEntry< sal_Int16 > aAnimations_EnumMap_EventTrigger[]
void exportNode(const Reference< XAnimationNode > &xNode)
const struct ImplAttributeNameConversion * getAnimationAttributeNamesConversionList()
static bool convertColor(sal_Int32 &rColor, std::u16string_view rValue)
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...
#define XML_SD_TYPE_FILLSTYLE
static void convertDuration(OUStringBuffer &rBuffer, const double fTime)
void prepare(const css::uno::Reference< css::animations::XAnimationNode > &xRootNode)
#define XML_TYPE_NUMBER16
void convertValue(XMLTokenEnum eAttributeName, OUStringBuffer &sTmp, const Any &rValue) const
static bool convertBool(bool &rBool, std::u16string_view rString)
AnimationsExporter(SvXMLExport &rExport, const css::uno::Reference< css::beans::XPropertySet > &xPageProps)
void prepareValue(const Any &rValue)
#define TOOLS_INFO_EXCEPTION(area, stream)
Map an XMLTokenEnum to an enum value.
constexpr sal_uInt16 XML_NAMESPACE_PRESENTATION
void exportAnimate(const Reference< XAnimate > &xNode)
const SvXMLEnumMapEntry< sal_Int16 > aAnimations_EnumMap_SubItem[]
#define SAL_WARN_IF(condition, area, stream)
const OUString & GetXMLToken(enum XMLTokenEnum eToken)
return the OUString representation for eToken
constexpr sal_uInt16 XML_NAMESPACE_SMIL
Handling of tokens in XML:
const SvXMLEnumMapEntry< sal_Int16 > aAnimations_EnumMap_RestartDefault[]
const SvXMLEnumMapEntry< sal_Int16 > aAnimations_EnumMap_IterateType[]
void prepareTransitionNode()
const SvXMLEnumMapEntry< sal_Int16 > aAnimations_EnumMap_AdditiveMode[]
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...
const SvXMLEnumMapEntry< sal_Int16 > aAnimations_EnumMap_FillDefault[]
void exportTransitionNode()
static OUString lcl_StoreMediaAndGetURL(SvXMLExport &rExport, OUString const &rURL)
token::XMLTokenEnum meXMLToken
#define XML_TYPE_TEXT_WEIGHT
Abstract base-class for different XML-types.
void exportAudio(const Reference< XAudio > &xAudio)
css::uno::Any const SvXMLExport & rExport