[Libreoffice-commits] .: 14 commits - sd/prj sd/source sd/util

Katarina Machalkova bubli at kemper.freedesktop.org
Tue Oct 19 09:25:23 PDT 2010


 sd/prj/build.lst                                    |    5 
 sd/prj/d.lst                                        |    1 
 sd/source/filter/pptx/eppt.hxx                      |  303 +
 sd/source/filter/pptx/epptbase.hxx                  |  411 ++
 sd/source/filter/pptx/epptdef.hxx                   |  263 +
 sd/source/filter/pptx/epptooxml.hxx                 |  138 
 sd/source/filter/pptx/escherex.hxx                  |   77 
 sd/source/filter/pptx/grouptable.hxx                |   58 
 sd/source/filter/pptx/makefile.mk                   |   61 
 sd/source/filter/pptx/pptexanimations.hxx           |  151 
 sd/source/filter/pptx/pptexsoundcollection.hxx      |   86 
 sd/source/filter/pptx/pptx-NOTES                    |    2 
 sd/source/filter/pptx/pptx-eppt.cxx                 | 1580 ++++++++
 sd/source/filter/pptx/pptx-epptbase.cxx             |  947 ++++
 sd/source/filter/pptx/pptx-epptooxml.cxx            | 2076 ++++++++++
 sd/source/filter/pptx/pptx-epptso.cxx               | 3907 ++++++++++++++++++++
 sd/source/filter/pptx/pptx-escherex.cxx             |  294 +
 sd/source/filter/pptx/pptx-grouptable.cxx           |  114 
 sd/source/filter/pptx/pptx-pptexanimations.cxx      | 2229 +++++++++++
 sd/source/filter/pptx/pptx-pptexsoundcollection.cxx |  231 +
 sd/source/filter/pptx/pptx-stylesheet.cxx           |  485 ++
 sd/source/filter/pptx/pptx-text.cxx                 | 1410 +++++++
 sd/source/filter/pptx/text.hxx                      |  246 +
 sd/util/makefile.mk                                 |   31 
 sd/util/pptx.map                                    |    9 
 25 files changed, 15113 insertions(+), 2 deletions(-)

New commits:
commit a2c9dda3be79f4720a71c8fe3cbab2f7b85e13a8
Author: Katarina Machalkova <kmachalkova at suse.cz>
Date:   Tue Oct 19 17:18:08 2010 +0200

    Merged sd-pptx-export-build-fix-2.diff from ooo-build

diff --git a/sd/source/filter/pptx/pptx-eppt.cxx b/sd/source/filter/pptx/pptx-eppt.cxx
index 2ea5d57..061db2c 100644
--- a/sd/source/filter/pptx/pptx-eppt.cxx
+++ b/sd/source/filter/pptx/pptx-eppt.cxx
@@ -121,7 +121,7 @@ void PPTWriter::exportPPTPre()
     if ( !mpPicStrm )
         mpPicStrm = mrStg->OpenSotStream( String( RTL_CONSTASCII_USTRINGPARAM( "Pictures" ) ) );
 
-    mpPptEscherEx = new PptEscherEx( *mpStrm, mnDrawings );
+    mpPptEscherEx = new PptEscherEx( *mpStrm );
 };
 
 void PPTWriter::exportPPTPost()
diff --git a/sd/util/makefile.mk b/sd/util/makefile.mk
index 4e335e2..b24befb 100755
--- a/sd/util/makefile.mk
+++ b/sd/util/makefile.mk
@@ -283,6 +283,7 @@ SHL6STDLIBS = $(ISDLIB) \
               $(SOTLIB)           \
               $(GOODIESLIB)       \
               $(VCLLIB)           \
+              $(MSFILTERLIB)      \
               $(SVLLIB)           \
               $(SOTLIB)           \
               $(UNOTOOLSLIB)      \
diff --git a/sd/util/pptx.map b/sd/util/pptx.map
index e72a8e3..f9d5960 100644
--- a/sd/util/pptx.map
+++ b/sd/util/pptx.map
@@ -1,4 +1,4 @@
-PPTX_1_0 {
+UDK_3_0_0 {
         global:
                 component_getImplementationEnvironment;
                 component_writeInfo;
commit 318051ea95bd42bd8bf84d0d0fc464b6c23c9fa6
Author: Katarina Machalkova <kmachalkova at suse.cz>
Date:   Tue Oct 19 17:17:34 2010 +0200

    Merged sd-pptx-export-build-fix.diff ooo-build

diff --git a/sd/source/filter/pptx/epptooxml.hxx b/sd/source/filter/pptx/epptooxml.hxx
index f6b0a2e..d54169f 100644
--- a/sd/source/filter/pptx/epptooxml.hxx
+++ b/sd/source/filter/pptx/epptooxml.hxx
@@ -57,7 +57,7 @@ public:
     virtual oox::vml::Drawing* getVmlDrawing() { return NULL; }
     virtual const oox::drawingml::Theme* getCurrentTheme() const { return NULL; }
     virtual const oox::drawingml::table::TableStyleListPtr getTableStyles() { return oox::drawingml::table::TableStyleListPtr(); }
-    virtual oox::drawingml::chart::ChartConverter* getChartConverter() { return NULL; }
+    virtual oox::drawingml::chart::ChartConverter* getChartConverter() { return &maChartConverter; }
 
     static const char* GetSideDirection( sal_uInt8 nDirection );
     static const char* GetCornerDirection( sal_uInt8 nDirection );
@@ -129,6 +129,7 @@ private:
     static sal_Int32 nStyleLevelToken[5];
 
     ::oox::drawingml::ShapeExport::ShapeHashMap maShapeMap;
+    oox::drawingml::chart::ChartConverter maChartConverter;
 };
 
 }
diff --git a/sd/source/filter/pptx/escherex.hxx b/sd/source/filter/pptx/escherex.hxx
index 5360e76..1e2222d 100644
--- a/sd/source/filter/pptx/escherex.hxx
+++ b/sd/source/filter/pptx/escherex.hxx
@@ -2,13 +2,10 @@
  *
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
  *
  * OpenOffice.org - a multi-platform office productivity suite
  *
- * $RCSfile: escherex.hxx,v $
- * $Revision: 1.12 $
- *
  * This file is part of OpenOffice.org.
  *
  * OpenOffice.org is free software: you can redistribute it and/or modify
@@ -51,14 +48,9 @@ enum PPT_TextHeader
 
 class PptEscherEx : public EscherEx
 {
-        SvMemoryStream			maFIDCLs;
-
         sal_uInt32	ImplDggContainerSize();
         void		ImplWriteDggContainer( SvStream& rSt );
 
-        sal_uInt32	ImplDggAtomSize();
-        void		ImplWriteDggAtom( SvStream& rSt );
-
         sal_uInt32	ImplOptAtomSize();
         void		ImplWriteOptAtom( SvStream& rSt );
 
@@ -67,7 +59,7 @@ class PptEscherEx : public EscherEx
 
     public:
 
-                PptEscherEx( SvStream& rOut, UINT32 nDrawings );
+                PptEscherEx( SvStream& rOut );
                 ~PptEscherEx();
 
         void	OpenContainer( UINT16 n_EscherContainer, int nRecInstance = 0 );
diff --git a/sd/source/filter/pptx/pptx-eppt.cxx b/sd/source/filter/pptx/pptx-eppt.cxx
index f47b032..2ea5d57 100644
--- a/sd/source/filter/pptx/pptx-eppt.cxx
+++ b/sd/source/filter/pptx/pptx-eppt.cxx
@@ -53,11 +53,11 @@
 #include <tools/zcodec.hxx>
 #include <editeng/svxenum.hxx>
 #include <sot/storinfo.hxx>
-#include <svx/msoleexp.hxx>
+#include <filter/msfilter/msoleexp.hxx>
 #include <vcl/virdev.hxx>
 #include <svtools/wmf.hxx>
-#include <svx/msdffimp.hxx>
-#include <svx/flditem.hxx>
+#include <filter/msfilter/msdffimp.hxx>
+#include <editeng/flditem.hxx>
 #include <sfx2/docinf.hxx>
 #include <oox/export/utils.hxx>
 
@@ -1271,7 +1271,7 @@ void PPTWriter::ImplWriteBackground( ::com::sun::star::uno::Reference< ::com::su
     mpPptEscherEx->AddShape( ESCHER_ShpInst_Rectangle, 0xc00 );                     // Flags: Connector | Background | HasSpt
     Point aEmptyPoint = Point();
     Rectangle aRect( aEmptyPoint, Size( 28000, 21000 ) );
-    EscherPropertyContainer aPropOpt( (EscherGraphicProvider&)*mpPptEscherEx, mpPicStrm, aRect );
+    EscherPropertyContainer aPropOpt( mpPptEscherEx->GetGraphicProvider(), mpPicStrm, aRect );
     aPropOpt.AddOpt( ESCHER_Prop_fillType, ESCHER_FillSolid );
     ::com::sun::star::drawing::FillStyle aFS( ::com::sun::star::drawing::FillStyle_NONE );
     if ( ImplGetPropertyValue( rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "FillStyle" ) ) ) )
diff --git a/sd/source/filter/pptx/pptx-epptso.cxx b/sd/source/filter/pptx/pptx-epptso.cxx
index d78ba17..b011827 100644
--- a/sd/source/filter/pptx/pptx-epptso.cxx
+++ b/sd/source/filter/pptx/pptx-epptso.cxx
@@ -34,9 +34,6 @@
 #include <eppt.hxx>
 #include "text.hxx"
 #include "epptdef.hxx"
-#ifndef _PptEscherEx_HXX
-#include "escherex.hxx"
-#endif
 #include <tools/poly.hxx>
 #include <vcl/bmpacc.hxx>
 #include <vcl/gradient.hxx>
@@ -935,7 +932,7 @@ void PPTWriter::ImplWritePortions( SvStream& rOut, TextObj& rTextObj )
                     {
                         Point aEmptyPoint = Point();
                         Rectangle aRect( aEmptyPoint, Size( 28000, 21000 ) );
-                        EscherPropertyContainer aPropOpt( (EscherGraphicProvider&)*mpPptEscherEx, mpPicStrm, aRect );
+                        EscherPropertyContainer aPropOpt( mpPptEscherEx->GetGraphicProvider(), mpPicStrm, aRect );
                         aPropOpt.CreateGradientProperties( mXPropSet );
                         aPropOpt.GetOpt( ESCHER_Prop_fillColor, nBackgroundColor );
                     }
@@ -958,7 +955,7 @@ void PPTWriter::ImplWritePortions( SvStream& rOut, TextObj& rTextObj )
                             {
                                 Point aEmptyPoint = Point();
                                 Rectangle aRect( aEmptyPoint, Size( 28000, 21000 ) );
-                                EscherPropertyContainer aPropOpt( (EscherGraphicProvider&)*mpPptEscherEx, mpPicStrm, aRect );
+                                EscherPropertyContainer aPropOpt( mpPptEscherEx->GetGraphicProvider(), mpPicStrm, aRect );
                                 aPropOpt.CreateGradientProperties( mXBackgroundPropSet );
                                 aPropOpt.GetOpt( ESCHER_Prop_fillColor, nBackgroundColor );
                             }
