[ooo-build-commit] patches/dev300

Radek Doulík rodo at kemper.freedesktop.org
Mon Jul 27 07:45:21 PDT 2009


 patches/dev300/apply                                  |    1 
 patches/dev300/oox-pptx-export-animations-filter.diff |  162 ++++++++++++++++++
 2 files changed, 163 insertions(+)

New commits:
commit 7f2f7ac66237fc6e58adb07271a24257f0564769
Author: Radek Doulik <rodo at novell.com>
Date:   Mon Jul 27 16:43:25 2009 +0200

    added support for animation filters
    
    * patches/dev300/apply:
    * patches/dev300/oox-pptx-export-animations-filter.diff: export AnimationNodeType::TRANSITIONFILTER and refactor the code so that we can reuse code used for AnimationNodeType::[ANIMATE,SET]

diff --git a/patches/dev300/apply b/patches/dev300/apply
index ffe5ed9..a3d0cde 100644
--- a/patches/dev300/apply
+++ b/patches/dev300/apply
@@ -3291,6 +3291,7 @@ oox-pptx-export-vertical-text.diff, n#498737, rodo
 oox-pptx-export-para-linespacing.diff, n#498737, rodo
 oox-pptx-export-fix-action-button-presets.diff, n#497570, rodo
 oox-drawingml-fix-shapes-map-crash.diff, rodo
+oox-pptx-export-animations-filter.diff, n#497570, rodo
 
 [ CrossWin32Patches ]
 # Experimental patches to crosscompile OOo for Win32
