[Libreoffice-commits] .: 2 commits - cppcanvas/source sd/Library_sd.mk sd/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Sep 6 05:46:41 PDT 2012


 cppcanvas/source/mtfrenderer/emfplus.cxx |    4 -
 sd/Library_sd.mk                         |    2 
 sd/source/filter/ppt/pptin.cxx           |    6 --
 sd/source/filter/ppt/pptinanimations.cxx |   71 +++++++++++++++++++++++--------
 sd/source/filter/ppt/pptinanimations.hxx |   11 ++--
 5 files changed, 65 insertions(+), 29 deletions(-)

New commits:
commit 35cbe7206d19afa8d30cb84e9285f45964dbaad8
Author: Radek Doulik <rodo at novell.com>
Date:   Thu Sep 6 14:41:08 2012 +0200

    fixed typo
    
    Change-Id: I483ff930b99d04cbd1514d7f541e57e223b04bab

diff --git a/cppcanvas/source/mtfrenderer/emfplus.cxx b/cppcanvas/source/mtfrenderer/emfplus.cxx
index 5b9651a..2c028bc 100644
--- a/cppcanvas/source/mtfrenderer/emfplus.cxx
+++ b/cppcanvas/source/mtfrenderer/emfplus.cxx
@@ -753,9 +753,9 @@ namespace cppcanvas
                     // debug code - write the stream to debug file /tmp/emf-stream.emf
                     EMFP_DEBUG(
                         mfStream.Seek(0);
-                        static int emfp_debug_stream_numnber = 0;
+                        static int emfp_debug_stream_number = 0;
                         rtl::OUString emfp_debug_filename("/tmp/emf-embedded-stream");
-                        emfp_debug_filename += rtl::OUString::valueOf(emfp_debug_stream_numnber++);
+                        emfp_debug_filename += rtl::OUString::valueOf(emfp_debug_stream_number++);
                         emfp_debug_filename += rtl::OUString(".emf");
 
                         SvFileStream file( emfp_debug_filename, STREAM_WRITE | STREAM_TRUNC );
commit 764215c901e971ee52e573b54eb79037d6a48f79
Author: Radek Doulik <rodo at novell.com>
Date:   Thu Sep 6 14:37:34 2012 +0200

    try to use old animations when new ones doesn't contain any leave node
    
     - fixes part of n#759172
    
    Change-Id: Id7abecd55edba6dadf16e275192e5251d0a86274

diff --git a/sd/Library_sd.mk b/sd/Library_sd.mk
index 4dcadc3..876954e 100644
--- a/sd/Library_sd.mk
+++ b/sd/Library_sd.mk
@@ -66,7 +66,7 @@ $(eval $(call gb_Library_add_defs,sd,\
 ))
 
 ifneq ($(strip $(dbg_anim_log)$(DBG_ANIM_LOG)),)
-$(eval $(call gb_Library_set_defs,sd,\
+$(eval $(call gb_Library_add_defs,sd,\
     $$(DEFS) \
     -DDBG_ANIM_LOG \
 ))
diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx
index 7415cae..b436632 100644
--- a/sd/source/filter/ppt/pptin.cxx
+++ b/sd/source/filter/ppt/pptin.cxx
@@ -822,8 +822,7 @@ sal_Bool ImplSdPPTImport::Import()
                                             {
                                                 ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage > xPage( pMPage->getUnoPage(), ::com::sun::star::uno::UNO_QUERY );
                                                 ppt::AnimationImporter aImporter( this, rStCtrl );
-                                                aImporter.import( xPage, aProgTagContentHd );
-                                                bNewAnimationsUsed = sal_True;
+                                                bNewAnimationsUsed = aImporter.import( xPage, aProgTagContentHd ) > 0;
                                             }
                                             break;
                                         }
@@ -940,8 +939,7 @@ sal_Bool ImplSdPPTImport::Import()
                                             {
                                                 ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage > xPage( pPage->getUnoPage(), ::com::sun::star::uno::UNO_QUERY );
                                                 ppt::AnimationImporter aImporter( this, rStCtrl );
-                                                aImporter.import( xPage, aProgTagContentHd );
-                                                bNewAnimationsUsed = sal_True;
+                                                bNewAnimationsUsed = aImporter.import( xPage, aProgTagContentHd ) > 0;
                                             }
                                             break;
 
diff --git a/sd/source/filter/ppt/pptinanimations.cxx b/sd/source/filter/ppt/pptinanimations.cxx
index 03e0203..52452d9 100644
--- a/sd/source/filter/ppt/pptinanimations.cxx
+++ b/sd/source/filter/ppt/pptinanimations.cxx
@@ -239,10 +239,16 @@ AnimationImporter::AnimationImporter( ImplSdPPTImport* pPPTImport, SvStream& rSt
 
 // --------------------------------------------------------------------
 
-void AnimationImporter::import( const Reference< XDrawPage >& xPage, const DffRecordHeader& rProgTagContentHd )
+int AnimationImporter::import( const Reference< XDrawPage >& xPage, const DffRecordHeader& rProgTagContentHd )
 {
+    int nNodes = 0;
+
 #ifdef DBG_ANIM_LOG
-    mpFile = fopen( "c:\\output.xml", "w+" );
+    static int ppt_anim_debug_stream_number = 1;
+    rtl::OUString ppt_anim_debug_filename("ppt-animation-import-debug-output-");
+    ppt_anim_debug_filename += rtl::OUString::valueOf(ppt_anim_debug_stream_number++);
+    ppt_anim_debug_filename += rtl::OUString(".xml");
+    mpFile = fopen( rtl::OUStringToOString( ppt_anim_debug_filename, RTL_TEXTENCODING_UTF8).getStr() , "w+" );
 #endif
     dump("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
 
@@ -257,7 +263,7 @@ void AnimationImporter::import( const Reference< XDrawPage >& xPage, const DffRe
             const Atom* pAtom = Atom::import( rProgTagContentHd, mrStCtrl );
             if( pAtom )
             {
-                importAnimationContainer( pAtom, xParent );
+                nNodes = importAnimationContainer( pAtom, xParent );
             }
 
             processAfterEffectNodes();
@@ -267,6 +273,8 @@ void AnimationImporter::import( const Reference< XDrawPage >& xPage, const DffRe
 #ifdef DBG_ANIM_LOG
     fclose( mpFile );
 #endif
+
+    return nNodes;
 }
 
 // --------------------------------------------------------------------
@@ -367,8 +375,9 @@ static bool is_random( const AnimationNode& rNode, const PropertySet& rSet, sal_
 }
 
 
-void AnimationImporter::importAnimationContainer( const Atom* pAtom, const Reference< XAnimationNode >& xParent )
+int AnimationImporter::importAnimationContainer( const Atom* pAtom, const Reference< XAnimationNode >& xParent )
 {
+    int nNodes = 0;
     if( pAtom->seekToContent() )
     {
         AnimationNode aNode;
@@ -416,7 +425,7 @@ void AnimationImporter::importAnimationContainer( const Atom* pAtom, const Refer
                 dump( "<par" );
                 dump( aNode );
                 dump( aSet );
-                importTimeContainer( pAtom, xNode );
+                nNodes += importTimeContainer( pAtom, xNode );
                 dump( "</par>\n" );
 
                 // for iteration containers, map target from children to iteration
@@ -467,7 +476,7 @@ void AnimationImporter::importAnimationContainer( const Atom* pAtom, const Refer
                 dump( "<seq" );
                 dump( aNode );
                 dump( aSet );
-                importTimeContainer( pAtom, xNode );
+                nNodes += importTimeContainer( pAtom, xNode );
                 dump( "</seq>\n" );
 
                 if( aSet.hasProperty( DFF_ANIM_NODE_TYPE ) )
@@ -535,9 +544,11 @@ void AnimationImporter::importAnimationContainer( const Atom* pAtom, const Refer
                 dump( aNode );
                 dump( aSet );
 #endif
-                importAnimationNodeContainer( pAtom, xNode );
+                int nANCNodes = importAnimationNodeContainer( pAtom, xNode );
                 if( !convertAnimationNode( xNode, xParent ) )
                     xNode = 0;
+                else
+                    nNodes += nANCNodes;
                 dump( "/>\n");
 
             }
@@ -548,7 +559,7 @@ void AnimationImporter::importAnimationContainer( const Atom* pAtom, const Refer
                 dump( "<audio" );
                 dump( aNode );
                 dump( aSet );
-                importAudioContainer( pAtom, xNode );
+                nNodes += importAudioContainer( pAtom, xNode );
                 dump( "</audio>\n" );
             }
             break;
@@ -574,6 +585,8 @@ void AnimationImporter::importAnimationContainer( const Atom* pAtom, const Refer
             }
         }
     }
+
+    return nNodes;
 }
 
 // --------------------------------------------------------------------
@@ -1391,8 +1404,10 @@ void AnimationImporter::fillNode( Reference< XAnimationNode >& xNode, const Anim
 
 // --------------------------------------------------------------------
 
-void AnimationImporter::importTimeContainer( const Atom* pAtom, const Reference< XAnimationNode >& xNode )
+int AnimationImporter::importTimeContainer( const Atom* pAtom, const Reference< XAnimationNode >& xNode )
 {
+    int nNodes = 0;
+
     DBG_ASSERT( pAtom && xNode.is(), "invalid call to ppt::AnimationImporter::importTimeContainer()!");
     if( pAtom && xNode.is() )
     {
@@ -1422,20 +1437,20 @@ void AnimationImporter::importTimeContainer( const Atom* pAtom, const Reference<
                     {
                         const OUString aServiceName( "com.sun.star.animations.Command" );
                         Reference< XAnimationNode > xChildNode( ::comphelper::getProcessServiceFactory()->createInstance(aServiceName), UNO_QUERY );
-                        importAnimationNodeContainer( pChildAtom, xChildNode );
+                        nNodes += importAnimationNodeContainer( pChildAtom, xChildNode );
                         Reference< XTimeContainer > xParentContainer( xNode, UNO_QUERY );
                         if( xParentContainer.is() && xChildNode.is() )
                             xParentContainer->appendChild( xChildNode );
                     }
                     else
                     {
-                        importAnimationContainer( pChildAtom, xNode );
+                        nNodes += importAnimationContainer( pChildAtom, xNode );
                     }
                 }
                 break;
                 case DFF_msofbtAnimGroup :
                 {
-                    importAnimationContainer( pChildAtom, xNode );
+                    nNodes += importAnimationContainer( pChildAtom, xNode );
                 }
                 break;
                 case DFF_msofbtAnimIteration:
@@ -1460,6 +1475,8 @@ void AnimationImporter::importTimeContainer( const Atom* pAtom, const Reference<
                             xIter->setIterateInterval( (double)fInterval );
                         }
 
+                        nNodes++;
+
                         dump( "<iterate" );
                         dump( " iterateType=\"%s\"", (nTextUnitEffect == 0) ? "byElement" : (nTextUnitEffect == 1) ? "byWord" : "byLetter" );
                         dump( " iterateInterval=\"%g\"", fInterval );
@@ -1493,12 +1510,16 @@ void AnimationImporter::importTimeContainer( const Atom* pAtom, const Reference<
             pChildAtom = pAtom->findNextChildAtom( pChildAtom );
         }
     }
+
+    return nNodes;
 }
 
 // --------------------------------------------------------------------
 
-void AnimationImporter::importAnimationNodeContainer( const Atom* pAtom, const Reference< XAnimationNode >& xNode )
+int AnimationImporter::importAnimationNodeContainer( const Atom* pAtom, const Reference< XAnimationNode >& xNode )
 {
+    int nNodes = 0;
+
     DBG_ASSERT( pAtom && xNode.is(), "invalid call to ppt::AnimationImporter::importAnimationNodeContainer()!");
     if( pAtom && xNode.is() )
     {
@@ -1510,6 +1531,7 @@ void AnimationImporter::importAnimationNodeContainer( const Atom* pAtom, const R
 
         while( pChildAtom )
         {
+            nNodes ++;
             switch( pChildAtom->getType() )
             {
                 case DFF_msofbtAnimNode:
@@ -1553,6 +1575,7 @@ void AnimationImporter::importAnimationNodeContainer( const Atom* pAtom, const R
 
                 default:
                 {
+                    nNodes --;
                     dump_atom_header( pChildAtom, true, false );
                     dump_atom( pChildAtom );
                     dump_atom_header( pChildAtom, false, false );
@@ -1563,6 +1586,8 @@ void AnimationImporter::importAnimationNodeContainer( const Atom* pAtom, const R
             pChildAtom = pAtom->findNextChildAtom( pChildAtom );
         }
     }
+
+    return nNodes;
 }
 
 // --------------------------------------------------------------------
@@ -2280,8 +2305,10 @@ void AnimationImporter::importCommandContainer( const Atom* pAtom, const Referen
 
 // --------------------------------------------------------------------
 
-void AnimationImporter::importAudioContainer( const Atom* pAtom, const Reference< XAnimationNode >& xNode )
+int AnimationImporter::importAudioContainer( const Atom* pAtom, const Reference< XAnimationNode >& xNode )
 {
+    int nNodes = 0;
+
     Reference< XAudio > xAudio( xNode, UNO_QUERY );
     DBG_ASSERT( pAtom && xAudio.is() &&
                  ( (pAtom->getType() == DFF_msofbtAnimGroup) ||
@@ -2318,6 +2345,7 @@ void AnimationImporter::importAudioContainer( const Atom* pAtom, const Reference
                 Any aValue;
                 if ( importAttributeValue( pChildAtom, aValue ) )
                 {
+                    nNodes ++;
                     dump( " value=\"" );
                     dump( aValue );
                     dump( "\"" );
@@ -2330,8 +2358,10 @@ void AnimationImporter::importAudioContainer( const Atom* pAtom, const Reference
                 sal_Int16 nSubType;
                 Any aSource;
                 importTargetElementContainer( pChildAtom, aSource, nSubType );
-                if( xAudio.is() )
+                if( xAudio.is() ) {
                     xAudio->setSource( aSource );
+                    nNodes ++;
+                }
             }
             break;
 
@@ -2348,6 +2378,8 @@ void AnimationImporter::importAudioContainer( const Atom* pAtom, const Reference
         xAudio->setBegin( aEmpty );
         xAudio->setEnd( aEmpty );
     }
+
+    return nNodes;
 }
 
 // --------------------------------------------------------------------
@@ -2748,7 +2780,7 @@ void AnimationImporter::importAnimateKeyPoints( const Atom* pAtom, const Referen
                     else if( aValuePair.First >>= nVal )
                         dump( "%f", nVal );
                     else
-                        dump( "%X", (sal_Int32)&aValuePair.First );
+                        dump( "%X", (sal_Int64)&aValuePair.First );
 
                     if( aValuePair.Second >>= aStr )
                         dump( ",%s",
@@ -2757,7 +2789,7 @@ void AnimationImporter::importAnimateKeyPoints( const Atom* pAtom, const Referen
                     else if( aValuePair.Second >>= nVal )
                         dump( ",%f", nVal );
                     else
-                        dump( ",%X", (sal_Int32)&aValuePair.Second );
+                        dump( ",%X", (sal_Int64)&aValuePair.Second );
                 }
             }
         }
@@ -3769,6 +3801,11 @@ void AnimationImporter::dump( const rtl::OUString& rString )
         RTL_TEXTENCODING_UTF8).getStr() );
 }
 
+void AnimationImporter::dump( const char * pText, sal_Int64 nInt )
+{
+    fprintf( mpFile, pText, nInt );
+}
+
 void AnimationImporter::dump( const char * pText, sal_Int32 nInt )
 {
     fprintf( mpFile, pText, nInt );
diff --git a/sd/source/filter/ppt/pptinanimations.hxx b/sd/source/filter/ppt/pptinanimations.hxx
index 06b5e05..6f39990 100644
--- a/sd/source/filter/ppt/pptinanimations.hxx
+++ b/sd/source/filter/ppt/pptinanimations.hxx
@@ -47,12 +47,12 @@ class AnimationImporter
 public:
     AnimationImporter( ImplSdPPTImport* pPPTImport, SvStream& rStCtrl );
 
-    void import( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& xPage, const DffRecordHeader& rProgTagContentHd );
+    int  import( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& xPage, const DffRecordHeader& rProgTagContentHd );
 
 private:
-    void importAnimationContainer( const Atom* pAtom, const ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode >& xParent );
-    void importTimeContainer( const Atom* pAtom, const ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode >& xNode );
-    void importAnimationNodeContainer( const Atom* pAtom, const ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode >& xNode );
+    int  importAnimationContainer( const Atom* pAtom, const ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode >& xParent );
+    int  importTimeContainer( const Atom* pAtom, const ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode >& xNode );
+    int  importAnimationNodeContainer( const Atom* pAtom, const ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode >& xNode );
 
     void importAnimateSetContainer( const Atom* pAtom, const ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode >& xNode );
     void importAnimateFilterContainer( const Atom* pAtom, const ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode >& xNode );
@@ -62,7 +62,7 @@ private:
     void importAnimateRotationContainer( const Atom* pAtom, const ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode >& xNode );
     void importAnimateMotionContainer( const Atom* pAtom, const ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode >& xNode );
     void importCommandContainer( const Atom* pAtom, const ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode >& xNode );
-    void importAudioContainer( const Atom* pAtom, const ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode >& xNode );
+    int  importAudioContainer( const Atom* pAtom, const ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode >& xNode );
 
     void importAnimationEvents( const Atom* pAtom, const ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode >& xNode );
     void importAnimationValues( const Atom* pAtom, const ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode >& xNode );
@@ -112,6 +112,7 @@ private:
     void dump( const AnimationNode& rNode );
     void dump( const char * pText );
     void dump( const char * pText, sal_Int32 nInt );
+    void dump( const char * pText, sal_Int64 nInt );
     void dump( const char * pText, double fDouble );
     void dump( const char * pText, const char * pText2 );
     void dump( const char * pText, const rtl::OUString& rString );


More information about the Libreoffice-commits mailing list