@@ -2208,7 +2205,7 @@ sal_Bool PPTWriter::ImplCreatePresentationPlaceholder( const sal_Bool bMasterPag
     if ( bRet && bMasterPage )
     {
         mpPptEscherEx->OpenContainer( ESCHER_SpContainer );
-        sal_uInt32 nPresShapeID = mpPptEscherEx->GetShapeID();
+        sal_uInt32 nPresShapeID = mpPptEscherEx->GenerateShapeId();
         mpPptEscherEx->AddShape( ESCHER_ShpInst_Rectangle, 0xa00, nPresShapeID );// Flags: HaveAnchor | HasSpt
         EscherPropertyContainer aPropOpt;
         aPropOpt.AddOpt( ESCHER_Prop_LockAgainstGrouping, 0x50001 );
@@ -2264,7 +2261,7 @@ sal_Bool PPTWriter::ImplCreatePresentationPlaceholder( const sal_Bool bMasterPag
 
 void PPTWriter::ImplCreateShape( sal_uInt32 nType, sal_uInt32 nFlags, EscherSolverContainer& rSolver )
 {
-    sal_uInt32 nId = mpPptEscherEx->GetShapeID();
+    sal_uInt32 nId = mpPptEscherEx->GenerateShapeId();
     mpPptEscherEx->AddShape( nType, nFlags, nId );
     rSolver.AddShape( mXShape, nId );
 }
@@ -2349,7 +2346,7 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
             const ::com::sun::star::awt::Size   aSize100thmm( mXShape->getSize() );
             const ::com::sun::star::awt::Point  aPoint100thmm( mXShape->getPosition() );
             Rectangle   aRect100thmm( Point( aPoint100thmm.X, aPoint100thmm.Y ), Size( aSize100thmm.Width, aSize100thmm.Height ) );
-            EscherPropertyContainer aPropOpt( (EscherGraphicProvider&)*mpPptEscherEx, mpPicStrm, aRect100thmm );
+            EscherPropertyContainer aPropOpt( mpPptEscherEx->GetGraphicProvider(), mpPicStrm, aRect100thmm );
 
             if ( bGroup )
             {
@@ -2907,7 +2904,7 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
                                 sal_uInt16 nChar;
 
                                 mpPptEscherEx->OpenContainer( ESCHER_SpContainer );
-                                mnShapeMasterTitle = mpPptEscherEx->GetShapeID();
+                                mnShapeMasterTitle = mpPptEscherEx->GenerateShapeId();
                                 mpPptEscherEx->AddShape( ESCHER_ShpInst_Rectangle, 0xa00, mnShapeMasterTitle );// Flags: HaveAnchor | HasSpt
                                 EscherPropertyContainer aPropertyOptions;
                                 aPropertyOptions.AddOpt( ESCHER_Prop_LockAgainstGrouping, 0x50001 );
@@ -3001,7 +2998,7 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
                             if ( mnTextSize )
                             {
                                 mpPptEscherEx->OpenContainer( ESCHER_SpContainer );
-                                mnShapeMasterBody = mpPptEscherEx->GetShapeID();
+                                mnShapeMasterBody = mpPptEscherEx->GenerateShapeId();
                                 mpPptEscherEx->AddShape( ESCHER_ShpInst_Rectangle, 0xa00, mnShapeMasterBody );  // Flags: HaveAnchor | HasSpt
                                 EscherPropertyContainer aPropOpt2;
                                 aPropOpt2.AddOpt( ESCHER_Prop_LockAgainstGrouping, 0x50001 );
@@ -3578,7 +3575,7 @@ void PPTWriter::ImplCreateCellBorder( const CellBorder* pCellBorder, sal_Int32 n
         mpPptEscherEx->OpenContainer( ESCHER_SpContainer );
         EscherPropertyContainer aPropOptSp;
 
-        sal_uInt32 nId = mpPptEscherEx->GetShapeID();
+        sal_uInt32 nId = mpPptEscherEx->GenerateShapeId();
         mpPptEscherEx->AddShape( ESCHER_ShpInst_Line, 0xa02, nId );
         aPropOptSp.AddOpt( ESCHER_Prop_shapePath, ESCHER_ShapeComplex );
         aPropOptSp.AddOpt( ESCHER_Prop_fNoLineDrawDash, 0xa0008 );
@@ -3612,7 +3609,7 @@ void PPTWriter::ImplCreateTable( uno::Reference< drawing::XShape >& rXShape, Esc
                 << (INT32)maRect.Right()
                 << (INT32)maRect.Bottom();
 
-    sal_uInt32 nShapeId = mpPptEscherEx->GetShapeID();
+    sal_uInt32 nShapeId = mpPptEscherEx->GenerateShapeId();
     mpPptEscherEx->AddShape( ESCHER_ShpInst_Min, 0x201, nShapeId );		// Flags: Group | Patriarch
     aSolverContainer.AddShape( rXShape, nShapeId );
     EscherPropertyContainer aPropOpt2;
diff --git a/sd/source/filter/pptx/pptx-escherex.cxx b/sd/source/filter/pptx/pptx-escherex.cxx
index b29f35b..fbbf178 100644
--- a/sd/source/filter/pptx/pptx-escherex.cxx
+++ b/sd/source/filter/pptx/pptx-escherex.cxx
@@ -2,13 +2,10 @@
  *
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
  *
  * OpenOffice.org - a multi-platform office productivity suite
  *
- * $RCSfile: escherex.cxx,v $
- * $Revision: 1.13 $
- *
  * This file is part of OpenOffice.org.
  *
  * OpenOffice.org is free software: you can redistribute it and/or modify
@@ -40,14 +37,10 @@
 // ---------------------------------------------------------------------------------------------
 // ---------------------------------------------------------------------------------------------
 
-PptEscherEx::PptEscherEx( SvStream& rOutStrm, UINT32 nDrawings ) :
-    EscherEx				( rOutStrm, nDrawings )
+PptEscherEx::PptEscherEx( SvStream& rOutStrm ) :
+    EscherEx( EscherExGlobalRef( new EscherExGlobal ), rOutStrm )
 {
-    mnFIDCLs = nDrawings;
     mnCurrentDg	= 0;
-    mnCurrentShapeID = 0;
-    mnTotalShapesDgg = 0;
-    mnCurrentShapeMaximumID = 0;
 }
 
 // ---------------------------------------------------------------------------------------------
@@ -72,8 +65,8 @@ sal_uInt32 PptEscherEx::ImplDggContainerSize()
 {
     UINT32 nSize;
 
-    nSize  = ImplDggAtomSize();
-    nSize += GetBlibStoreContainerSize();
+    nSize  = mxGlobal->GetDggAtomSize();
+    nSize += mxGlobal->GetBlibStoreContainerSize();
     nSize += ImplOptAtomSize();
     nSize += ImplSplitMenuColorsAtomSize();
 
@@ -88,8 +81,9 @@ void PptEscherEx::ImplWriteDggContainer( SvStream& rSt )
         rSt << (sal_uInt32)( 0xf | ( ESCHER_DggContainer << 16 ) )
             << (sal_uInt32)( nSize - 8 );
 
-        ImplWriteDggAtom( rSt );
-        WriteBlibStoreContainer( rSt );
+        mxGlobal->SetDggContainer();
+        mxGlobal->WriteDggAtom( rSt );
+        mxGlobal->WriteBlibStoreContainer( rSt );
         ImplWriteOptAtom( rSt );
         ImplWriteSplitMenuColorsAtom( rSt );
     }
@@ -97,29 +91,6 @@ void PptEscherEx::ImplWriteDggContainer( SvStream& rSt )
 
 // ---------------------------------------------------------------------------------------------
 
-sal_uInt32 PptEscherEx::ImplDggAtomSize()
-{
-    return maFIDCLs.Tell() + 24;
-}
-
-void PptEscherEx::ImplWriteDggAtom( SvStream& rSt )
-{
-    sal_uInt32 nSize = ImplDggAtomSize();
-    if ( nSize )
-    {
-        rSt << (sal_uInt32)( ESCHER_Dgg << 16 )
-            << (sal_uInt32)( nSize - 8 )
-            << mnCurrentShapeID
-            << (sal_uInt32)( mnFIDCLs + 1 )
-            << mnTotalShapesDgg
-            << mnDrawings;
-
-        rSt.Write( maFIDCLs.GetData(), nSize - 24 );
-    }
-}
-
-// ---------------------------------------------------------------------------------------------
-
 #define ESCHER_OPT_COUNT 6
 
 sal_uInt32 PptEscherEx::ImplOptAtomSize()
@@ -194,11 +165,7 @@ void PptEscherEx::OpenContainer( UINT16 n_EscherContainer, int nRecInstance )
             if ( !mbEscherDg )
             {
                 mbEscherDg = TRUE;
-                mnCurrentDg++;
-                mnTotalShapesDg = 0;
-                mnTotalShapeIdUsedDg = 0;
-                mnCurrentShapeID = ( mnCurrentShapeMaximumID &~0x3ff ) + 0x400;	// eine neue Seite bekommt immer eine neue ShapeId die ein vielfaches von 1024 ist,
-                                                                                // damit ist erste aktuelle Shape ID 0x400
+                mnCurrentDg = mxGlobal->GenerateDrawingId();
                 AddAtom( 8, ESCHER_Dg, 0, mnCurrentDg );
                 PtReplaceOrInsert( ESCHER_Persist_Dg | mnCurrentDg, mpOutStrm->Tell() );
                 *mpOutStrm << (UINT32)0		// The number of shapes in this drawing
@@ -249,39 +216,7 @@ void PptEscherEx::CloseContainer()
                 {
                     mbEscherDg = FALSE;
                     if ( DoSeek( ESCHER_Persist_Dg | mnCurrentDg ) )
-                    {
-                        // shapeanzahl des drawings setzen
-                        mnTotalShapesDgg += mnTotalShapesDg;
-                        *mpOutStrm << mnTotalShapesDg << mnCurrentShapeMaximumID;
-
-                        if ( !mnTotalShapesDg )
-                        {
-                            maFIDCLs << (UINT32)0
-                                    << (UINT32)0;
-                        }
-                        else
-                        {
-                            if ( mnTotalShapeIdUsedDg )
-                            {
-                                UINT32 i, nFIDCL = ( ( mnTotalShapeIdUsedDg - 1 ) / 0x400 );
-                                if ( nFIDCL )
-                                    mnFIDCLs += nFIDCL;
-                                for ( i = 0; i <= nFIDCL; i++ )
-                                {
-                                    maFIDCLs << mnCurrentDg;			// drawing number
-                                    if ( i < nFIDCL )
-                                        maFIDCLs << 0x400;
-                                    else
-                                    {
-                                        UINT32 nShapesLeft = mnTotalShapeIdUsedDg % 0x400;
-                                        if ( !nShapesLeft )
-                                            nShapesLeft = 0x400;		// shape count in this IDCL
-                                        maFIDCLs << (UINT32)nShapesLeft;
-                                    }
-                                }
-                            }
-                        }
-                    }
+                        *mpOutStrm << mxGlobal->GetDrawingShapeCount( mnCurrentDg ) << mxGlobal->GetLastShapeId( mnCurrentDg );
                 }
             }
             break;
@@ -329,7 +264,7 @@ sal_uInt32 PptEscherEx::EnterGroup( Rectangle* pBoundRect, SvMemoryStream* pClie
                     << (INT32)aRect.Right()
                     << (INT32)aRect.Bottom();
 
-        nShapeId = GetShapeID();
+        nShapeId = GenerateShapeId();
         if ( !mnGroupLevel )
             AddShape( ESCHER_ShpInst_Min, 5, nShapeId );					// Flags: Group | Patriarch
         else
diff --git a/sd/source/filter/pptx/pptx-pptexanimations.cxx b/sd/source/filter/pptx/pptx-pptexanimations.cxx
index 02bc31c..009bbb5 100644
--- a/sd/source/filter/pptx/pptx-pptexanimations.cxx
+++ b/sd/source/filter/pptx/pptx-pptexanimations.cxx
@@ -74,8 +74,8 @@
 
 #include <vcl/vclenum.hxx>
 #include <svx/svdotext.hxx>
-#include <svx/outlobj.hxx>
-#include <svx/editobj.hxx>
+#include <editeng/outlobj.hxx>
+#include <editeng/editobj.hxx>
 #include <pptexanimations.hxx>
 #include <osl/endian.h>
 
diff --git a/sd/source/filter/pptx/pptx-text.cxx b/sd/source/filter/pptx/pptx-text.cxx
index 6bd1644..09cef65 100644
--- a/sd/source/filter/pptx/pptx-text.cxx
+++ b/sd/source/filter/pptx/pptx-text.cxx
@@ -18,10 +18,10 @@
 #include <com/sun/star/style/ParagraphAdjust.hpp>
 #include <com/sun/star/style/TabStop.hpp>
 
-#include <svtools/languageoptions.hxx>
+#include <svl/languageoptions.hxx>
 #include <sfx2/app.hxx>
 #include <editeng/svxenum.hxx>
-#include <svx/frmdir.hxx>
+#include <editeng/frmdir.hxx>
 #include <unotools/fontcvt.hxx>
 #include <vcl/metric.hxx>
 #include <vcl/outdev.hxx>
commit a3fd82b1f8134a4e41c97d7e83dc30091aafbfb4
Author: Katarina Machalkova <kmachalkova at suse.cz>
Date:   Tue Oct 19 16:43:32 2010 +0200

    Merged oox-pptx-export-update-to-ooo320.diff from ooo-build

diff --git a/sd/source/filter/pptx/epptooxml.hxx b/sd/source/filter/pptx/epptooxml.hxx
index 44beff3..f6b0a2e 100644
--- a/sd/source/filter/pptx/epptooxml.hxx
+++ b/sd/source/filter/pptx/epptooxml.hxx
@@ -54,10 +54,10 @@ public:
 
     // only needed for import, leave them empty, refactor later XmlFilterBase to export and import base?
     virtual sal_Int32 getSchemeClr( sal_Int32 /* nColorSchemeToken */ ) const { return 0; }
-    virtual const oox::vml::DrawingPtr getDrawings() { return oox::vml::DrawingPtr(); }
+    virtual oox::vml::Drawing* getVmlDrawing() { return NULL; }
     virtual const oox::drawingml::Theme* getCurrentTheme() const { return NULL; }
     virtual const oox::drawingml::table::TableStyleListPtr getTableStyles() { return oox::drawingml::table::TableStyleListPtr(); }
-    virtual oox::drawingml::chart::ChartConverter& getChartConverter();
+    virtual oox::drawingml::chart::ChartConverter* getChartConverter() { return NULL; }
 
     static const char* GetSideDirection( sal_uInt8 nDirection );
     static const char* GetCornerDirection( sal_uInt8 nDirection );
diff --git a/sd/source/filter/pptx/pptx-epptooxml.cxx b/sd/source/filter/pptx/pptx-epptooxml.cxx
index d25e178..0b64cca 100644
--- a/sd/source/filter/pptx/pptx-epptooxml.cxx
+++ b/sd/source/filter/pptx/pptx-epptooxml.cxx
@@ -196,7 +196,6 @@ ShapeExport& PowerPointShapeExport::WriteUnknownShape( Reference< XShape > xShap
 PowerPointExport::PowerPointExport( const Reference< XMultiServiceFactory > & rSMgr  )
     : XmlFilterBase( rSMgr ),
       PPTWriterBase(),
-      mxChartConv( new ::oox::drawingml::chart::ChartConverter ),
       mnLayoutFileIdMax( 1 ),
       mnSlideIdMax( 1 << 8 ),
       mnSlideMasterIdMax( 1 << 31 ),
@@ -223,8 +222,8 @@ bool PowerPointExport::exportDocument() throw()
 
     addRelation( US( "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" ), S( "ppt/presentation.xml" ) );
 
-    mPresentationFS = openOutputStreamWithSerializer( US( "ppt/presentation.xml" ),
-                                                      US( "application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml" ) );
+    mPresentationFS = openFragmentStreamWithSerializer( US( "ppt/presentation.xml" ),
+                            US( "application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml" ) );
 
     addRelation( mPresentationFS->getOutputStream(),
                  US( "http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme" ),
@@ -250,7 +249,7 @@ bool PowerPointExport::exportDocument() throw()
     mPresentationFS->endElementNS( XML_p, XML_presentation );
     mPresentationFS.reset();
 
-    commit();
+    commitStorage();
 
     maShapeMap.clear ();
 
@@ -920,7 +919,7 @@ void PowerPointExport::WriteAnimationNodeCommonPropsStart( FSHelperPtr pFS, cons
     }
     }
 
-    sal_uInt32 nPresetId;
+    sal_uInt32 nPresetId = 0;
     sal_Bool bPresetId = FALSE;
     if ( pAny[ DFF_ANIM_PRESET_ID ] ) {
     rtl::OUString sPreset;
@@ -1154,12 +1153,12 @@ void PowerPointExport::ImplWriteSlide( sal_uInt32 nPageNum, sal_uInt32 nMasterNu
     if( nPageNum == mnPages - 1 )
         mPresentationFS->endElementNS( XML_p, XML_sldIdLst );
 
-    FSHelperPtr pFS = openOutputStreamWithSerializer( OUStringBuffer()
-                                                      .appendAscii( "ppt/slides/slide" )
-                                                      .append( (sal_Int32) nPageNum + 1 )
-                                                      .appendAscii( ".xml" )
-                                                      .makeStringAndClear(),
-                                                      US( "application/vnd.openxmlformats-officedocument.presentationml.slide+xml" ) );
+    FSHelperPtr pFS = openFragmentStreamWithSerializer( OUStringBuffer()
+                            .appendAscii( "ppt/slides/slide" )
+                            .append( (sal_Int32) nPageNum + 1 )
+                            .appendAscii( ".xml" )
+                            .makeStringAndClear(),
+                            US( "application/vnd.openxmlformats-officedocument.presentationml.slide+xml" ) );
 
     if( mpSlidesFSArray.size() < mnPages )
     mpSlidesFSArray.resize( mnPages );
@@ -1212,12 +1211,12 @@ void PowerPointExport::ImplWriteNotes( sal_uInt32 nPageNum )
 
     DBG(printf("write Notes %d\n----------------\n", nPageNum));
 
-    FSHelperPtr pFS = openOutputStreamWithSerializer( OUStringBuffer()
-                                                      .appendAscii( "ppt/notesSlides/notesSlide" )
-                                                      .append( (sal_Int32) nPageNum + 1 )
-                                                      .appendAscii( ".xml" )
-                                                      .makeStringAndClear(),
-                                                      US( "application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml" ) );
+    FSHelperPtr pFS = openFragmentStreamWithSerializer( OUStringBuffer()
+                            .appendAscii( "ppt/notesSlides/notesSlide" )
+                            .append( (sal_Int32) nPageNum + 1 )
+                            .appendAscii( ".xml" )
+                            .makeStringAndClear(),
+                            US( "application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml" ) );
 
     pFS->startElementNS( XML_p, XML_notes, PNMSS, FSEND );
 
@@ -1352,12 +1351,12 @@ void PowerPointExport::ImplWriteSlideMaster( sal_uInt32 nPageNum, Reference< XPr
         mPresentationFS->endElementNS( XML_p, XML_sldMasterIdLst );
 
     FSHelperPtr pFS =
-    openOutputStreamWithSerializer( OUStringBuffer()
-                    .appendAscii( "ppt/slideMasters/slideMaster" )
-                    .append( (sal_Int32) nPageNum + 1 )
-                    .appendAscii( ".xml" )
-                    .makeStringAndClear(),
-                    US( "application/vnd.openxmlformats-officedocument.presentationml.slideMaster+xml" ) );
+    openFragmentStreamWithSerializer( OUStringBuffer()
+                      .appendAscii( "ppt/slideMasters/slideMaster" )
+                      .append( (sal_Int32) nPageNum + 1 )
+                      .appendAscii( ".xml" )
+                      .makeStringAndClear(),
+                      US( "application/vnd.openxmlformats-officedocument.presentationml.slideMaster+xml" ) );
     if( mpMasterFSArray.size() < mnMasterPages )
     mpMasterFSArray.resize( mnMasterPages );
     mpMasterFSArray[ nPageNum ] = pFS;
@@ -1450,12 +1449,12 @@ void PowerPointExport::ImplWriteLayout( sal_Int32 nOffset, sal_uInt32 nMasterNum
     return;
 
     FSHelperPtr pFS
-        = openOutputStreamWithSerializer( OUStringBuffer()
-                                          .appendAscii( "ppt/slideLayouts/slideLayout" )
-                                          .append( (sal_Int32) mnLayoutFileIdMax )
-                                          .appendAscii( ".xml" )
-                                          .makeStringAndClear(),
-                                          US( "application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml" ) );
+        = openFragmentStreamWithSerializer( OUStringBuffer()
+                        .appendAscii( "ppt/slideLayouts/slideLayout" )
+                        .append( (sal_Int32) mnLayoutFileIdMax )
+                        .appendAscii( ".xml" )
+                        .makeStringAndClear(),
+                        US( "application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml" ) );
 
 //     LayoutInfo& rLayoutInfo = GetLayoutInfo( mXPagePropSet );
 
@@ -1826,12 +1825,12 @@ ShapeExport& PowerPointShapeExport::WritePlaceholderShape( Reference< XShape > x
 
 void PowerPointExport::WriteTheme( sal_Int32 nThemeNum )
 {
-    FSHelperPtr pFS = openOutputStreamWithSerializer( OUStringBuffer()
-                              .appendAscii( "ppt/theme/theme" )
-                              .append( (sal_Int32) nThemeNum + 1 )
-                              .appendAscii( ".xml" )
-                              .makeStringAndClear(),
-                                                      US( "application/vnd.openxmlformats-officedocument.theme+xml" ) );
+    FSHelperPtr pFS = openFragmentStreamWithSerializer( OUStringBuffer()
+                            .appendAscii( "ppt/theme/theme" )
+                            .append( (sal_Int32) nThemeNum + 1 )
+                            .appendAscii( ".xml" )
+                            .makeStringAndClear(),
+                            US( "application/vnd.openxmlformats-officedocument.theme+xml" ) );
 
     pFS->startElementNS( XML_a, XML_theme,
                          FSNS( XML_xmlns, XML_a), "http://schemas.openxmlformats.org/drawingml/2006/main",
@@ -1881,8 +1880,8 @@ sal_Bool PowerPointExport::WriteNotesMaster()
     mPresentationFS->endElementNS( XML_p, XML_notesMasterIdLst );
 
     FSHelperPtr pFS =
-    openOutputStreamWithSerializer( US( "ppt/notesMasters/notesMaster1.xml" ),
-                    US( "application/vnd.openxmlformats-officedocument.presentationml.notesMaster+xml" ) );
+    openFragmentStreamWithSerializer( US( "ppt/notesMasters/notesMaster1.xml" ),
+                      US( "application/vnd.openxmlformats-officedocument.presentationml.notesMaster+xml" ) );
     // write theme per master
     WriteTheme( mnMasterPages );
 
@@ -1943,11 +1942,6 @@ sal_Bool PowerPointExport::ImplCreateMainNotes()
 
 //------------------------------------------------------------------------------------------------------------------------------------------------------------------
 
-drawingml::chart::ChartConverter& PowerPointExport::getChartConverter()
-{
-    return *mxChartConv;
-}
-
 #define IMPL_NAME "com.sun.star.comp.Impress.oox.PowerPointExport"
 
 OUString SAL_CALL PowerPointExport_getImplementationName() throw()
diff --git a/sd/source/filter/pptx/pptx-pptexanimations.cxx b/sd/source/filter/pptx/pptx-pptexanimations.cxx
index 5f39837..02bc31c 100644
--- a/sd/source/filter/pptx/pptx-pptexanimations.cxx
+++ b/sd/source/filter/pptx/pptx-pptexanimations.cxx
@@ -1035,7 +1035,7 @@ sal_Int16 AnimationExporter::exportAnimPropertySet( SvStream& rStrm, const Refer
             exportAnimPropertyuInt32( rStrm, DFF_ANIM_NODE_TYPE, nPPTNodeType, TRANSLATE_NONE );
         }
     }
-    sal_uInt32 nPresetId;
+    sal_uInt32 nPresetId = 0;
     sal_uInt32 nPresetSubType = 0;
     sal_uInt32 nAPIPresetClass = EffectPresetClass::CUSTOM;
     sal_uInt32 nPresetClass = DFF_ANIM_PRESS_CLASS_USER_DEFINED;
commit c7627a7a980b99a198c26a708fa8fd4e845bf787
Author: Katarina Machalkova <kmachalkova at suse.cz>
Date:   Tue Oct 19 16:41:27 2010 +0200

    Merged oox-pptx-export-animations-paragraph-target.diff

diff --git a/sd/source/filter/pptx/pptexanimations.hxx b/sd/source/filter/pptx/pptexanimations.hxx
index 83bc809..d48591a 100644
--- a/sd/source/filter/pptx/pptexanimations.hxx
+++ b/sd/source/filter/pptx/pptexanimations.hxx
@@ -144,6 +144,7 @@ public:
         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 );
+    static ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > getTargetElementShape( const ::com::sun::star::uno::Any& rAny, sal_Int32& rBegin, sal_Int32& rEnd, sal_Bool& rParagraphTarget );
 };
 } // namespace ppt
 
diff --git a/sd/source/filter/pptx/pptx-epptooxml.cxx b/sd/source/filter/pptx/pptx-epptooxml.cxx
index 220284e..d25e178 100644
--- a/sd/source/filter/pptx/pptx-epptooxml.cxx
+++ b/sd/source/filter/pptx/pptx-epptooxml.cxx
@@ -633,13 +633,24 @@ void PowerPointExport::WriteAnimationAttributeName( FSHelperPtr pFS, const OUStr
 
 void PowerPointExport::WriteAnimationTarget( FSHelperPtr pFS, Any aTarget )
 {
-    Reference< XShape > rXShape( aTarget, UNO_QUERY );
+    sal_Int32 nBegin = -1, nEnd = -1;
+    sal_Bool bParagraphTarget;
+    Reference< XShape > rXShape = AnimationExporter::getTargetElementShape( aTarget, nBegin, nEnd, bParagraphTarget );
 
     if( rXShape.is() ) {
     pFS->startElementNS( XML_p, XML_tgtEl, FSEND );
-    pFS->singleElementNS( XML_p, XML_spTgt,
-                  XML_spid, I32S( ShapeExport::GetShapeID( rXShape, &maShapeMap ) ),
+    pFS->startElementNS( XML_p, XML_spTgt,
+                 XML_spid, I32S( ShapeExport::GetShapeID( rXShape, &maShapeMap ) ),
+                 FSEND );
+    if( bParagraphTarget ) {
+        pFS->startElementNS( XML_p, XML_txEl, FSEND );
+        pFS->singleElementNS( XML_p, XML_pRg,
+                  XML_st, I32S( nBegin ),
+                  XML_end, I32S( nEnd ),
                   FSEND );
+        pFS->endElementNS( XML_p, XML_txEl );
+    }
+    pFS->endElementNS( XML_p, XML_spTgt );
     pFS->endElementNS( XML_p, XML_tgtEl );
     }
 }
diff --git a/sd/source/filter/pptx/pptx-pptexanimations.cxx b/sd/source/filter/pptx/pptx-pptexanimations.cxx
index bf502ab..5f39837 100644
--- a/sd/source/filter/pptx/pptx-pptexanimations.cxx
+++ b/sd/source/filter/pptx/pptx-pptexanimations.cxx
@@ -1761,54 +1761,69 @@ void AnimationExporter::exportAnimateTarget( SvStream& rStrm, const Reference< X
     }
 }
 
-void AnimationExporter::exportAnimateTargetElement( SvStream& rStrm, const Any aAny, const sal_Bool bCreate2b01Atom )
+Reference< XShape > AnimationExporter::getTargetElementShape( const Any& rAny, sal_Int32& rBegin, sal_Int32& rEnd, sal_Bool& rParagraphTarget )
 {
     Reference< XShape > xShape;
-    aAny >>= xShape;
-    sal_uInt32 nRefMode = 0;    // nRefMode == 2 -> Paragraph
-    sal_Int32 begin = -1;
-    sal_Int32 end = -1;
+    rAny >>= xShape;
+
+    rParagraphTarget = sal_False;
 
     if( !xShape.is() )
     {
-        ParagraphTarget aParaTarget;
-        if( aAny >>= aParaTarget )
-            xShape = aParaTarget.Shape;
-        if ( xShape.is() )
+    ParagraphTarget aParaTarget;
+    if( rAny >>= aParaTarget )
+        xShape = aParaTarget.Shape;
+    if ( xShape.is() )
+    {
+        // now calculating the character range for the paragraph
+        sal_Int16 nParagraph = aParaTarget.Paragraph;
+        Reference< XSimpleText > xText( xShape, UNO_QUERY );
+        if ( xText.is() )
+        {
+        rParagraphTarget = sal_True;
+        Reference< XEnumerationAccess > xTextParagraphEnumerationAccess( xText, UNO_QUERY );
+        if ( xTextParagraphEnumerationAccess.is() )
         {
-            // now calculating the character range for the paragraph
-            sal_Int16 nParagraph = aParaTarget.Paragraph;
-            Reference< XSimpleText > xText( xShape, UNO_QUERY );
-            if ( xText.is() )
+            Reference< XEnumeration > xTextParagraphEnumeration( xTextParagraphEnumerationAccess->createEnumeration() );
+            if ( xTextParagraphEnumeration.is() )
             {
-                nRefMode = 2;
-                Reference< XEnumerationAccess > xTextParagraphEnumerationAccess( xText, UNO_QUERY );
-                if ( xTextParagraphEnumerationAccess.is() )
+            sal_Int16 nCurrentParagraph;
+            rBegin = rEnd = nCurrentParagraph = 0;
+            while ( xTextParagraphEnumeration->hasMoreElements() )
+            {
+                Reference< XTextRange > xTextRange( xTextParagraphEnumeration->nextElement(), UNO_QUERY );
+                if ( xTextRange.is() )
                 {
-                    Reference< XEnumeration > xTextParagraphEnumeration( xTextParagraphEnumerationAccess->createEnumeration() );
-                    if ( xTextParagraphEnumeration.is() )
-                    {
-                        sal_Int16 nCurrentParagraph;
-                        begin = end = nCurrentParagraph = 0;
-                        while ( xTextParagraphEnumeration->hasMoreElements() )
-                        {
-                            Reference< XTextRange > xTextRange( xTextParagraphEnumeration->nextElement(), UNO_QUERY );
-                            if ( xTextRange.is() )
-                            {
-                                rtl::OUString aParaText( xTextRange->getString() );
-                                sal_Int32 nLength = aParaText.getLength() + 1;
-                                end += nLength;
-                                if ( nCurrentParagraph == nParagraph )
-                                    break;
-                                nCurrentParagraph++;
-                                begin += nLength;
-                            }
-                        }
-                    }
+                rtl::OUString aParaText( xTextRange->getString() );
+                sal_Int32 nLength = aParaText.getLength() + 1;
+                rEnd += nLength;
+                if ( nCurrentParagraph == nParagraph )
+                    break;
+                nCurrentParagraph++;
+                rBegin += nLength;
                 }
             }
+            }
         }
+        }
+    }
     }
+
+    return xShape;
+}
+
+void AnimationExporter::exportAnimateTargetElement( SvStream& rStrm, const Any aAny, const sal_Bool bCreate2b01Atom )
+{
+    sal_uInt32 nRefMode = 0;	// nRefMode == 2 -> Paragraph
+    sal_Int32 begin = -1;
+    sal_Int32 end = -1;
+    sal_Bool bParagraphTarget;
+
+    Reference< XShape > xShape = getTargetElementShape( aAny, begin, end, bParagraphTarget );
+
+    if( bParagraphTarget )
+        nRefMode = 2;
+
     if ( xShape.is() || bCreate2b01Atom )
     {
         EscherExContainer aAnimateTargetElement( rStrm, DFF_msofbtAnimateTargetElement );
commit 6368b5315d35fdf08d29fa91b50c3fbc62313fae
Author: Katarina Machalkova <kmachalkova at suse.cz>
Date:   Tue Oct 19 16:40:50 2010 +0200

    Merged oox-pptx-export-animations-filter.diff from ooo-build

diff --git a/sd/source/filter/pptx/epptooxml.hxx b/sd/source/filter/pptx/epptooxml.hxx
index 02d3930..44beff3 100644
--- a/sd/source/filter/pptx/epptooxml.hxx
+++ b/sd/source/filter/pptx/epptooxml.hxx
@@ -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 --git a/sd/source/filter/pptx/pptexanimations.hxx b/sd/source/filter/pptx/pptexanimations.hxx
index e561bab..83bc809 100644
--- a/sd/source/filter/pptx/pptexanimations.hxx
+++ b/sd/source/filter/pptx/pptexanimations.hxx
@@ -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 --git a/sd/source/filter/pptx/pptx-epptooxml.cxx b/sd/source/filter/pptx/pptx-epptooxml.cxx
index c71c57f..220284e 100644
--- a/sd/source/filter/pptx/pptx-epptooxml.cxx
+++ b/sd/source/filter/pptx/pptx-epptooxml.cxx
@@ -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( FSHelperPtr pFS, Any aValue, const OUStri
 
 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::WriteAnimationNodeAnimate( FSHelperPtr pFS, const Referen
 
     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::WriteAnimationNodeAnimate( FSHelperPtr pFS, const Referen
         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::WriteAnimationNodeAnimate( FSHelperPtr pFS, const Referen
     }
     }
 
-    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::WriteAnimationNodeAnimate( FSHelperPtr pFS, const Referen
     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::WriteAnimationNodeSeq( FSHelperPtr pFS, const Reference<
     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::WriteAnimationNode( FSHelperPtr pFS, const Reference< XAn
         xmlNodeType = XML_set;
         pMethod = &PowerPointExport::WriteAnimationNodeAnimate;
         break;
-// 	case AnimationNodeType::TRANSITIONFILTER:
-// 	    xmlNodeType = XML_xfrm;
+    case AnimationNodeType::TRANSITIONFILTER:
+        xmlNodeType = XML_animEffect;
+        pMethod = &PowerPointExport::WriteAnimationNodeEffect;
         break;
     }
 
diff --git a/sd/source/filter/pptx/pptx-pptexanimations.cxx b/sd/source/filter/pptx/pptx-pptexanimations.cxx
index 1cf5744..bf502ab 100644
--- a/sd/source/filter/pptx/pptx-pptexanimations.cxx
+++ b/sd/source/filter/pptx/pptx-pptexanimations.cxx
@@ -243,7 +243,7 @@ sal_uInt32 AnimationExporter::TranslatePresetSubType( const sal_uInt32 nPresetCl
     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::exportTransitionFilter( SvStream& rStrm, const Reference
             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 ) );
commit e41bc09f0c71b0ea94ede7cc7c59fdfed56ce811
Author: Katarina Machalkova <kmachalkova at suse.cz>
Date:   Tue Oct 19 16:39:22 2010 +0200

    Merged oox-drawingml-fix-shapes-map-crash.diff from ooo-build

diff --git a/sd/source/filter/pptx/epptooxml.hxx b/sd/source/filter/pptx/epptooxml.hxx
index 2c850bd..02d3930 100644
--- a/sd/source/filter/pptx/epptooxml.hxx
+++ b/sd/source/filter/pptx/epptooxml.hxx
@@ -3,7 +3,7 @@
 
 #include <oox/core/xmlfilterbase.hxx>
 #include <oox/helper/zipstorage.hxx>
-
+#include <oox/export/shapes.hxx>
 #include "epptbase.hxx"
 
 namespace com { namespace sun { namespace star {
@@ -125,6 +125,8 @@ private:
     sal_Bool mbCreateNotes;
 
     static sal_Int32 nStyleLevelToken[5];
+
+    ::oox::drawingml::ShapeExport::ShapeHashMap maShapeMap;
 };
 
 }
diff --git a/sd/source/filter/pptx/pptx-epptooxml.cxx b/sd/source/filter/pptx/pptx-epptooxml.cxx
index b0aeabf..c71c57f 100644
--- a/sd/source/filter/pptx/pptx-epptooxml.cxx
+++ b/sd/source/filter/pptx/pptx-epptooxml.cxx
@@ -79,7 +79,7 @@ class PowerPointShapeExport : public ShapeExport
     PageType            mePageType;
     sal_Bool            mbMaster;
 public:
-                        PowerPointShapeExport( FSHelperPtr pFS, PowerPointExport* pFB );
+    PowerPointShapeExport( FSHelperPtr pFS, ShapeHashMap* pShapeMap, PowerPointExport* pFB );
     void                SetMaster( sal_Bool bMaster );
     void                SetPageType( PageType ePageType );
     ShapeExport&        WriteNonVisualProperties( Reference< XShape > xShape );
@@ -92,8 +92,8 @@ public:
     sal_Bool WritePlaceholder( Reference< XShape > xShape, PlaceholderType ePlaceholder, sal_Bool bMaster );
 };
 
-PowerPointShapeExport::PowerPointShapeExport( FSHelperPtr pFS, PowerPointExport* pFB )
-    : ShapeExport( XML_p, pFS, pFB )
+    PowerPointShapeExport::PowerPointShapeExport( FSHelperPtr pFS, ShapeHashMap* pShapeMap, PowerPointExport* pFB )
+        : ShapeExport( XML_p, pFS, pShapeMap, pFB )
     , mrExport( *pFB )
 {
 }
@@ -218,6 +218,7 @@ bool PowerPointExport::importDocument() throw()
 bool PowerPointExport::exportDocument() throw()
 {
     DrawingML::ResetCounters();
+    maShapeMap.clear ();
 
     addRelation( US( "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" ), S( "ppt/presentation.xml" ) );
 
@@ -250,6 +251,8 @@ bool PowerPointExport::exportDocument() throw()
 
     commit();
 
+    maShapeMap.clear ();
+
     return true;
 }
 
@@ -274,7 +277,7 @@ void PowerPointExport::ImplWriteBackground( FSHelperPtr pFS, Reference< XPropert
     pFS->startElementNS( XML_p, XML_bg, FSEND );
     pFS->startElementNS( XML_p, XML_bgPr, FSEND );
 
-    PowerPointShapeExport( pFS, this ).WriteFill( rXPropSet );
+    PowerPointShapeExport( pFS, &maShapeMap, this ).WriteFill( rXPropSet );
 
     pFS->endElementNS( XML_p, XML_bgPr );
     pFS->endElementNS( XML_p, XML_bg );
@@ -631,7 +634,7 @@ void PowerPointExport::WriteAnimationTarget( FSHelperPtr pFS, Any aTarget )
     if( rXShape.is() ) {
     pFS->startElementNS( XML_p, XML_tgtEl, FSEND );
     pFS->singleElementNS( XML_p, XML_spTgt,
-                  XML_spid, I32S( ShapeExport::GetShapeID( rXShape ) ),
+                  XML_spid, I32S( ShapeExport::GetShapeID( rXShape, &maShapeMap ) ),
                   FSEND );
     pFS->endElementNS( XML_p, XML_tgtEl );
     }
@@ -1440,7 +1443,7 @@ void PowerPointExport::ImplWriteLayout( sal_Int32 nOffset, sal_uInt32 nMasterNum
 
 void PowerPointExport::WriteShapeTree( FSHelperPtr pFS, PageType ePageType, sal_Bool bMaster )
 {
-    PowerPointShapeExport aDML( pFS, this );
+    PowerPointShapeExport aDML( pFS, &maShapeMap, this );
     aDML.SetMaster( bMaster );
     aDML.SetPageType( ePageType );
     sal_uInt32 nShapes;
commit d423acb12122e5ffbd3512158368d609800fdb25
Author: Katarina Machalkova <kmachalkova at suse.cz>
Date:   Tue Oct 19 16:34:03 2010 +0200

    Merged oox-pptx-export-fix-hidden-slides.diff from ooo-build

diff --git a/sd/source/filter/pptx/pptx-epptooxml.cxx b/sd/source/filter/pptx/pptx-epptooxml.cxx
index c7efa9c..b0aeabf 100644
--- a/sd/source/filter/pptx/pptx-epptooxml.cxx
+++ b/sd/source/filter/pptx/pptx-epptooxml.cxx
@@ -1114,7 +1114,17 @@ void PowerPointExport::ImplWriteSlide( sal_uInt32 nPageNum, sal_uInt32 nMasterNu
     mpSlidesFSArray.resize( mnPages );
     mpSlidesFSArray[ nPageNum ] = pFS;
 
-    pFS->startElementNS( XML_p, XML_sld, PNMSS, FSEND );
+    const char* pShow = NULL;
+
+    if( GETA( Visible ) ) {
+    sal_Bool bShow;
+    if( ( mAny >>= bShow ) && !bShow )
+        pShow = "0";
+    }
+
+    pFS->startElementNS( XML_p, XML_sld, PNMSS,
+             XML_show, pShow,
+             FSEND );
 
     pFS->startElementNS( XML_p, XML_cSld, FSEND );
 
commit b5a43c7b7fc7833823cbb675955e36ae1776c36d
Author: Katarina Machalkova <kmachalkova at suse.cz>
Date:   Tue Oct 19 16:32:02 2010 +0200

    Merged pptx-export-empty-animations-node-and-groupshape-fix.diff

diff --git a/sd/source/filter/pptx/pptx-epptooxml.cxx b/sd/source/filter/pptx/pptx-epptooxml.cxx
index b8f33ff..c7efa9c 100644
--- a/sd/source/filter/pptx/pptx-epptooxml.cxx
+++ b/sd/source/filter/pptx/pptx-epptooxml.cxx
@@ -172,17 +172,13 @@ ShapeExport& PowerPointShapeExport::WriteUnknownShape( Reference< XShape > xShap
 
     DBG(printf( "shape(unknown): %s\n", USS(sShapeType) ));
 
-    if( sShapeType.equalsAscii( "com.sun.star.drawing.Group" ) )
+    if( sShapeType.equalsAscii( "com.sun.star.drawing.GroupShape" ) )
     {
         Reference< XIndexAccess > rXIndexAccess( xShape, UNO_QUERY );
 
         mrExport.EnterGroup( rXIndexAccess );
         DBG(printf( "enter group\n" ));
     }
-    else if( sShapeType.equalsAscii( "com.sun.star.drawing.Group" ) )
-    {
-        WritePageShape( xShape, mePageType, mrExport.GetPresObj() );
-    }
     else if( sShapeType.equalsAscii( "com.sun.star.drawing.PageShape" ) )
     {
         WritePageShape( xShape, mePageType, mrExport.GetPresObj() );
@@ -1059,18 +1055,26 @@ void PowerPointExport::WriteAnimationNode( FSHelperPtr pFS, const Reference< XAn
 
 void PowerPointExport::WriteAnimations( FSHelperPtr pFS )
 {
-    pFS->startElementNS( XML_p, XML_timing, FSEND );
-    pFS->startElementNS( XML_p, XML_tnLst, FSEND );
-
     Reference< XAnimationNodeSupplier > xNodeSupplier( mXDrawPage, UNO_QUERY );
     if( xNodeSupplier.is() ) {
     const Reference< XAnimationNode > xNode( xNodeSupplier->getAnimationNode() );
-    if( xNode.is() )
-        WriteAnimationNode( pFS, xNode, FALSE );
-    }
+    if( xNode.is() ) {
+        Reference< XEnumerationAccess > xEnumerationAccess( xNode, UNO_QUERY );
+        if( xEnumerationAccess.is() ) {
+        Reference< XEnumeration > xEnumeration( xEnumerationAccess->createEnumeration(), UNO_QUERY );
+        if( xEnumeration.is() && xEnumeration->hasMoreElements() ) {
+
+            pFS->startElementNS( XML_p, XML_timing, FSEND );
+            pFS->startElementNS( XML_p, XML_tnLst, FSEND );
 
-    pFS->endElementNS( XML_p, XML_tnLst );
-    pFS->endElementNS( XML_p, XML_timing );
+            WriteAnimationNode( pFS, xNode, FALSE );
+
+            pFS->endElementNS( XML_p, XML_tnLst );
+            pFS->endElementNS( XML_p, XML_timing );
+        }
+        }
+    }
+    }
 }
 
 void PowerPointExport::ImplWriteSlide( sal_uInt32 nPageNum, sal_uInt32 nMasterNum, sal_uInt16 /* nMode */,
commit c004b0542bfa100bde510ea826ad9011b8cb04ae
Author: Katarina Machalkova <kmachalkova at suse.cz>
Date:   Tue Oct 19 16:28:18 2010 +0200

    Merged pptx-the-rest-from-git.diff from ooo-build

diff --git a/sd/source/filter/pptx/epptooxml.hxx b/sd/source/filter/pptx/epptooxml.hxx
index 2a49d1f..2c850bd 100644
--- a/sd/source/filter/pptx/epptooxml.hxx
+++ b/sd/source/filter/pptx/epptooxml.hxx
@@ -6,6 +6,13 @@
 
 #include "epptbase.hxx"
 
+namespace com { namespace sun { namespace star {
+    namespace animations {
+        class XAnimate;
+        class XAnimationNode;
+    }
+}}}
+
 namespace oox {
     namespace drawingml {
         class ShapeExport;
@@ -70,22 +77,30 @@ protected:
 
     sal_Bool WriteNotesMaster();
 
+    void WriteAnimateTo( ::sax_fastparser::FSHelperPtr pFS, const ::com::sun::star::uno::Any aValue, const ::rtl::OUString& rAttributeName );
+    void WriteAnimateValues( ::sax_fastparser::FSHelperPtr pFS, const ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimate >& rXAnimate );
+    void WriteAnimationCondition( ::sax_fastparser::FSHelperPtr pFS, ::com::sun::star::uno::Any& rAny, sal_Bool bWriteEvent, sal_Bool bMainSeqChild );
+    void WriteAnimationCondition( ::sax_fastparser::FSHelperPtr pFS, const char* pDelay, const char* pEvent, double fDelay, sal_Bool bHasFDelay );
+    void WriteAnimations( ::sax_fastparser::FSHelperPtr pFS );
+    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 WriteAnimationNodeSeq( ::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 );
+    void WriteAnimationTarget( ::sax_fastparser::FSHelperPtr pFS, ::com::sun::star::uno::Any aTarget );
     void WriteTextStyles( ::sax_fastparser::FSHelperPtr pFS );
     void WriteTextStyle( ::sax_fastparser::FSHelperPtr pFS, int nInstance, sal_Int32 xmlToken );
     void WriteTextStyleLevel( ::sax_fastparser::FSHelperPtr pFS, int nInstance, int nLevel );
     void ImplWriteBackground( ::sax_fastparser::FSHelperPtr pFS, ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > aXBackgroundPropSet );
+    void WriteTransition( ::sax_fastparser::FSHelperPtr pFS );
 
     sal_Int32 GetLayoutFileId( sal_Int32 nOffset, sal_uInt32 nMasterNum );
 
     // shapes
     void WriteShapeTree( ::sax_fastparser::FSHelperPtr pFS, PageType ePageType, sal_Bool bMaster );
 
-    void WritePlaceholderShape( ::sax_fastparser::FSHelperPtr pFS, drawingml::ShapeExport& rDML, PlaceholderType ePlaceholder );
-    void WritePageShape( ::sax_fastparser::FSHelperPtr pFS, drawingml::ShapeExport& rDML, PageType ePageType );
-
-    // helper parts
-    sal_Bool WritePlaceholder( ::sax_fastparser::FSHelperPtr pFS, drawingml::ShapeExport& rDML, PlaceholderType ePlaceholder, sal_Bool bMaster );
-
     sal_uInt32 GetNewSlideId() { return mnSlideIdMax ++; }
     sal_uInt32 GetNewSlideMasterId() { return mnSlideMasterIdMax ++; }
 
@@ -105,9 +120,7 @@ private:
 
     sal_uInt32 mnSlideIdMax;
     sal_uInt32 mnSlideMasterIdMax;
-
-    sal_Int32 mnShapeIdMax;
-    sal_Int32 mnPictureIdMax;
+    sal_uInt32 mnAnimationNodeIdMax;
 
     sal_Bool mbCreateNotes;
 
diff --git a/sd/source/filter/pptx/pptexanimations.hxx b/sd/source/filter/pptx/pptexanimations.hxx
index a56f79c..e561bab 100644
--- a/sd/source/filter/pptx/pptexanimations.hxx
+++ b/sd/source/filter/pptx/pptexanimations.hxx
@@ -34,6 +34,7 @@
 #include <com/sun/star/animations/XTimeContainer.hpp>
 #include <com/sun/star/drawing/XDrawPage.hpp>
 #include <com/sun/star/animations/XAnimate.hpp>
+#include <com/sun/star/beans/NamedValue.hpp>
 #ifndef _SD_PPTANIMATIONS_HXX
 #include "../ppt/pptanimations.hxx"
 #endif
@@ -87,7 +88,6 @@ class AnimationExporter
     void writeZString( SvStream& rStrm, const rtl::OUString& rVal );
     sal_Bool getColorAny( const ::com::sun::star::uno::Any& rAny, const sal_Int16 nColorSpace, sal_Int32& rMode, sal_Int32& rA, sal_Int32& rB, sal_Int32& rC ) const;
     sal_Bool exportAnimProperty( SvStream& rStrm, const sal_uInt16 nPropertyId, const ::com::sun::star::uno::Any& rAny, const TranslateMode eTranslateMode );
-    ::com::sun::star::uno::Any convertAnimateValue( const ::com::sun::star::uno::Any& rSource, const rtl::OUString& rAttributeName ) const;
     void exportAnimPropertyString( SvStream& rStrm, const sal_uInt16 nPropertyId, const rtl::OUString& rVal, const TranslateMode eTranslateMode );
     void exportAnimPropertyFloat( SvStream& rStrm, const sal_uInt16 nPropertyId, const double& rVal, const TranslateMode eTranslateMode );
     void exportAnimPropertyuInt32( SvStream& rStrm, const sal_uInt16 nPropertyId, const sal_uInt32 nVal, const TranslateMode eTranslateMode );
@@ -133,8 +133,16 @@ public:
     void doexport( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& xPage, SvStream& rStrm );
 
     sal_Int32 mnCurrentGroup;
-};
 
+        // helper methods also used in ooxml export
+    static ::com::sun::star::uno::Any convertAnimateValue( const ::com::sun::star::uno::Any& rSource, const rtl::OUString& rAttributeName );
+        static sal_Bool GetNodeType( const ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode >& xNode, sal_Int16& nType );
+        static sal_Int16 GetFillMode( const ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode >& xNode, const sal_Int16 nFillDefault );
+        static void GetUserData( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& rUserData, const ::com::sun::star::uno::Any ** pAny, sal_Size nLen );
+        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 );
+};
 } // namespace ppt
 
 #endif
diff --git a/sd/source/filter/pptx/pptx-epptooxml.cxx b/sd/source/filter/pptx/pptx-epptooxml.cxx
index bd3d962..b8f33ff 100644
--- a/sd/source/filter/pptx/pptx-epptooxml.cxx
+++ b/sd/source/filter/pptx/pptx-epptooxml.cxx
@@ -12,15 +12,32 @@
 #include <filter/msfilter/escherex.hxx>
 #include <tools/poly.hxx>
 
-#include <com/sun/star/drawing/FillStyle.hpp>
-#include <com/sun/star/drawing/RectanglePoint.hpp>
+#include <com/sun/star/animations/AnimationAdditiveMode.hpp>
+#include <com/sun/star/animations/AnimationCalcMode.hpp>
+#include <com/sun/star/animations/AnimationFill.hpp>
+#include <com/sun/star/animations/AnimationNodeType.hpp>
+#include <com/sun/star/animations/AnimationRestart.hpp>
+#include <com/sun/star/animations/AnimationValueType.hpp>
+#include <com/sun/star/animations/Event.hpp>
+#include <com/sun/star/animations/EventTrigger.hpp>
+#include <com/sun/star/animations/Timing.hpp>
+#include <com/sun/star/animations/ValuePair.hpp>
+#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/beans/Property.hpp>
 #include <com/sun/star/beans/XPropertySetInfo.hpp>
-#include <com/sun/star/text/XSimpleText.hpp>
+#include <com/sun/star/container/XEnumerationAccess.hpp>
+#include <com/sun/star/drawing/FillStyle.hpp>
+#include <com/sun/star/drawing/RectanglePoint.hpp>
 #include <com/sun/star/presentation/AnimationSpeed.hpp>
+#include <com/sun/star/presentation/EffectNodeType.hpp>
+#include <com/sun/star/text/XSimpleText.hpp>
 
 #include <oox/export/utils.hxx>
 
+#include "pptexanimations.hxx"
+
 // presentation namespaces
 #define PNMSS         FSNS( XML_xmlns, XML_a ), "http://schemas.openxmlformats.org/drawingml/2006/main", \
                       FSNS( XML_xmlns, XML_p ), "http://schemas.openxmlformats.org/presentationml/2006/main", \
@@ -30,9 +47,13 @@ using ::rtl::OString;
 using ::rtl::OUString;
 using ::rtl::OUStringBuffer;
 using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::animations;
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::container;
 using namespace ::com::sun::star::drawing;
 using namespace ::com::sun::star::presentation;
+using namespace ::com::sun::star::uno;
+using namespace ::ppt;
 using ::com::sun::star::beans::XPropertySet;
 using ::com::sun::star::beans::XPropertySetInfo;
 using ::com::sun::star::lang::XMultiServiceFactory;
@@ -64,6 +85,11 @@ public:
     ShapeExport&        WriteNonVisualProperties( Reference< XShape > xShape );
     ShapeExport&        WriteTextShape( Reference< XShape > xShape );
     ShapeExport&        WriteUnknownShape( Reference< XShape > xShape );
+    ShapeExport&        WritePlaceholderShape( Reference< XShape > xShape, PlaceholderType ePlaceholder );
+    ShapeExport&        WritePageShape( Reference< XShape > xShape, PageType ePageType, sal_Bool bPresObj );
+
+    // helper parts
+    sal_Bool WritePlaceholder( Reference< XShape > xShape, PlaceholderType ePlaceholder, sal_Bool bMaster );
 };
 
 PowerPointShapeExport::PowerPointShapeExport( FSHelperPtr pFS, PowerPointExport* pFB )
@@ -101,39 +127,39 @@ ShapeExport& PowerPointShapeExport::WriteTextShape( Reference< XShape > xShape )
     }
     else if( sShapeType.equalsAscii( "com.sun.star.presentation.DateTimeShape" ) )
     {
-        if( !mrExport.WritePlaceholder( GetFS(), *this, DateAndTime, mbMaster ) )
+        if( !WritePlaceholder( xShape, DateAndTime, mbMaster ) )
             ShapeExport::WriteTextShape( xShape );
     }
     else if( sShapeType.equalsAscii( "com.sun.star.presentation.FooterShape" ) )
     {
-        if( !mrExport.WritePlaceholder( GetFS(), *this, Footer, mbMaster ) )
+        if( !WritePlaceholder( xShape, Footer, mbMaster ) )
             ShapeExport::WriteTextShape( xShape );
     }
     else if( sShapeType.equalsAscii( "com.sun.star.presentation.HeaderShape" ) )
     {
-        if( !mrExport.WritePlaceholder( GetFS(), *this, Header, mbMaster ) )
+        if( !WritePlaceholder( xShape, Header, mbMaster ) )
             ShapeExport::WriteTextShape( xShape );
     }
     else if( sShapeType.equalsAscii( "com.sun.star.presentation.NotesShape" ) )
     {
         if( mePageType == NOTICE && mrExport.GetPresObj() )
-            mrExport.WritePlaceholderShape( GetFS(), *this, Notes );
+            WritePlaceholderShape( xShape, Notes );
         else
             ShapeExport::WriteTextShape( xShape );
     }
     else if( sShapeType.equalsAscii( "com.sun.star.presentation.OutlinerShape" ) )
     {
-        if( !mrExport.WritePlaceholder( GetFS(), *this, Outliner, mbMaster ) )
+        if( !WritePlaceholder( xShape, Outliner, mbMaster ) )
             ShapeExport::WriteTextShape( xShape );
     }
     else if( sShapeType.equalsAscii( "com.sun.star.presentation.SlideNumberShape" ) )
     {
-        if( !mrExport.WritePlaceholder( GetFS(), *this, SlideNumber, mbMaster ) )
+        if( !WritePlaceholder( xShape, SlideNumber, mbMaster ) )
             ShapeExport::WriteTextShape( xShape );
     }
     else if( sShapeType.equalsAscii( "com.sun.star.presentation.TitleTextShape" ) )
     {
-        if( !mrExport.WritePlaceholder( GetFS(), *this, Title, mbMaster ) )
+        if( !WritePlaceholder( xShape, Title, mbMaster ) )
             ShapeExport::WriteTextShape( xShape );
     }
 
@@ -155,15 +181,15 @@ ShapeExport& PowerPointShapeExport::WriteUnknownShape( Reference< XShape > xShap
     }
     else if( sShapeType.equalsAscii( "com.sun.star.drawing.Group" ) )
     {
-        mrExport.WritePageShape( GetFS(), *this, mePageType );
+        WritePageShape( xShape, mePageType, mrExport.GetPresObj() );
     }
     else if( sShapeType.equalsAscii( "com.sun.star.drawing.PageShape" ) )
     {
-        mrExport.WritePageShape( GetFS(), *this, mePageType );
+        WritePageShape( xShape, mePageType, mrExport.GetPresObj() );
     }
     else if( sShapeType.equalsAscii( "com.sun.star.presentation.SubtitleShape" ) )
     {
-        if( !mrExport.WritePlaceholder( GetFS(), *this, Subtitle, mbMaster ) )
+        if( !WritePlaceholder( xShape, Subtitle, mbMaster ) )
             ShapeExport::WriteTextShape( xShape );
     }
 
@@ -177,8 +203,7 @@ PowerPointExport::PowerPointExport( const Reference< XMultiServiceFactory > & rS
       mnLayoutFileIdMax( 1 ),
       mnSlideIdMax( 1 << 8 ),
       mnSlideMasterIdMax( 1 << 31 ),
-      mnShapeIdMax( 1 ),
-      mnPictureIdMax( 1 )
+      mnAnimationNodeIdMax( 1 )
 {
     memset( mLayoutInfo, 0, sizeof(mLayoutInfo) );
 }
@@ -354,56 +379,8 @@ const char* PowerPointExport::Get8Direction( sal_uInt8 nDirection )
     return pDirection;
 }
 
-void PowerPointExport::ImplWriteSlide( sal_uInt32 nPageNum, sal_uInt32 nMasterNum, sal_uInt16 /* nMode */,
-                                       sal_Bool bHasBackground, Reference< XPropertySet > aXBackgroundPropSet )
+void PowerPointExport::WriteTransition( FSHelperPtr pFS )
 {
-    DBG(printf("write slide: %d\n----------------\n", nPageNum));
-
-    // slides list
-    if( nPageNum == 0 )
-        mPresentationFS->startElementNS( XML_p, XML_sldIdLst, FSEND );
-
-    // add explicit relation of presentation to this slide
-    OUString sRelId = addRelation( mPresentationFS->getOutputStream(),
-                                   US( "http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide" ),
-                                   OUStringBuffer()
-                                   .appendAscii( "slides/slide" )
-                                   .append( (sal_Int32) nPageNum + 1 )
-                                   .appendAscii( ".xml" )
-                                   .makeStringAndClear() );
-
-    mPresentationFS->singleElementNS( XML_p, XML_sldId,
-                                      XML_id, I32S( GetNewSlideId() ),
-                                      FSNS( XML_r, XML_id ), USS( sRelId ),
-                                      FSEND );
-
-    if( nPageNum == mnPages - 1 )
-        mPresentationFS->endElementNS( XML_p, XML_sldIdLst );
-
-    FSHelperPtr pFS = openOutputStreamWithSerializer( OUStringBuffer()
-                                                      .appendAscii( "ppt/slides/slide" )
-                                                      .append( (sal_Int32) nPageNum + 1 )
-                                                      .appendAscii( ".xml" )
-                                                      .makeStringAndClear(),
-                                                      US( "application/vnd.openxmlformats-officedocument.presentationml.slide+xml" ) );
-
-    if( mpSlidesFSArray.size() < mnPages )
-    mpSlidesFSArray.resize( mnPages );
-    mpSlidesFSArray[ nPageNum ] = pFS;
-
-    pFS->startElementNS( XML_p, XML_sld, PNMSS, FSEND );
-
-    pFS->startElementNS( XML_p, XML_cSld, FSEND );
-
-    // background
-    if( bHasBackground ) {
-        ImplWriteBackground( pFS, aXBackgroundPropSet );
-    }
-
-    WriteShapeTree( pFS, NORMAL, FALSE );
-
-    pFS->endElementNS( XML_p, XML_cSld );
-
     FadeEffect eFadeEffect = FadeEffect_NONE;
     GET( eFadeEffect, Effect );
 
@@ -561,6 +538,593 @@ void PowerPointExport::ImplWriteSlide( sal_uInt32 nPageNum, sal_uInt32 nMasterNu
 
     pFS->endElementNS( XML_p, XML_transition );
     }
+}
+
+void PowerPointExport::WriteAnimationProperty( FSHelperPtr pFS, const Any& rAny )
+{
+    if( !rAny.hasValue() )
+    return;
+
+    switch( rAny.getValueType().getTypeClass() ) {
+    case TypeClass_STRING:
+        pFS->singleElementNS( XML_p, XML_strVal,
+                  XML_val, USS( *static_cast< const OUString* >( rAny.getValue() ) ),
+                  FSEND );
+        break;
+    default:
+        break;
+    }
+}
+
+void PowerPointExport::WriteAnimateValues( FSHelperPtr pFS, const Reference< XAnimate >& rXAnimate )
+{
+    const Sequence< double > aKeyTimes = rXAnimate->getKeyTimes();
+    if( aKeyTimes.getLength() <= 0 )
+    return;
+    const Sequence< Any > aValues = rXAnimate->getValues();
+    const OUString& sFormula = rXAnimate->getFormula();
+    const OUString& rAttributeName = rXAnimate->getAttributeName();
+
+    DBG(printf("animate values, formula: %s\n", USS( sFormula )));
+
+    pFS->startElementNS( XML_p, XML_tavLst, FSEND );
+
+    for( int i = 0; i < aKeyTimes.getLength(); i++ ) {
+    DBG(printf("animate value %d: %f\n", i, aKeyTimes[ i ]));
+    if( aValues[ i ].hasValue() ) {
+        pFS->startElementNS( XML_p, XML_tav,
+                 XML_fmla, sFormula.getLength() > 0 ? USS( sFormula ) : NULL,
+                 XML_tm, I32S( ( sal_Int32 )( aKeyTimes[ i ]*100000.0 ) ),
+                 FSEND );
+        pFS->startElementNS( XML_p, XML_val, FSEND );
+        ValuePair aPair;
+        if( aValues[ i ] >>= aPair ) {
+        WriteAnimationProperty( pFS, AnimationExporter::convertAnimateValue( aPair.First, rAttributeName ) );
+        WriteAnimationProperty( pFS, AnimationExporter::convertAnimateValue( aPair.Second, rAttributeName ) );
+        } else
+        WriteAnimationProperty( pFS, AnimationExporter::convertAnimateValue( aValues[ i ], rAttributeName ) );
+
+        pFS->endElementNS( XML_p, XML_val );
+        pFS->endElementNS( XML_p, XML_tav );
+    }
+    }
+
+    pFS->endElementNS( XML_p, XML_tavLst );
+}
+
+void PowerPointExport::WriteAnimateTo( FSHelperPtr pFS, Any aValue, const OUString& rAttributeName )
+{
+    if( !aValue.hasValue() )
+    return;
+
+    DBG(printf("to attribute name: %s\n", USS( rAttributeName )));
+
+    pFS->startElementNS( XML_p, XML_to, FSEND );
+
+    WriteAnimationProperty( pFS, AnimationExporter::convertAnimateValue( aValue, rAttributeName ) );
+
+    pFS->endElementNS( XML_p, XML_to );
+}
+
+void PowerPointExport::WriteAnimationAttributeName( FSHelperPtr pFS, const OUString& rAttributeName )
+{
+    pFS->startElementNS( XML_p, XML_attrNameLst, FSEND );
+
+    DBG(printf("write attribute name: %s\n", USS( rAttributeName )));
+
+    const char* sAttributeName = NULL;
+    if( rAttributeName.equalsAscii( "Visibility" ) ) {
+    sAttributeName = "style.visibility";
+    } else if( rAttributeName.equalsAscii( "X" ) ) {
+    sAttributeName = "ppt_x";
+    } else if( rAttributeName.equalsAscii( "Y" ) ) {
+    sAttributeName = "ppt_y";
+    }
+
+    pFS->startElementNS( XML_p, XML_attrName, FSEND );
+    pFS->writeEscaped( sAttributeName );
+    pFS->endElementNS( XML_p, XML_attrName );
+
+    pFS->endElementNS( XML_p, XML_attrNameLst );
+}
+
+void PowerPointExport::WriteAnimationTarget( FSHelperPtr pFS, Any aTarget )
+{
+    Reference< XShape > rXShape( aTarget, UNO_QUERY );
+
+    if( rXShape.is() ) {
+    pFS->startElementNS( XML_p, XML_tgtEl, FSEND );
+    pFS->singleElementNS( XML_p, XML_spTgt,
+                  XML_spid, I32S( ShapeExport::GetShapeID( rXShape ) ),
+                  FSEND );
+    pFS->endElementNS( XML_p, XML_tgtEl );
+    }
+}
+
+void PowerPointExport::WriteAnimationNodeAnimate( FSHelperPtr pFS, const Reference< XAnimationNode >& rXNode, sal_Int32 nXmlNodeType, sal_Bool bMainSeqChild )
+{
+    Reference< XAnimate > rXAnimate( rXNode, UNO_QUERY );
+    if( !rXAnimate.is() )
+    return;
+
+    const char* pCalcMode = NULL;
+    const char* pValueType = NULL;
+    const char* pAdditive = NULL;
+
+    if( nXmlNodeType == XML_anim ) {
+    switch( rXAnimate->getCalcMode() ) {
+        case AnimationCalcMode::DISCRETE:
+        pCalcMode = "discrete";
+        break;
+        case AnimationCalcMode::LINEAR:
+        pCalcMode = "lin";
+        break;
+    }
+
+    switch( AnimationExporter::GetValueTypeForAttributeName( rXAnimate->getAttributeName() ) ) {
+        case AnimationValueType::STRING:
+        pValueType = "str";
+        break;
+        case AnimationValueType::NUMBER:
+        pValueType = "num";
+        break;
+        case AnimationValueType::COLOR:
+        pValueType = "clr";
+        break;
+    }
+
+    switch( rXAnimate->getAdditive() ) {
+        case AnimationAdditiveMode::BASE:
+        pAdditive = "base";
+        break;
+        case AnimationAdditiveMode::SUM:
+        pAdditive = "sum";
+        break;
+        case AnimationAdditiveMode::REPLACE:
+        pAdditive = "repl";
+        break;
+        case AnimationAdditiveMode::MULTIPLY:
+        pAdditive = "mult";
+        break;
+        case AnimationAdditiveMode::NONE:
+        pAdditive = "none";
+        break;
+    }
+    }
+
+    pFS->startElementNS( XML_p, nXmlNodeType,
+             XML_calcmode, pCalcMode,
+             XML_valueType, pValueType,
+             FSEND );
+    pFS->startElementNS( XML_p, XML_cBhvr,
+             XML_additive, pAdditive,
+             FSEND );
+    WriteAnimationNodeCommonPropsStart( pFS, rXNode, TRUE, bMainSeqChild );
+    WriteAnimationTarget( pFS, rXAnimate->getTarget() );
+    WriteAnimationAttributeName( pFS, rXAnimate->getAttributeName() );
+    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 )
+{
+    if( bHasFDelay || pDelay || pEvent ) {
+    if( !pEvent )
+        pFS->singleElementNS( XML_p, XML_cond,
+                  XML_delay, bHasFDelay ? I64S( (sal_uInt32) (fDelay*1000.0) ) : pDelay,
+                  FSEND );
+    else {
+        pFS->startElementNS( XML_p, XML_cond,
+                 XML_delay, bHasFDelay ? I64S( (sal_uInt32) (fDelay*1000.0) ) : pDelay,
+                 XML_evt, pEvent,
+                 FSEND );
+
+        pFS->startElementNS( XML_p, XML_tgtEl, FSEND );
+        pFS->singleElementNS( XML_p, XML_sldTgt, FSEND );
+        pFS->endElementNS( XML_p, XML_tgtEl );
+
+        pFS->endElementNS( XML_p, XML_cond );
+    }
+    }
+}
+
+void PowerPointExport::WriteAnimationCondition( FSHelperPtr pFS, Any& rAny, sal_Bool bWriteEvent, sal_Bool bMainSeqChild )
+{
+    sal_Bool bHasFDelay = FALSE;
+    double fDelay = 0;
+    Timing eTiming;
+    Event aEvent;
+    const char* pDelay = NULL;
+    const char* pEvent = NULL;
+
+    if( rAny >>= fDelay )
+    bHasFDelay = TRUE;
+    else if( rAny >>= eTiming ) {
+    if( eTiming == Timing_INDEFINITE )
+        pDelay = "indefinite";
+    } else if( rAny >>= aEvent ) {
+        // TODO
+        DBG(printf ("animation condition event: TODO\n"));
+        DBG(printf ("event offset has value: %d triger: %d source has value: %d\n", aEvent.Offset.hasValue(), aEvent.Trigger, aEvent.Source.hasValue()));
+
+        if( !bWriteEvent && aEvent.Trigger == EventTrigger::ON_NEXT && bMainSeqChild )
+            pDelay = "indefinite";
+        else if( bWriteEvent ) {
+            switch( aEvent.Trigger ) {
+            case EventTrigger::ON_NEXT:
+                pEvent = "onNext";
+                break;
+            case EventTrigger::ON_PREV:
+                pEvent = "onPrev";
+                break;
+            case EventTrigger::BEGIN_EVENT:
+                pEvent = "begin";
+                break;
+            case EventTrigger::END_EVENT:
+                pEvent = "end";
+                break;
+            case EventTrigger::ON_BEGIN:
+                pEvent = "onBegin";
+                break;
+            case EventTrigger::ON_END:
+                pEvent = "onEnd";
+                break;
+            case EventTrigger::ON_CLICK:
+                pEvent = "onClick";
+                break;
+            case EventTrigger::ON_DBL_CLICK:
+                pEvent = "onDblClick";
+                break;
+            case EventTrigger::ON_STOP_AUDIO:
+                pEvent = "onStopAudio";
+                break;
+            case EventTrigger::ON_MOUSE_ENTER:
+                pEvent = "onMouseOver";   // not exact?
+                break;
+            case EventTrigger::ON_MOUSE_LEAVE:
+                pEvent = "onMouseOut";
+                break;
+            }
+        }
+
+        if( aEvent.Offset >>= fDelay ) {
+            bHasFDelay = TRUE;
+            DBG(printf ("event offset: %f\n", fDelay));
+        } else if( aEvent.Offset >>= eTiming ) {
+            if( eTiming == Timing_INDEFINITE )
+                pDelay = "indefinite";
+            DBG(printf ("event offset timing: %d\n", eTiming));
+        }
+    }
+
+    WriteAnimationCondition( pFS, pDelay, pEvent, fDelay, bHasFDelay );
+}
+
+void PowerPointExport::WriteAnimationNodeCommonPropsStart( FSHelperPtr pFS, const Reference< XAnimationNode >& rXNode, sal_Bool bSingle, sal_Bool bMainSeqChild )
+{
+    const char* pDuration = NULL;
+    const char* pRestart = NULL;
+    const char* pNodeType = NULL;
+    const char* pPresetClass = NULL;
+    const char* pFill = NULL;
+    double fDuration = 0;
+    Any aAny;
+
+    aAny = rXNode->getDuration();
+    if( aAny.hasValue() ) {
+    Timing eTiming;
+
+    if( aAny >>= eTiming ) {
+        if( eTiming == Timing_INDEFINITE )
+        pDuration = "indefinite";
+    } else
+        aAny >>= fDuration;
+    }
+
+    switch( rXNode->getRestart() ) {
+    case AnimationRestart::ALWAYS:
+        pRestart = "always";
+        break;
+    case AnimationRestart::WHEN_NOT_ACTIVE:
+        pRestart = "whenNotActive";
+        break;
+    case AnimationRestart::NEVER:
+        pRestart = "never";
+        break;
+    }
+
+    const Sequence< NamedValue > aUserData = rXNode->getUserData();
+    const Any* pAny[ DFF_ANIM_PROPERTY_ID_COUNT ];
+    AnimationExporter::GetUserData( aUserData, pAny, sizeof( pAny ) );
+
+    sal_Int16 nType = 0;
+    if( pAny[ DFF_ANIM_NODE_TYPE ] && ( *pAny[ DFF_ANIM_NODE_TYPE ] >>= nType ) ) {
+    switch( nType ) {
+        case EffectNodeType::TIMING_ROOT:
+        pNodeType = "tmRoot";
+        if( !pDuration )
+            pDuration = "indefinite";
+        if( !pRestart )
+            pRestart = "never";
+        break;
+        case EffectNodeType::MAIN_SEQUENCE:
+        pNodeType = "mainSeq";
+        break;
+        case EffectNodeType::ON_CLICK:
+        pNodeType = "clickEffect";
+        break;
+        case EffectNodeType::AFTER_PREVIOUS:
+        pNodeType = "afterEffect";
+        break;
+        case EffectNodeType::WITH_PREVIOUS:
+        pNodeType = "withEffect";
+        break;
+        case EffectNodeType::INTERACTIVE_SEQUENCE:
+        pNodeType = "interactiveSeq";
+        break;
+    }
+    }
+
+    sal_uInt32 nPresetClass = DFF_ANIM_PRESS_CLASS_USER_DEFINED;
+    if ( pAny[ DFF_ANIM_PRESET_CLASS ] ) {
+    if ( *pAny[ DFF_ANIM_PRESET_CLASS ] >>= nPresetClass ) {
+        switch( nPresetClass ) {
+        case EffectPresetClass::ENTRANCE:
+            pPresetClass = "entr";
+            break;
+        case EffectPresetClass::EXIT:
+            pPresetClass = "exit";
+            break;
+        case EffectPresetClass::EMPHASIS:
+            pPresetClass = "emph";
+            break;
+        case EffectPresetClass::MOTIONPATH:
+            pPresetClass = "path";
+            break;
+        case EffectPresetClass::OLEACTION:
+            pPresetClass = "verb";  // ?
+            break;
+        case EffectPresetClass::MEDIACALL:
+            pPresetClass = "mediacall";
+            break;
+        }
+    }
+    }
+
+    sal_uInt32 nPresetId;
+    sal_Bool bPresetId = FALSE;
+    if ( pAny[ DFF_ANIM_PRESET_ID ] ) {
+    rtl::OUString sPreset;
+    if ( *pAny[ DFF_ANIM_PRESET_ID ] >>= sPreset )
+        nPresetId = AnimationExporter::GetPresetID( sPreset, nPresetClass, bPresetId );
+    }
+
+    sal_uInt32 nPresetSubType = 0;
+    sal_Bool bPresetSubType = FALSE;
+    if ( pAny[ DFF_ANIM_PRESET_SUB_TYPE ] ) {
+    rtl::OUString sPresetSubType;
+    if ( *pAny[ DFF_ANIM_PRESET_SUB_TYPE ] >>= sPresetSubType ) {
+        nPresetSubType = AnimationExporter::TranslatePresetSubType( nPresetClass, nPresetId, sPresetSubType );
+        bPresetSubType = sal_True;
+    }
+    }
+
+    if( nType != EffectNodeType::TIMING_ROOT && nType != EffectNodeType::MAIN_SEQUENCE ) {
+    // it doesn't seem to work right on root and mainseq nodes
+    sal_Int16 nFill = AnimationExporter::GetFillMode( rXNode, AnimationFill::AUTO );
+    switch( nFill ) {
+        case AnimationFill::FREEZE:
+        pFill = "freeze";
+        break;
+        case AnimationFill::HOLD:
+        pFill = "hold";
+        break;
+        case AnimationFill::REMOVE:
+        pFill = "remove";
+        break;
+        case AnimationFill::TRANSITION:
+        pFill = "transition";
+        break;
+    }
+    }
+
+    pFS->startElementNS( XML_p, XML_cTn,
+             XML_id, I64S( mnAnimationNodeIdMax ++ ),
+             XML_dur, fDuration != 0 ? I32S( (sal_Int32) ( fDuration * 1000.0 ) ) : pDuration,
+             XML_restart, pRestart,
+             XML_nodeType, pNodeType,
+             XML_fill, pFill,
+             XML_presetClass, pPresetClass,
+             XML_presetID, bPresetId ? I64S( nPresetId ) : NULL,
+             XML_presetSubtype, bPresetSubType ? I64S( nPresetSubType ) : NULL,
+             FSEND );
+
+    aAny = rXNode->getBegin();
+    if( aAny.hasValue() ) {
+    Sequence< Any > aCondSeq;
+
+    pFS->startElementNS( XML_p, XML_stCondLst, FSEND );
+    if( aAny >>= aCondSeq ) {
+        for( int i = 0; i < aCondSeq.getLength(); i ++ )
+        WriteAnimationCondition( pFS, aCondSeq[ i ], FALSE, bMainSeqChild );
+    } else
+        WriteAnimationCondition( pFS, aAny, FALSE, bMainSeqChild );
+    pFS->endElementNS( XML_p, XML_stCondLst );
+    }
+
+    aAny = rXNode->getEnd();
+    if( aAny.hasValue() ) {
+    Sequence< Any > aCondSeq;
+
+    pFS->startElementNS( XML_p, XML_endCondLst, FSEND );
+    if( aAny >>= aCondSeq ) {
+        for( int i = 0; i < aCondSeq.getLength(); i ++ )
+        WriteAnimationCondition( pFS, aCondSeq[ i ], FALSE, bMainSeqChild );
+    } else
+        WriteAnimationCondition( pFS, aAny, FALSE, bMainSeqChild );
+    pFS->endElementNS( XML_p, XML_stCondLst );
+    }
+
+    Reference< XEnumerationAccess > xEnumerationAccess( rXNode, UNO_QUERY );
+    if( xEnumerationAccess.is() ) {
+    Reference< XEnumeration > xEnumeration( xEnumerationAccess->createEnumeration(), UNO_QUERY );
+    if( xEnumeration.is() ) {
+        DBG(printf ("-----\n"));
+
+        pFS->startElementNS( XML_p, XML_childTnLst, FSEND );
+
+        while( xEnumeration->hasMoreElements() ) {
+        Reference< XAnimationNode > xChildNode( xEnumeration->nextElement(), UNO_QUERY );
+        if( xChildNode.is() )
+            WriteAnimationNode( pFS, xChildNode, nType == EffectNodeType::MAIN_SEQUENCE );
+        }
+
+        pFS->endElementNS( XML_p, XML_childTnLst );
+
+        DBG(printf ("-----\n"));
+    }
+    }
+
+    if( bSingle )
+    pFS->endElementNS( XML_p, XML_cTn );
+}
+
+void PowerPointExport::WriteAnimationNodeCommonPropsEnd( FSHelperPtr pFS )
+{
+    pFS->endElementNS( XML_p, XML_cTn );
+}
+
+void PowerPointExport::WriteAnimationNodeSeq( FSHelperPtr pFS, const Reference< XAnimationNode >& rXNode, sal_Int32, sal_Bool bMainSeqChild )
+{
+    DBG(printf ("write animation node SEQ\n"));
+
+    pFS->startElementNS( XML_p, XML_seq, FSEND );
+
+    WriteAnimationNodeCommonPropsStart( pFS, rXNode, TRUE, bMainSeqChild );
+
+    pFS->startElementNS( XML_p, XML_prevCondLst, FSEND );
+    WriteAnimationCondition( pFS, NULL, "onPrev", 0, TRUE );
+    pFS->endElementNS( XML_p, XML_prevCondLst );
+
+    pFS->startElementNS( XML_p, XML_nextCondLst, FSEND );
+    WriteAnimationCondition( pFS, NULL, "onNext", 0, TRUE );
+    pFS->endElementNS( XML_p, XML_nextCondLst );
+
+    pFS->endElementNS( XML_p, XML_seq );
+}
+
+void PowerPointExport::WriteAnimationNode( FSHelperPtr pFS, const Reference< XAnimationNode >& rXNode, sal_Bool bMainSeqChild )
+{
+    DBG(printf ("export node type: %d\n", rXNode->getType()));
+    sal_Int32 xmlNodeType = -1;
+    typedef void (PowerPointExport::*AnimationNodeWriteMethod)( FSHelperPtr, const Reference< XAnimationNode >&, sal_Int32, sal_Bool );
+    AnimationNodeWriteMethod pMethod = NULL;
+
+    switch( rXNode->getType() ) {
+    case AnimationNodeType::PAR:
+        xmlNodeType = XML_par;
+        break;
+    case AnimationNodeType::SEQ:
+        pMethod = &PowerPointExport::WriteAnimationNodeSeq;
+        break;
+    case AnimationNodeType::ANIMATE:
+        xmlNodeType = XML_anim;
+        pMethod = &PowerPointExport::WriteAnimationNodeAnimate;
+        break;
+    case AnimationNodeType::SET:
+        xmlNodeType = XML_set;
+        pMethod = &PowerPointExport::WriteAnimationNodeAnimate;
+        break;
+// 	case AnimationNodeType::TRANSITIONFILTER:
+// 	    xmlNodeType = XML_xfrm;
+        break;
+    }
+
+    if( pMethod ) {
+    (this->*(pMethod))( pFS, rXNode, xmlNodeType, bMainSeqChild );
+    return;
+    }
+
+    if( xmlNodeType == -1 )
+    return;
+
+    pFS->startElementNS( XML_p, xmlNodeType, FSEND );
+
+    WriteAnimationNodeCommonPropsStart( pFS, rXNode, TRUE, bMainSeqChild );
+
+    pFS->endElementNS( XML_p, xmlNodeType );
+}
+
+void PowerPointExport::WriteAnimations( FSHelperPtr pFS )
+{
+    pFS->startElementNS( XML_p, XML_timing, FSEND );
+    pFS->startElementNS( XML_p, XML_tnLst, FSEND );
+
+    Reference< XAnimationNodeSupplier > xNodeSupplier( mXDrawPage, UNO_QUERY );
+    if( xNodeSupplier.is() ) {
+    const Reference< XAnimationNode > xNode( xNodeSupplier->getAnimationNode() );
+    if( xNode.is() )
+        WriteAnimationNode( pFS, xNode, FALSE );
+    }
+
+    pFS->endElementNS( XML_p, XML_tnLst );
+    pFS->endElementNS( XML_p, XML_timing );
+}
+
+void PowerPointExport::ImplWriteSlide( sal_uInt32 nPageNum, sal_uInt32 nMasterNum, sal_uInt16 /* nMode */,
+                                       sal_Bool bHasBackground, Reference< XPropertySet > aXBackgroundPropSet )
+{
+    DBG(printf("write slide: %d\n----------------\n", nPageNum));
+
+    // slides list
+    if( nPageNum == 0 )
+        mPresentationFS->startElementNS( XML_p, XML_sldIdLst, FSEND );
+
+    // add explicit relation of presentation to this slide
+    OUString sRelId = addRelation( mPresentationFS->getOutputStream(),
+                                   US( "http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide" ),
+                                   OUStringBuffer()
+                                   .appendAscii( "slides/slide" )
+                                   .append( (sal_Int32) nPageNum + 1 )
+                                   .appendAscii( ".xml" )
+                                   .makeStringAndClear() );
+
+    mPresentationFS->singleElementNS( XML_p, XML_sldId,
+                                      XML_id, I32S( GetNewSlideId() ),
+                                      FSNS( XML_r, XML_id ), USS( sRelId ),
+                                      FSEND );
+
+    if( nPageNum == mnPages - 1 )
+        mPresentationFS->endElementNS( XML_p, XML_sldIdLst );
+
+    FSHelperPtr pFS = openOutputStreamWithSerializer( OUStringBuffer()
+                                                      .appendAscii( "ppt/slides/slide" )
+                                                      .append( (sal_Int32) nPageNum + 1 )
+                                                      .appendAscii( ".xml" )
+                                                      .makeStringAndClear(),
+                                                      US( "application/vnd.openxmlformats-officedocument.presentationml.slide+xml" ) );
+
+    if( mpSlidesFSArray.size() < mnPages )
+    mpSlidesFSArray.resize( mnPages );
+    mpSlidesFSArray[ nPageNum ] = pFS;
+
+    pFS->startElementNS( XML_p, XML_sld, PNMSS, FSEND );
+
+    pFS->startElementNS( XML_p, XML_cSld, FSEND );
+
+    // background
+    if( bHasBackground ) {
+        ImplWriteBackground( pFS, aXBackgroundPropSet );
+    }
+
+    WriteShapeTree( pFS, NORMAL, FALSE );
+
+    pFS->endElementNS( XML_p, XML_cSld );
+
+    WriteTransition( pFS );
+    WriteAnimations( pFS );
 
     pFS->endElementNS( XML_p, XML_sld );
 
@@ -888,21 +1452,21 @@ void PowerPointExport::WriteShapeTree( FSHelperPtr pFS, PageType ePageType, sal_
     pFS->endElementNS( XML_p, XML_spTree );
 }
 
-#define BEGIN_SHAPE pFS->startElementNS( XML_p, XML_sp, FSEND )
-#define END_SHAPE pFS->endElementNS( XML_p, XML_sp )
+#define BEGIN_SHAPE mpFS->startElementNS( XML_p, XML_sp, FSEND )
+#define END_SHAPE mpFS->endElementNS( XML_p, XML_sp )
 
-void PowerPointExport::WritePageShape( FSHelperPtr pFS, ShapeExport& rDML, PageType ePageType )
+ShapeExport& PowerPointShapeExport::WritePageShape( Reference< XShape > xShape, PageType ePageType, sal_Bool bPresObj )
 {
-    if( ePageType == NOTICE && mbPresObj )
-    WritePlaceholderShape( pFS, rDML, SlideImage );
-    else
-    rDML.WriteTextShape( mXShape );
+    if( ePageType == NOTICE && bPresObj )
+    return WritePlaceholderShape( xShape, SlideImage );
+
+    return WriteTextShape( xShape );
 }
 
-sal_Bool PowerPointExport::WritePlaceholder( FSHelperPtr pFS, ShapeExport& rDML, PlaceholderType ePlaceholder, sal_Bool bMaster )
+sal_Bool PowerPointShapeExport::WritePlaceholder( Reference< XShape > xShape, PlaceholderType ePlaceholder, sal_Bool bMaster )
 {
-    if( bMaster && ShapeExport::NonEmptyText( mXShape ) ) {
-    WritePlaceholderShape( pFS, rDML, ePlaceholder );
+    if( bMaster && ShapeExport::NonEmptyText( xShape ) ) {
+    WritePlaceholderShape( xShape, ePlaceholder );
 
     return TRUE;
     }
@@ -910,17 +1474,17 @@ sal_Bool PowerPointExport::WritePlaceholder( FSHelperPtr pFS, ShapeExport& rDML,
     return FALSE;
 }
 
-void PowerPointExport::WritePlaceholderShape( FSHelperPtr pFS, ShapeExport& rDML, PlaceholderType ePlaceholder )
+ShapeExport& PowerPointShapeExport::WritePlaceholderShape( Reference< XShape > xShape, PlaceholderType ePlaceholder )
 {
     BEGIN_SHAPE;
 
     // non visual shape properties
-    pFS->startElementNS( XML_p, XML_nvSpPr, FSEND );
-    rDML.WriteNonVisualDrawingProperties( mXShape, IDS( PlaceHolder ) );
-    pFS->startElementNS( XML_p, XML_cNvSpPr, FSEND );
-    pFS->singleElementNS( XML_a, XML_spLocks, XML_noGrp, "1", FSEND );
-    pFS->endElementNS( XML_p, XML_cNvSpPr );
-    pFS->startElementNS( XML_p, XML_nvPr, FSEND );
+    mpFS->startElementNS( XML_p, XML_nvSpPr, FSEND );
+    WriteNonVisualDrawingProperties( xShape, IDS( PlaceHolder ) );
+    mpFS->startElementNS( XML_p, XML_cNvSpPr, FSEND );
+    mpFS->singleElementNS( XML_a, XML_spLocks, XML_noGrp, "1", FSEND );
+    mpFS->endElementNS( XML_p, XML_cNvSpPr );
+    mpFS->startElementNS( XML_p, XML_nvPr, FSEND );
 
     const char* pType = NULL;
     switch( ePlaceholder ) {
@@ -954,20 +1518,24 @@ void PowerPointExport::WritePlaceholderShape( FSHelperPtr pFS, ShapeExport& rDML
     default:
         DBG(printf("warning: unhandled placeholder type: %d\n", ePlaceholder));
     }
-    pFS->singleElementNS( XML_p, XML_ph, XML_type, pType, FSEND );
-    pFS->endElementNS( XML_p, XML_nvPr );
-    pFS->endElementNS( XML_p, XML_nvSpPr );
+    mpFS->singleElementNS( XML_p, XML_ph, XML_type, pType, FSEND );
+    mpFS->endElementNS( XML_p, XML_nvPr );
+    mpFS->endElementNS( XML_p, XML_nvSpPr );
 
     // visual shape properties
-    pFS->startElementNS( XML_p, XML_spPr, FSEND );
-    rDML.WriteShapeTransformation( mXShape );
-    rDML.WritePresetShape( "rect" );
-    rDML.WriteBlipFill( mXPropSet, S( "GraphicURL" ) );
-    pFS->endElementNS( XML_p, XML_spPr );
+    mpFS->startElementNS( XML_p, XML_spPr, FSEND );
+    WriteShapeTransformation( xShape );
+    WritePresetShape( "rect" );
+    Reference< XPropertySet > xProps( xShape, UNO_QUERY );
+    if( xProps.is() )
+    WriteBlipFill( xProps, S( "GraphicURL" ) );
+    mpFS->endElementNS( XML_p, XML_spPr );
 
-    rDML.WriteTextBox( mXShape );
+    WriteTextBox( xShape );
 
     END_SHAPE;
+
+    return *this;
 }
 
 //------------------------------------------------------------------------------------------------------------------------------------------------------------------
diff --git a/sd/source/filter/pptx/pptx-pptexanimations.cxx b/sd/source/filter/pptx/pptx-pptexanimations.cxx
index 0607108..1cf5744 100644
--- a/sd/source/filter/pptx/pptx-pptexanimations.cxx
+++ b/sd/source/filter/pptx/pptx-pptexanimations.cxx
@@ -55,7 +55,6 @@
 #include <com/sun/star/animations/TransitionSubType.hpp>
 #include <com/sun/star/animations/ValuePair.hpp>
 #include <com/sun/star/animations/AnimationColorSpace.hpp>
-#include <com/sun/star/beans/NamedValue.hpp>
 #include <com/sun/star/drawing/FillStyle.hpp>
 #include <com/sun/star/drawing/LineStyle.hpp>
 #include <com/sun/star/awt/FontWeight.hpp>
@@ -164,7 +163,7 @@ void ImplTranslateAttribute( rtl::OUString& rString, const TranslateMode eTransl
     }
 }
 
-sal_uInt32 ImplTranslatePresetSubType( const sal_uInt32 nPresetClass, const sal_uInt32 nPresetId, const rtl::OUString& rPresetSubType )
+sal_uInt32 AnimationExporter::TranslatePresetSubType( const sal_uInt32 nPresetClass, const sal_uInt32 nPresetId, const rtl::OUString& rPresetSubType )
 {
     sal_uInt32    nPresetSubType = 0;
     sal_Bool    bTranslated = sal_False;
@@ -294,7 +293,7 @@ AnimationExporter::AnimationExporter( const EscherSolverContainer& rSolverContai
 
 // --------------------------------------------------------------------
 
-static sal_Int16 GetFillMode( const Reference< XAnimationNode >& xNode, const sal_Int16 nFillDefault )
+sal_Int16 AnimationExporter::GetFillMode( const Reference< XAnimationNode >& xNode, const sal_Int16 nFillDefault )
 {
     sal_Int16 nFill = xNode->getFill();
     if ( ( nFill == AnimationFill::DEFAULT ) ||
@@ -791,6 +790,27 @@ Reference< XAnimationNode > AnimationExporter::createAfterEffectNodeClone( const
     return xNode;
 }
 
+sal_Bool AnimationExporter::GetNodeType( const Reference< XAnimationNode >& xNode, sal_Int16& nType )
+{
+    // trying to get the nodetype
+    Sequence< NamedValue > aUserData = xNode->getUserData();
+    if ( aUserData.getLength() )
+    {
+    const NamedValue* p = aUserData.getConstArray();
+    sal_Int32 nLength = aUserData.getLength();
+    while( nLength-- )
+    {
+        if( p->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "node-type" ) ) )
+        {
+        if ( p->Value >>= nType )
+            return TRUE;
+        }
+    }
+    }
+
+    return FALSE;
+}
+
 void AnimationExporter::exportAnimNode( SvStream& rStrm, const Reference< XAnimationNode >& xNode,
         const ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode >*, const sal_Int32, const sal_Int16 nFillDefault )
 {
@@ -843,23 +863,12 @@ void AnimationExporter::exportAnimNode( SvStream& rStrm, const Reference< XAnima
             aAnim.mnGroupType = mso_Anim_GroupType_PAR;
         case AnimationNodeType::SEQ :
         {
-            // trying to get the nodetype
-            Sequence< NamedValue > aUserData = xNode->getUserData();
-            if ( aUserData.getLength() )
+            sal_Int16 nType = 0;
+            if( GetNodeType( xNode, nType ) )
+            switch( nType )
             {
-                const NamedValue* p = aUserData.getConstArray();
-                sal_Int32 nLength = aUserData.getLength();
-                while( nLength-- )
-                {
-                    if( p->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "node-type" ) ) )
-                    {
-                        sal_Int16 nType = 0;
-                        if ( p->Value >>= nType )
-                        {
-                            switch( nType )
-                            {
-                                case ::com::sun::star::presentation::EffectNodeType::TIMING_ROOT : aAnim.mnNodeType = 0x12; break;
-                                case ::com::sun::star::presentation::EffectNodeType::MAIN_SEQUENCE : aAnim.mnNodeType = 0x18; break;
+                case ::com::sun::star::presentation::EffectNodeType::TIMING_ROOT : aAnim.mnNodeType = 0x12; break;
+                case ::com::sun::star::presentation::EffectNodeType::MAIN_SEQUENCE : aAnim.mnNodeType = 0x18; break;
         /*
                                 case ::com::sun::star::presentation::EffectNodeType::ON_CLICK :
                                 case ::com::sun::star::presentation::EffectNodeType::WITH_PREVIOUS :
@@ -867,11 +876,6 @@ void AnimationExporter::exportAnimNode( SvStream& rStrm, const Reference< XAnima
                                 case ::com::sun::star::presentation::EffectNodeType::INTERACTIVE_SEQUENCE :
                                 default:
         */
-                                }
-                        }
-                        break;
-                    }
-                }
             }
         }
         break;
@@ -904,54 +908,94 @@ void AnimationExporter::exportAnimNode( SvStream& rStrm, const Reference< XAnima
         }
         break;
     }
+
     rStrm << aAnim;
 }
 
+void AnimationExporter::GetUserData( const Sequence< NamedValue >& rUserData, const Any ** pAny, sal_Size nLen )
+{
+    // storing user data into pAny, to allow direct access later
+    rtl_zeroMemory( pAny, nLen );
+    if ( rUserData.getLength() )
+    {
+    const NamedValue* p = rUserData.getConstArray();
+    sal_Int32 nLength = rUserData.getLength();
+    while( nLength-- )
+    {
+        if( p->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "node-type" ) ) )
+        {
+        pAny[ DFF_ANIM_NODE_TYPE ] = &(p->Value);
+        }
+        else if ( p->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "preset-class" ) ) )
+        {
+        pAny[ DFF_ANIM_PRESET_CLASS ] = &(p->Value);
+        }
+        else if ( p->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "preset-id" ) ) )
+        {
+        pAny[ DFF_ANIM_PRESET_ID ] = &(p->Value);
+        }
+        else if ( p->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "preset-sub-type" ) ) )
+        {
+        pAny[ DFF_ANIM_PRESET_SUB_TYPE ] = &(p->Value);
+        }
+        else if ( p->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "master-element" ) ) )
+        {
+        pAny[ DFF_ANIM_AFTEREFFECT ] = &(p->Value);;
+        }
+        p++;
+    }
+    }
+}
+

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list