diff options
author | Jan Holesovsky <kendy@collabora.com> | 2017-09-05 16:53:14 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-09-07 10:28:21 +0200 |
commit | 50f8e0e479e70fca3620da192e5a2cc4ca12bc2c (patch) | |
tree | 91fe75ed22a8df68251191e47d3091139edd0cdd /sd/source | |
parent | 7b65e7eea560da718c3cbc76a049a8d60b2809e9 (diff) |
tdf#106867: Export videos in PPTX.
Contains also:
tdf#106867: Implement pptx export of AnimationNodeType::COMMAND.
tdf#106867: Import target for commands in PPTX.
tdf#106867: Write also the extended markup to fully support embedded videos.
tdf#106867: Unit test for the export of embedded videos.
Change-Id: I7f4f389a72aa7ecef65d87f07bb69ba8f3374a14
Reviewed-on: https://gerrit.libreoffice.org/42017
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'sd/source')
-rw-r--r-- | sd/source/filter/eppt/epptooxml.hxx | 1 | ||||
-rw-r--r-- | sd/source/filter/eppt/pptx-epptooxml.cxx | 56 |
2 files changed, 57 insertions, 0 deletions
diff --git a/sd/source/filter/eppt/epptooxml.hxx b/sd/source/filter/eppt/epptooxml.hxx index 1134daf6cb7a..ebfe5d345813 100644 --- a/sd/source/filter/eppt/epptooxml.hxx +++ b/sd/source/filter/eppt/epptooxml.hxx @@ -108,6 +108,7 @@ protected: void WriteAnimationNodeAnimateInside( const ::sax_fastparser::FSHelperPtr& pFS, const css::uno::Reference< css::animations::XAnimationNode >& rXNode, bool bMainSeqChild, bool bSimple ); void WriteAnimationNodeSeq( const ::sax_fastparser::FSHelperPtr& pFS, const css::uno::Reference< css::animations::XAnimationNode >& rXNode, sal_Int32 nXmlNodeType, bool bMainSeqChild ); void WriteAnimationNodeEffect( const ::sax_fastparser::FSHelperPtr& pFS, const css::uno::Reference< css::animations::XAnimationNode >& rXNode, sal_Int32 nXmlNodeType, bool bMainSeqChild ); + void WriteAnimationNodeCommand(const ::sax_fastparser::FSHelperPtr& pFS, const css::uno::Reference< css::animations::XAnimationNode >& rXNode, sal_Int32 nXmlNodeType, bool bMainSeqChild ); void WriteAnimationNodeCommonPropsStart( const ::sax_fastparser::FSHelperPtr& pFS, const css::uno::Reference< css::animations::XAnimationNode >& rXNode, bool bSingle, bool bMainSeqChild ); static void WriteAnimationProperty( const ::sax_fastparser::FSHelperPtr& pFS, const css::uno::Any& rAny ); void WriteAnimationTarget( const ::sax_fastparser::FSHelperPtr& pFS, const css::uno::Any& rTarget ); diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx b/sd/source/filter/eppt/pptx-epptooxml.cxx index 383706809c89..d4d8fe6908b4 100644 --- a/sd/source/filter/eppt/pptx-epptooxml.cxx +++ b/sd/source/filter/eppt/pptx-epptooxml.cxx @@ -49,6 +49,7 @@ #include <com/sun/star/animations/XAnimateMotion.hpp> #include <com/sun/star/animations/XAnimationNode.hpp> #include <com/sun/star/animations/XAnimationNodeSupplier.hpp> +#include <com/sun/star/animations/XCommand.hpp> #include <com/sun/star/animations/XTransitionFilter.hpp> #include <com/sun/star/beans/Property.hpp> #include <com/sun/star/beans/XPropertySetInfo.hpp> @@ -60,6 +61,7 @@ #include <com/sun/star/office/XAnnotationEnumeration.hpp> #include <com/sun/star/office/XAnnotationAccess.hpp> #include <com/sun/star/presentation/AnimationSpeed.hpp> +#include <com/sun/star/presentation/EffectCommands.hpp> #include <com/sun/star/presentation/EffectNodeType.hpp> #include <com/sun/star/util/DateTime.hpp> @@ -309,6 +311,8 @@ ShapeExport& PowerPointShapeExport::WriteUnknownShape( const Reference< XShape > if( !WritePlaceholder( xShape, Subtitle, mbMaster ) ) ShapeExport::WriteTextShape( xShape ); } + else + SAL_WARN("sd.eppt", "unknown shape not handled: " << USS(sShapeType)); return *this; } @@ -1061,6 +1065,7 @@ void PowerPointExport::WriteAnimationCondition( const FSHelperPtr& pFS, Any& rAn double fDelay = 0; Timing eTiming; Event aEvent; + Reference<XShape> xShape; const char* pDelay = nullptr; const char* pEvent = nullptr; @@ -1127,6 +1132,15 @@ void PowerPointExport::WriteAnimationCondition( const FSHelperPtr& pFS, Any& rAn SAL_INFO("sd.eppt", "event offset timing: " << eTiming); } } + else if (rAny >>= xShape) + { + SAL_INFO("sd.eppt", "Got the xShape: " << xShape->getShapeType()); + if (xShape->getShapeType() == "com.sun.star.drawing.MediaShape" || xShape->getShapeType() == "com.sun.star.presentation.MediaShape") + { + // write the default + bHasFDelay = true; + } + } WriteAnimationCondition( pFS, pDelay, pEvent, fDelay, bHasFDelay ); } @@ -1358,6 +1372,41 @@ void PowerPointExport::WriteAnimationNodeEffect( const FSHelperPtr& pFS, const R } } +void PowerPointExport::WriteAnimationNodeCommand(const FSHelperPtr& pFS, const Reference< XAnimationNode >& rXNode, sal_Int32, bool bMainSeqChild) +{ + SAL_INFO("sd.eppt", "write animation node COMMAND"); + Reference<XCommand> xCommand(rXNode, UNO_QUERY); + if (xCommand.is()) + { + const char* pType = "call"; + const char* pCommand = nullptr; + switch (xCommand->getCommand()) + { + case EffectCommands::VERB: pType = "verb"; pCommand = "1"; /* FIXME hardcoded viewing */ break; + case EffectCommands::PLAY: pCommand = "play"; break; + case EffectCommands::TOGGLEPAUSE: pCommand = "togglePause"; break; + case EffectCommands::STOP: pCommand = "stop"; break; + default: + SAL_WARN("sd.eppt", "unknown command: " << xCommand->getCommand()); + break; + } + + pFS->startElementNS(XML_p, XML_cmd, + XML_type, pType, + XML_cmd, pCommand, + FSEND); + + WriteAnimationNodeAnimateInside(pFS, rXNode, bMainSeqChild, false); + pFS->startElementNS(XML_p, XML_cBhvr, + FSEND); + WriteAnimationNodeCommonPropsStart(pFS, rXNode, true, bMainSeqChild); + WriteAnimationTarget(pFS, xCommand->getTarget()); + pFS->endElementNS(XML_p, XML_cBhvr); + + pFS->endElementNS(XML_p, XML_cmd); + } +} + void PowerPointExport::WriteAnimationNode( const FSHelperPtr& pFS, const Reference< XAnimationNode >& rXNode, bool bMainSeqChild ) { SAL_INFO("sd.eppt", "export node type: " << rXNode->getType()); @@ -1388,6 +1437,13 @@ void PowerPointExport::WriteAnimationNode( const FSHelperPtr& pFS, const Referen xmlNodeType = XML_animEffect; pMethod = &PowerPointExport::WriteAnimationNodeEffect; break; + case AnimationNodeType::COMMAND: + xmlNodeType = XML_cmd; + pMethod = &PowerPointExport::WriteAnimationNodeCommand; + break; + default: + SAL_WARN("sd.eppt", "unhandled: " << rXNode->getType()); + break; } if( pMethod ) { |