diff --git a/patches/dev300/oox-pptx-export-animations-filter.diff b/patches/dev300/oox-pptx-export-animations-filter.diff
new file mode 100644
index 0000000..bc76e77
--- /dev/null
+++ b/patches/dev300/oox-pptx-export-animations-filter.diff
@@ -0,0 +1,162 @@
+diff -rup sd-orig-1/source/filter/pptx/epptooxml.hxx sd/source/filter/pptx/epptooxml.hxx
+--- sd-orig-1/source/filter/pptx/epptooxml.hxx	2009-07-27 11:35:56.000000000 +0200
++++ sd/source/filter/pptx/epptooxml.hxx	2009-07-27 16:00:38.000000000 +0200
+@@ -85,7 +85,9 @@ protected:
+     void WriteAnimationAttributeName( ::sax_fastparser::FSHelperPtr pFS, const ::rtl::OUString& rAttributeName );
+     void WriteAnimationNode( ::sax_fastparser::FSHelperPtr pFS, const ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode >& rXNode, sal_Bool bMainSeqChild );
+     void WriteAnimationNodeAnimate( ::sax_fastparser::FSHelperPtr pFS, const ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode >& rXNode, sal_Int32 nXmlNodeType, sal_Bool bMainSeqChild );
++    void WriteAnimationNodeAnimateInside( ::sax_fastparser::FSHelperPtr pFS, const ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode >& rXNode, sal_Bool bMainSeqChild, sal_Bool bSimple );
+     void WriteAnimationNodeSeq( ::sax_fastparser::FSHelperPtr pFS, const ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode >& rXNode, sal_Int32 nXmlNodeType, sal_Bool bMainSeqChild );
++    void WriteAnimationNodeEffect( ::sax_fastparser::FSHelperPtr pFS, const ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode >& rXNode, sal_Int32 nXmlNodeType, sal_Bool bMainSeqChild );
+     void WriteAnimationNodeCommonPropsStart( ::sax_fastparser::FSHelperPtr pFS, const ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode >& rXNode, sal_Bool bSingle, sal_Bool bMainSeqChild );
+     void WriteAnimationNodeCommonPropsEnd( ::sax_fastparser::FSHelperPtr pFS );
+     void WriteAnimationProperty( ::sax_fastparser::FSHelperPtr pFS, const ::com::sun::star::uno::Any& rAny );
+diff -rup sd-orig-1/source/filter/pptx/pptexanimations.hxx sd/source/filter/pptx/pptexanimations.hxx
+--- sd-orig-1/source/filter/pptx/pptexanimations.hxx	2009-07-27 11:35:56.000000000 +0200
++++ sd/source/filter/pptx/pptexanimations.hxx	2009-07-27 11:36:07.000000000 +0200
+@@ -142,6 +142,8 @@ public:
+         static sal_uInt32 TranslatePresetSubType( const sal_uInt32 nPresetClass, const sal_uInt32 nPresetId, const rtl::OUString& rPresetSubType );
+         static sal_uInt32 GetPresetID( const rtl::OUString& rPreset, sal_uInt32 nAPIPresetClass, sal_Bool& bPresetId );
+         static sal_uInt32 GetValueTypeForAttributeName( const rtl::OUString& rAttributeName );
++
++    static const sal_Char* FindTransitionName( const sal_Int16 nType, const sal_Int16 nSubType, const sal_Bool bDirection );
+ };
+ } // namespace ppt
+ 
+diff -rup sd-orig-1/source/filter/pptx/pptx-epptooxml.cxx sd/source/filter/pptx/pptx-epptooxml.cxx
+--- sd-orig-1/source/filter/pptx/pptx-epptooxml.cxx	2009-07-27 11:35:56.000000000 +0200
++++ sd/source/filter/pptx/pptx-epptooxml.cxx	2009-07-27 16:19:16.000000000 +0200
+@@ -25,6 +25,7 @@
+ #include <com/sun/star/animations/XAnimateSet.hpp>
+ #include <com/sun/star/animations/XAnimationNode.hpp>
+ #include <com/sun/star/animations/XAnimationNodeSupplier.hpp>
++#include <com/sun/star/animations/XTransitionFilter.hpp>
+ #include <com/sun/star/beans/Property.hpp>
+ #include <com/sun/star/beans/XPropertySetInfo.hpp>
+ #include <com/sun/star/container/XEnumerationAccess.hpp>
+@@ -607,6 +608,9 @@ void PowerPointExport::WriteAnimateTo( F
+ 
+ void PowerPointExport::WriteAnimationAttributeName( FSHelperPtr pFS, const OUString& rAttributeName )
+ {
++    if( ! rAttributeName.getLength() )
++	return;
++
+     pFS->startElementNS( XML_p, XML_attrNameLst, FSEND );
+ 
+     DBG(printf("write attribute name: %s\n", USS( rAttributeName )));
+@@ -648,9 +652,9 @@ void PowerPointExport::WriteAnimationNod
+ 
+     const char* pCalcMode = NULL;
+     const char* pValueType = NULL;
+-    const char* pAdditive = NULL;
++    sal_Bool bSimple = ( nXmlNodeType != XML_anim );
+ 
+-    if( nXmlNodeType == XML_anim ) {
++    if( !bSimple ) {
+ 	switch( rXAnimate->getCalcMode() ) {
+ 	    case AnimationCalcMode::DISCRETE:
+ 		pCalcMode = "discrete";
+@@ -671,7 +675,25 @@ void PowerPointExport::WriteAnimationNod
+ 		pValueType = "clr";
+ 		break;
+ 	}
++    }
++
++    pFS->startElementNS( XML_p, nXmlNodeType,
++			 XML_calcmode, pCalcMode,
++			 XML_valueType, pValueType,
++			 FSEND );
++    WriteAnimationNodeAnimateInside( pFS, rXNode, bMainSeqChild, bSimple );
++    pFS->endElementNS( XML_p, nXmlNodeType );
++}
++
++void PowerPointExport::WriteAnimationNodeAnimateInside( FSHelperPtr pFS, const Reference< XAnimationNode >& rXNode, sal_Bool bMainSeqChild, sal_Bool bSimple )
++{
++    Reference< XAnimate > rXAnimate( rXNode, UNO_QUERY );
++    if( !rXAnimate.is() )
++	return;
+ 
++    const char* pAdditive = NULL;
++
++    if( !bSimple ) {
+ 	switch( rXAnimate->getAdditive() ) {
+ 	    case AnimationAdditiveMode::BASE:
+ 		pAdditive = "base";
+@@ -691,10 +713,6 @@ void PowerPointExport::WriteAnimationNod
+ 	}
+     }
+ 
+-    pFS->startElementNS( XML_p, nXmlNodeType,
+-			 XML_calcmode, pCalcMode,
+-			 XML_valueType, pValueType,
+-			 FSEND );
+     pFS->startElementNS( XML_p, XML_cBhvr,
+ 			 XML_additive, pAdditive,
+ 			 FSEND );
+@@ -704,7 +722,6 @@ void PowerPointExport::WriteAnimationNod
+     pFS->endElementNS( XML_p, XML_cBhvr );
+     WriteAnimateValues( pFS, rXAnimate );
+     WriteAnimateTo( pFS, rXAnimate->getTo(), rXAnimate->getAttributeName() );
+-    pFS->endElementNS( XML_p, nXmlNodeType );
+ }
+ 
+ void PowerPointExport::WriteAnimationCondition( FSHelperPtr pFS, const char* pDelay, const char* pEvent, double fDelay, sal_Bool bHasFDelay )
+@@ -1014,6 +1031,25 @@ void PowerPointExport::WriteAnimationNod
+     pFS->endElementNS( XML_p, XML_seq );
+ }
+ 
++void PowerPointExport::WriteAnimationNodeEffect( FSHelperPtr pFS, const Reference< XAnimationNode >& rXNode, sal_Int32, sal_Bool bMainSeqChild )
++{
++    DBG(printf ("write animation node FILTER\n"));
++
++    Reference< XTransitionFilter > xFilter( rXNode, UNO_QUERY );
++    if ( xFilter.is() ) {
++	const char* pFilter = ppt::AnimationExporter::FindTransitionName( xFilter->getTransition(), xFilter->getSubtype(), xFilter->getDirection() );
++	const char* pDirection = xFilter->getDirection() ? "in" : "out";
++	pFS->startElementNS( XML_p, XML_animEffect,
++			     XML_filter, pFilter,
++			     XML_transition, pDirection,
++			     FSEND );
++
++	WriteAnimationNodeAnimateInside( pFS, rXNode, bMainSeqChild, FALSE );
++
++	pFS->endElementNS( XML_p, XML_animEffect );
++    }
++}
++
+ void PowerPointExport::WriteAnimationNode( FSHelperPtr pFS, const Reference< XAnimationNode >& rXNode, sal_Bool bMainSeqChild )
+ {
+     DBG(printf ("export node type: %d\n", rXNode->getType()));
+@@ -1036,8 +1072,9 @@ void PowerPointExport::WriteAnimationNod
+ 	    xmlNodeType = XML_set;
+ 	    pMethod = &PowerPointExport::WriteAnimationNodeAnimate;
+ 	    break;
+-// 	case AnimationNodeType::TRANSITIONFILTER:
+-// 	    xmlNodeType = XML_xfrm;
++ 	case AnimationNodeType::TRANSITIONFILTER:
++ 	    xmlNodeType = XML_animEffect;
++	    pMethod = &PowerPointExport::WriteAnimationNodeEffect;
+ 	    break;
+     }
+ 
+diff -rup sd-orig-1/source/filter/pptx/pptx-pptexanimations.cxx sd/source/filter/pptx/pptx-pptexanimations.cxx
+--- sd-orig-1/source/filter/pptx/pptx-pptexanimations.cxx	2009-07-27 11:35:56.000000000 +0200
++++ sd/source/filter/pptx/pptx-pptexanimations.cxx	2009-07-27 11:36:07.000000000 +0200
+@@ -243,7 +243,7 @@ sal_uInt32 AnimationExporter::TranslateP
+ 	return nPresetSubType;
+ }
+ 
+-const sal_Char* transition::find( const sal_Int16 nType, const sal_Int16 nSubType, const sal_Bool bDirection )
++const sal_Char* AnimationExporter::FindTransitionName( const sal_Int16 nType, const sal_Int16 nSubType, const sal_Bool bDirection )
+ {
+ 	const sal_Char* pRet = NULL;
+ 	int				nFit = 0;
+@@ -1943,7 +1943,7 @@ void AnimationExporter::exportTransition
+ 			rStrm << nBits
+ 				  << nTransition;
+ 		}
+-		const sal_Char* pFilter = transition::find( xFilter->getTransition(), xFilter->getSubtype(), xFilter->getDirection() );
++		const sal_Char* pFilter = FindTransitionName( xFilter->getTransition(), xFilter->getSubtype(), xFilter->getDirection() );
+ 		if ( pFilter )
+ 		{
+ 			const OUString aStr( OUString::createFromAscii( pFilter ) );


More information about the ooo-build-commit mailing list