Commits

Anonymous committed 2b3eef7

ooxml11: merge with DEV300 m76 (I hope), plus intermediate commit of own changes

  • Participants
  • Parent commits abfe33e

Comments (0)

Files changed (18)

File oox/inc/oox/export/drawingml.hxx

 #include <com/sun/star/awt/FontDescriptor.hpp>
 #include <com/sun/star/uno/XReference.hpp>
 #include <tools/poly.hxx>
-#include <svx/escherex.hxx>
+#include <filter/msfilter/escherex.hxx>
 
 class Graphic;
 class String;
 namespace drawing {
     class XShape;
 }
+namespace style {
+    struct LineSpacing;
+}
 namespace text {
     class XTextContent;
     class XTextRange;
     bool GetPropertyAndState( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > rXPropSet,
 			      ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyState > rXPropState,
 			      String aName, ::com::sun::star::beans::PropertyState& eState );
-    const char* GetFieldType( ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > rRun );
+    const char* GetFieldType( ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > rRun, sal_Bool& bIsField );
 
     rtl::OUString WriteImage( const rtl::OUString& rURL );
 
     void WriteBlipFill( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > rXPropSet, String sURLPropName );
     void WriteOutline( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > rXPropSet );
     void WriteStretch();
+    void WriteLinespacing( ::com::sun::star::style::LineSpacing& rLineSpacing );
 
-    ::rtl::OUString WriteBlip( ::rtl::OUString& rURL );
+    ::rtl::OUString WriteBlip( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > rXPropSet, ::rtl::OUString& rURL );
     void WriteBlipMode( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > rXPropSet );
 
     void WriteShapeTransformation( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > rXShape,
     void WriteParagraphNumbering( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > rXPropSet,
                                   sal_Int16 nLevel );
     void WriteRun( ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > rRun );
-    void WriteRunProperties( ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > rRun );
+    void WriteRunProperties( ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > rRun, sal_Bool bIsField );
 
     void WritePresetShape( const char* pShape );
     void WritePresetShape( const char* pShape, MSO_SPT eShapeType, sal_Bool bPredefinedHandlesUsed, sal_Int32 nAdjustmentsWhichNeedsToBeConverted, const ::com::sun::star::beans::PropertyValue& rProp );

File oox/inc/oox/export/vmlexport.hxx

 
 #include <oox/dllapi.h>
 #include <sax/fshelper.hxx>
-#include <svx/escherex.hxx>
+#include <filter/msfilter/escherex.hxx>
 
 namespace rtl {
     class OString;

File oox/inc/oox/ppt/pptimport.hxx

 	std::vector< SlidePersistPtr >&							getMasterPages(){ return maMasterPages; };
 	std::vector< SlidePersistPtr >&							getNotesPages(){ return maNotesPages; };
 
+    virtual sal_Bool SAL_CALL filter( const ::com::sun::star::uno::Sequence<   ::com::sun::star::beans::PropertyValue >& rDescriptor )
+        throw( ::com::sun::star::uno::RuntimeException );
+
 private:
     virtual ::rtl::OUString implGetImplementationName() const;
 

File oox/inc/oox/vml/vmldrawing.hxx

 
 #include <map>
 #include <memory>
-#include "oox/ole/oleobjecthelper.hxx"
+
+#include <oox/ole/oleobjecthelper.hxx>
 
 namespace com { namespace sun { namespace star {
     namespace awt { struct Rectangle; }

File oox/prj/build.lst

-oox	oox : vos cppu cppuhelper comphelper sal offapi sax basegfx tools vcl BOOST:boost OPENSSL:openssl NULL
+oox	oox : vos cppu cppuhelper comphelper sal offapi sax basegfx svx tools vcl BOOST:boost OPENSSL:openssl NULL
 oox	oox				usr1	-   all	oox_mkout NULL
 oox	oox\prj				get	-   all	oox_prj NULL
 oox	oox\source\token		nmake	-   all	oox_token NULL
 oox	oox\source\xls			nmake	-   all	oox_xls oox_token NULL
 oox	oox\source\dump			nmake	-   all	oox_dump oox_token NULL
 oox	oox\source\shape		nmake   -   all oox_shape oox_token NULL
+oox	oox\source\export		nmake   -   all oox_export oox_token NULL
 oox	oox\util			nmake   -   all oox_util oox_token oox_helper oox_core oox_ole oox_vml oox_drawingml oox_diagram oox_chart oox_table oox_ppt oox_xls oox_dump oox_shape oox_docprop NULL

File oox/prj/d.lst

 mkdir: %_DEST%\inc%_EXT%\oox\drawingml\chart
 mkdir: %_DEST%\inc%_EXT%\oox\drawingml\table
 mkdir: %_DEST%\inc%_EXT%\oox\vml
+mkdir: %_DEST%\inc%_EXT%\oox\export
+mkdir: %_DEST%\inc%_EXT%\oox\ole
 
 ..\%__SRC%\misc\*.map %_DEST%\bin%_EXT%\*.map
 ..\%__SRC%\lib\ixo.lib %_DEST%\lib%_EXT%\ixo.lib
 ..\inc\oox\drawingml\table\tablestylelist.hxx %_DEST%\inc%_EXT%\oox\drawingml\table\tablestylelist.hxx
 ..\inc\oox\vml\vmldrawing.hxx %_DEST%\inc%_EXT%\oox\vml\vmldrawing.hxx
 ..\inc\oox\vml\vmlshape.hxx %_DEST%\inc%_EXT%\oox\vml\vmlshape.hxx
+..\inc\oox\export\*.hxx %_DEST%\inc%_EXT%\oox\export\*.hxx
+..\inc\oox\ole\oleobjecthelper.hxx %_DEST%\inc%_EXT%\oox\ole\oleobjecthelper.hxx
 
 dos: sh -c "if test %OS% = MACOSX; then create-bundle %_DEST%\lib%_EXT%\*.dylib; fi"
 

File oox/source/export/drawingml.cxx

 #include <com/sun/star/awt/Gradient.hpp>
 #include <com/sun/star/beans/XPropertySet.hpp>
 #include <com/sun/star/beans/XPropertyState.hpp>
+#include <com/sun/star/beans/Property.hpp>
+#include <com/sun/star/beans/XPropertySetInfo.hpp>
 #include <com/sun/star/container/XEnumerationAccess.hpp>
+#include <com/sun/star/container/XIndexAccess.hpp>
 #include <com/sun/star/drawing/BitmapMode.hpp>
 #include <com/sun/star/drawing/EnhancedCustomShapeAdjustmentValue.hpp>
 #include <com/sun/star/drawing/LineDash.hpp>
 #include <com/sun/star/drawing/LineStyle.hpp>
 #include <com/sun/star/drawing/TextHorizontalAdjust.hpp>
 #include <com/sun/star/drawing/TextVerticalAdjust.hpp>
+#include <com/sun/star/drawing/XShape.hpp>
 #include <com/sun/star/i18n/ScriptType.hpp>
 #include <com/sun/star/io/XOutputStream.hpp>
+#include <com/sun/star/style/LineSpacing.hpp>
+#include <com/sun/star/style/LineSpacingMode.hpp>
 #include <com/sun/star/style/ParagraphAdjust.hpp>
+#include <com/sun/star/text/WritingMode.hpp>
 #include <com/sun/star/text/XText.hpp>
 #include <com/sun/star/text/XTextContent.hpp>
 #include <com/sun/star/text/XTextField.hpp>
 #include <tools/string.hxx>
 #include <vcl/cvtgrf.hxx>
 #include <unotools/fontcvt.hxx>
+#include <unotools/fontdefs.hxx>
 #include <vcl/graph.hxx>
 #include <svtools/grfmgr.hxx>
 #include <rtl/strbuf.hxx>
 #include <sfx2/app.hxx>
 #include <svl/languageoptions.hxx>
-#include <svx/escherex.hxx>
-#include <svx/svxenum.hxx>
+#include <filter/msfilter/escherex.hxx>
+#include <editeng/svxenum.hxx>
 
 using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::beans;
 using namespace ::com::sun::star::drawing;
 using namespace ::com::sun::star::i18n;
+using namespace ::com::sun::star::style;
+using namespace ::com::sun::star::text;
+using namespace ::com::sun::star::uno;
 using ::com::sun::star::beans::PropertyState;
 using ::com::sun::star::beans::PropertyValue;
 using ::com::sun::star::beans::XPropertySet;
 using ::com::sun::star::container::XEnumerationAccess;
 using ::com::sun::star::container::XIndexAccess;
 using ::com::sun::star::io::XOutputStream;
+using ::com::sun::star::style::LineSpacing;
 using ::com::sun::star::text::XText;
 using ::com::sun::star::text::XTextContent;
 using ::com::sun::star::text::XTextField;
 #define GET(variable, propName) \
     if ( GETA(propName) ) \
         mAny >>= variable;
+DBG(
+void lcl_dump_pset(Reference< XPropertySet > rXPropSet)
+{
+    Reference< XPropertySetInfo > info = rXPropSet->getPropertySetInfo ();
+    Sequence< beans::Property > props = info->getProperties ();
+
+    for (int i=0; i < props.getLength (); i++) {
+        OString name = OUStringToOString( props [i].Name, RTL_TEXTENCODING_UTF8);
+        fprintf (stderr,"%30s = ", name.getStr() );
+
+	try {
+        Any value = rXPropSet->getPropertyValue( props [i].Name );
+
+        OUString strValue;
+        sal_Int32 intValue;
+        bool boolValue;
+	LineSpacing spacing;
+//         RectanglePoint pointValue;
+
+        if( value >>= strValue )
+            fprintf (stderr,"\"%s\"\n", USS( strValue ) );
+        else if( value >>= intValue )
+            fprintf (stderr,"%d            (hex: %x)\n", intValue, intValue);
+        else if( value >>= boolValue )
+            fprintf (stderr,"%d            (bool)\n", boolValue);
+	else if( value >>= spacing ) {
+	    fprintf (stderr, "mode: %d value: %d\n", spacing.Mode, spacing.Height);
+	}
+//         else if( value >>= pointValue )
+//             fprintf (stderr,"%d            (RectanglePoint)\n", pointValue);
+        else
+            fprintf (stderr,"???           <unhandled type>\n");
+	} catch(Exception e) {
+	    fprintf (stderr,"unable to get '%s' value\n", USS(props [i].Name));
+	}
+    }
+}
+);
 
 // not thread safe
 int DrawingML::mnImageCounter = 1;
             }
 
             aData = aStream.GetData();
-            nDataSize = aStream.GetSize();
+            nDataSize = aStream.GetEndOfData();
             break;
             }
     }
         case DOCUMENT_XLSX: pComponent = "xl"; break;
     }
 
-    Reference< XOutputStream > xOutStream = mpFB->openOutputStream( OUStringBuffer()
-                                                                    .appendAscii( pComponent )
-                                                                    .appendAscii( "/media/image" )
-                                                                    .append( (sal_Int32) mnImageCounter )
-                                                                    .appendAscii( sExtension )
-                                                                    .makeStringAndClear(),
-                                                                    sMediaType );
+    Reference< XOutputStream > xOutStream = mpFB->openFragmentStream( OUStringBuffer()
+                                                                      .appendAscii( pComponent )
+                                                                      .appendAscii( "/media/image" )
+                                                                      .append( (sal_Int32) mnImageCounter )
+                                                                      .appendAscii( sExtension )
+                                                                      .makeStringAndClear(),
+                                                                      sMediaType );
     xOutStream->writeBytes( Sequence< sal_Int8 >( (const sal_Int8*) aData, nDataSize ) );
     xOutStream->closeOutput();
     
     return sRelId;
 }
 
-OUString DrawingML::WriteBlip( OUString& rURL )
+OUString DrawingML::WriteBlip( Reference< XPropertySet > rXPropSet, OUString& rURL )
 {
         OUString sRelId = WriteImage( rURL );
+	sal_Int16 nBright = 0;
+	sal_Int32 nContrast = 0;
 
-        mpFS->singleElementNS( XML_a, XML_blip,
-                               FSNS( XML_r, XML_embed), OUStringToOString( sRelId, RTL_TEXTENCODING_UTF8 ).getStr(),
-                               FSEND );
+	GET( nBright, AdjustLuminance );
+	GET( nContrast, AdjustContrast );
+
+        mpFS->startElementNS( XML_a, XML_blip,
+			      FSNS( XML_r, XML_embed), OUStringToOString( sRelId, RTL_TEXTENCODING_UTF8 ).getStr(),
+			      FSEND );
+	if( nBright || nContrast )
+	    mpFS->singleElementNS( XML_a, XML_lum,
+				   XML_bright, nBright ? I32S( nBright*1000 ) : NULL,
+				   XML_contrast, nContrast ? I32S( nContrast*1000 ) : NULL,
+				   FSEND );
+	    
+        mpFS->endElementNS( XML_a, XML_blip );
 
         return sRelId;
 }
 
         mpFS->startElementNS( nXmlNamespace , XML_blipFill, FSEND );
 
-        WriteBlip( aURL );
+        WriteBlip( rXPropSet, aURL );
 
         if( sURLPropName == S( "FillBitmapURL" ) )
             WriteBlipMode( rXPropSet );
     WriteTransformation( Rectangle( Point( aPos.X, aPos.Y ), Size( aSize.Width, aSize.Height ) ), bFlipH, bFlipV, nRotation );
 }
 
-void DrawingML::WriteRunProperties( Reference< XTextRange > rRun )
+void DrawingML::WriteRunProperties( Reference< XTextRange > rRun, sal_Bool bIsField )
 {
     Reference< XPropertySet > rXPropSet( rRun, UNO_QUERY );
     Reference< XPropertyState > rXPropState( rRun, UNO_QUERY );
                                FSEND );
     }
 
+    if( bIsField ) {
+        Reference< XTextField > rXTextField;
+        GET( rXTextField, TextField );
+        if( rXTextField.is() )
+            rXPropSet.set( rXTextField, UNO_QUERY );
+    }
+
+    // field properties starts here
+    if( GETA( URL ) ) {
+	OUString sURL;
+
+	mAny >>= sURL;
+	if( sURL.getLength() ) {
+	    OUString sRelId = mpFB->addRelation( mpFS->getOutputStream(),
+							  US( "http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink" ),
+							  sURL, US( "External" ) );
+
+	    mpFS->singleElementNS( XML_a, XML_hlinkClick,
+				   FSNS( XML_r,XML_id ), USS( sRelId ),
+				   FSEND );
+	}
+    }
+
     mpFS->endElementNS( XML_a, XML_rPr );
 }
 
-const char* DrawingML::GetFieldType( ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > rRun )
+const char* DrawingML::GetFieldType( ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > rRun, sal_Bool& bIsField )
 {
     const char* sType = NULL;
     Reference< XPropertySet > rXPropSet( rRun, UNO_QUERY );
         Reference< XTextField > rXTextField;
         GET( rXTextField, TextField );
         if( rXTextField.is() ) {
+	    bIsField = sal_True;
             rXPropSet.set( rXTextField, UNO_QUERY );
             if( rXPropSet.is() ) {
                 String aFieldKind( rXTextField->getPresentation( TRUE ) );
                 if( aFieldKind == S( "Page" ) ) {
                     return "slidenum";
                 }
+		// else if( aFieldKind == S( "URL" ) ) {
+		// do not return here
+		// and make URL field text run with hyperlink property later
+		// }
             }
         }
     }
 void DrawingML::WriteRun( Reference< XTextRange > rRun )
 {
     const char* sFieldType;
-    bool bIsField = false;
+    sal_Bool bIsField = sal_False;
     OUString sText = rRun->getString();
 
     if( sText.getLength() < 1)
         return;
 
-    if( ( sFieldType = GetFieldType( rRun ) ) ) {
+    if( ( sFieldType = GetFieldType( rRun, bIsField ) ) ) {
         OStringBuffer sUUID(39);
 
         GetUUID( sUUID );
                               XML_id, sUUID.getStr(),
                               XML_type, sFieldType,
                               FSEND );
-        bIsField = true;
     } else
         mpFS->startElementNS( XML_a, XML_r, FSEND );
 
-    WriteRunProperties( rRun );
+    WriteRunProperties( rRun, bIsField );
 
     mpFS->startElementNS( XML_a, XML_t, FSEND );
     mpFS->writeEscaped( sText );
     mpFS->endElementNS( XML_a, XML_t );
 
-    if( bIsField )
+    if( sFieldType )
         mpFS->endElementNS( XML_a, XML_fld );
     else
         mpFS->endElementNS( XML_a, XML_r );
     return sAlignment;
 }
 
+void DrawingML::WriteLinespacing( LineSpacing& rSpacing )
+{
+    if( rSpacing.Mode == LineSpacingMode::PROP )
+        mpFS->singleElementNS( XML_a, XML_spcPct,
+			       XML_val, I32S( ((sal_Int32)rSpacing.Height)*1000 ),
+			       FSEND );
+    else
+        mpFS->singleElementNS( XML_a, XML_spcPts,
+			       XML_val, I32S( rSpacing.Height ),
+			       FSEND );
+}
+
 void DrawingML::WriteParagraphProperties( Reference< XTextContent > rParagraph )
 {
     Reference< XPropertySet > rXPropSet( rParagraph, UNO_QUERY );
     Reference< XPropertyState > rXPropState( rParagraph, UNO_QUERY );
+    PropertyState eState;
 
     if( !rXPropSet.is() || !rXPropState.is() )
         return;
 
+    //OSL_TRACE("write paragraph properties pset");
+    //DBG(lcl_dump_pset(rXPropSet));
+
     sal_Int16 nLevel = -1;
     GET( nLevel, NumberingLevel );
 
     sal_Int16 nAlignment( style::ParagraphAdjust_LEFT );
     GET( nAlignment, ParaAdjust );
 
+    sal_Bool bHasLinespacing = sal_False;
+    LineSpacing aLineSpacing;
+    if( GETAD( ParaLineSpacing ) )
+	bHasLinespacing = ( mAny >>= aLineSpacing );
+
     if( nLevel != -1
-            || nLeftMargin > 0
-            || nAlignment != style::ParagraphAdjust_LEFT ) {
+	|| nLeftMargin > 0
+	|| nAlignment != style::ParagraphAdjust_LEFT
+	|| bHasLinespacing ) {
         mpFS->startElementNS( XML_a, XML_pPr,
                               XML_lvl, nLevel > 0 ? I32S( nLevel ) : NULL,
                               XML_marL, nLeftMargin > 0 ? IS( nLeftMargin ) : NULL,
                               XML_algn, GetAlignment( nAlignment ),
                               FSEND );
 
+	if( bHasLinespacing ) {
+	    mpFS->startElementNS( XML_a, XML_lnSpc, FSEND );
+	    WriteLinespacing( aLineSpacing );
+	    mpFS->endElementNS( XML_a, XML_lnSpc );
+	}
+
         WriteParagraphNumbering( rXPropSet, nLevel );
 
         mpFS->endElementNS( XML_a, XML_pPr );
             ;
     }
 
+    const char* sWritingMode = NULL;
+    sal_Bool bVertical = sal_False;
+    if( GETA( TextWritingMode ) ) {
+	WritingMode eMode;
+
+	if( ( mAny >>= eMode ) && eMode == WritingMode_TB_RL ) {
+	    sWritingMode = "vert";
+	    bVertical = sal_True;
+	}
+    }
+
     TextHorizontalAdjust eHorizontalAlignment( TextHorizontalAdjust_CENTER );
     bool bHorizontalCenter = false;
     GET( eHorizontalAlignment, TextHorizontalAdjust );
     if( eHorizontalAlignment == TextHorizontalAdjust_CENTER )
         bHorizontalCenter = true;
+    else if( bVertical && eHorizontalAlignment == TextHorizontalAdjust_LEFT )
+	sVerticalAlignment = "b";
 
     sal_Bool bHasWrap = FALSE;
     sal_Bool bWrap = FALSE;
                            XML_bIns, (nBottom != DEFTBINS) ? IS( MM100toEMU( nBottom ) ) : NULL,
                            XML_anchor, sVerticalAlignment,
                            XML_anchorCtr, bHorizontalCenter ? "1" : NULL,
+			   XML_vert, sWritingMode,
                            FSEND );
 
     Reference< XEnumerationAccess > access( xXText, UNO_QUERY );
     mpFS->startElementNS( XML_a, XML_avLst, FSEND );
 
     Sequence< drawing::EnhancedCustomShapeAdjustmentValue > aAdjustmentSeq;
-    if ( rProp.Value >>= aAdjustmentSeq ) {
+    if ( ( rProp.Value >>= aAdjustmentSeq )
+	 && eShapeType != mso_sptActionButtonForwardNext  // we have adjustments values for these type of shape, but MSO doesn't like them
+	 && eShapeType != mso_sptActionButtonBackPrevious // so they are now disabled
+	) {
         DBG(printf("adj seq len: %d\n", int( aAdjustmentSeq.getLength() )));
         if ( bPredefinedHandlesUsed )
             EscherPropertyContainer::LookForPolarHandles( eShapeType, nAdjustmentsWhichNeedsToBeConverted );

File oox/source/export/preset-definitions-to-shape-types.pl

 //   '$src_text'
 // which are part of the OOXML documentation
 
-#include <svx/escherex.hxx>
+#include <filter/msfilter/escherex.hxx>
 
 const char* pShapeTypes[ ESCHER_ShpInst_COUNT ] =
 {

File oox/source/export/shapes.cxx

 #include <rtl/strbuf.hxx>
 #include <sfx2/app.hxx>
 #include <svl/languageoptions.hxx>
-#include <svx/escherex.hxx>
+#include <filter/msfilter/escherex.hxx>
 #include <svx/svdoashp.hxx>
-#include <svx/svxenum.hxx>
+#include <editeng/svxenum.hxx>
 #include <svx/unoapi.hxx>
 
 using namespace ::com::sun::star;
 
     pFS->startElementNS( mnXmlNamespace, XML_blipFill, FSEND );
     
-    WriteBlip( sGraphicURL );
+    WriteBlip( xShapeProps, sGraphicURL );
 
     bool bStretch = false;
     if( ( xShapeProps->getPropertyValue( S( "FillBitmapStretch" ) ) >>= bStretch ) && bStretch )

File oox/source/export/vmlexport.cxx

 };
 
 VMLExport::VMLExport( ::sax_fastparser::FSHelperPtr pSerializer )
-    : EscherEx( *( new SvNullStream ), 0 ),
+    : EscherEx( EscherExGlobalRef( new EscherExGlobal ), *( new SvNullStream ) ),
       m_pSerializer( pSerializer ),
       m_pShapeAttrList( NULL ),
       m_nShapeType( ESCHER_ShpInst_Nil ),
 
 UINT32 VMLExport::EnterGroup( const String& rShapeName, const Rectangle* pRect )
 {
-    UINT32 nShapeId = GetShapeID();
+    UINT32 nShapeId = GenerateShapeId();
 
     OStringBuffer aStyle( 200 );
     FastAttributeList *pAttrList = m_pSerializer->createAttrList();

File oox/source/ppt/pptimport.cxx

 using namespace ::com::sun::star::xml::sax;
 using namespace oox::core;
 
+using ::com::sun::star::beans::PropertyValue;
+using ::com::sun::star::lang::XComponent;
+
 namespace oox { namespace ppt {
 
 OUString SAL_CALL PowerPointImport_getImplementationName() throw()
     return mpActualSlidePersist ? mpActualSlidePersist->getTheme().get() : 0;
 }
 
+sal_Bool SAL_CALL PowerPointImport::filter( const Sequence< PropertyValue >& rDescriptor ) throw( RuntimeException )
+{
+    if( XmlFilterBase::filter( rDescriptor ) )
+        return true;
+
+    if( isExportFilter() ) {
+        Reference< XExporter > xExporter( getGlobalFactory()->createInstance( CREATE_OUSTRING( "com.sun.star.comp.Impress.oox.PowerPointExport" ) ), UNO_QUERY );
+
+        if( xExporter.is() ) {
+            Reference< XComponent > xDocument( getModel(), UNO_QUERY );
+            Reference< XFilter > xFilter( xExporter, UNO_QUERY );
+
+            if( xFilter.is() ) {
+                xExporter->setSourceDocument( xDocument );
+                if( xFilter->filter( rDescriptor ) )
+                    return true;
+            }
+        }
+    }
+
+    return false;
+}
+
 ::oox::vml::Drawing* PowerPointImport::getVmlDrawing()
 {
     return mpActualSlidePersist ? mpActualSlidePersist->getDrawing() : 0;

File oox/util/makefile.mk

     $(SLB)$/table.lib\
     $(SLB)$/shape.lib\
     $(SLB)$/dump.lib\
-    $(SLB)$/docprop.lib
+    $(SLB)$/docprop.lib\
+    $(SLB)$/export.lib
 
 # --- Shared-Library -----------------------------------------------
 
 		$(RTLLIB)		\
 		$(SALLIB)		\
 		$(BASEGFXLIB)	\
-		$(SAXLIB)
+		$(SAXLIB)		\
+        $(VCLLIB)		\
+        $(GOODIESLIB)	\
+        $(SVTOOLLIB)	\
+        $(SVXCORELIB)	\
+        $(MSFILTERLIB)	\
+        $(UNOTOOLSLIB)	\
+        $(TOOLSLIB)		\
+        $(SVLLIB)
+
 
 # link openssl, copied this bit from ucb/source/ucp/webdav/makefile.mk
 .IF "$(GUI)"=="WNT"

File sd/prj/build.lst

-sd      sd      :    filter l10n animations svx stoc canvas NULL
+sd      sd      :    filter l10n animations svx stoc canvas oox NULL
 sd	sd										usr1	-	all	sd_mkout NULL
 sd	sd\inc									nmake		-	all	sd_inc NULL
 sd	sd\prj									get		-	all	sd_prj NULL

File sd/source/filter/eppt/eppt.cxx

 #include <editeng/flditem.hxx>
 #include <sfx2/docinf.hxx>
 
-#define PPT_TRANSITION_TYPE_NONE            0
-#define PPT_TRANSITION_TYPE_RANDOM          1
-#define PPT_TRANSITION_TYPE_BLINDS          2
-#define PPT_TRANSITION_TYPE_CHECKER         3
-#define PPT_TRANSITION_TYPE_COVER           4
-#define PPT_TRANSITION_TYPE_DISSOLVE        5
-#define PPT_TRANSITION_TYPE_FADE            6
-#define PPT_TRANSITION_TYPE_PULL            7
-#define PPT_TRANSITION_TYPE_RANDOM_BARS     8
-#define PPT_TRANSITION_TYPE_STRIPS          9
-#define PPT_TRANSITION_TYPE_WIPE           10
-#define PPT_TRANSITION_TYPE_ZOOM           11
-#define PPT_TRANSITION_TYPE_SPLIT          13
-
-// effects, new in xp
-#define PPT_TRANSITION_TYPE_DIAMOND			17
-#define PPT_TRANSITION_TYPE_PLUS			18
-#define PPT_TRANSITION_TYPE_WEDGE			19
-#define PPT_TRANSITION_TYPE_PUSH			20
-#define PPT_TRANSITION_TYPE_COMB			21
-#define PPT_TRANSITION_TYPE_NEWSFLASH		22
-#define PPT_TRANSITION_TYPE_SMOOTHFADE		23
-#define PPT_TRANSITION_TYPE_WHEEL			26
-#define PPT_TRANSITION_TYPE_CIRCLE			27
-
 using namespace com::sun::star;
 
 static PHLayout pPHLayout[] =

File sd/source/filter/eppt/eppt.hxx

 #include <com/sun/star/text/WritingMode.hpp>
 #include <com/sun/star/lang/Locale.hpp>
 
-enum PageType { NORMAL = 0, MASTER = 1, NOTICE = 2, UNDEFINED = 3 };
+#include <epptbase.hxx>
 
 #define EPP_MAINMASTER_PERSIST_KEY		0x80010000
 #define EPP_MAINNOTESMASTER_PERSIST_KEY	0x80020000
 #define EPP_TEXTSTYLE_BODY				0x00000100
 #define EPP_TEXTSTYLE_TEXT				0x00001000
 
-// PLACEMENT_ID
-#define EPP_LAYOUT_TITLESLIDE             0 /* The slide is a title slide                                                             */
-#define EPP_LAYOUT_TITLEANDBODYSLIDE      1 /* Title and body slide                                                                   */
-#define EPP_LAYOUT_TITLEMASTERSLIDE       2 /* Title master slide                                                                     */
-#define	EPP_LAYOUT_MASTERSLIDE            3 /* Master slide layout                                                                    */
-#define EPP_LAYOUT_MASTERNOTES            4 /* Master notes layout                                                                    */
-#define EPP_LAYOUT_NOTESTITLEBODY         5 /* Notes title/body layout                                                                */
-#define EPP_LAYOUT_HANDOUTLAYOUT          6 /* Handout layout, therefore it doesn't have placeholders except header, footer, and date */
-#define EPP_LAYOUT_ONLYTITLE              7 /* Only title placeholder                                                                 */
-#define EPP_LAYOUT_2COLUMNSANDTITLE       8 /* Body of the slide has 2 columns and a title                                            */
-#define EPP_LAYOUT_2ROWSANDTITLE          9 /* Slide's body has 2 rows and a title                                                    */
-#define EPP_LAYOUT_RIGHTCOLUMN2ROWS      10 /* Body contains 2 columns, right column has 2 rows                                       */
-#define EPP_LAYOUT_LEFTCOLUMN2ROWS       11 /* Body contains 2 columns, left column has 2 rows                                        */
-#define EPP_LAYOUT_BOTTOMROW2COLUMNS     12 /* Body contains 2 rows, bottom row has 2 columns                                         */
-#define EPP_LAYOUT_TOPROW2COLUMN         13 /* Body contains 2 rows, top row has 2 columns                                            */
-#define EPP_LAYOUT_4OBJECTS              14 /* 4 objects                                                                              */
-#define EPP_LAYOUT_BIGOBJECT             15 /* Big object                                                                             */
-#define EPP_LAYOUT_BLANCSLIDE            16 /* Blank slide                                                                            */
-#define EPP_LAYOUT_TITLERIGHTBODYLEFT    17 /* Vertical title on the right, body on the left                                          */
-#define EPP_LAYOUT_TITLERIGHT2BODIESLEFT 18 /* Vertical title on the right, body on the left split into 2 rows                        */
-
-class Polygon;
-class PptEscherEx;
-class XStatusIndicatorRef;
-
-struct PHLayout
-{
-	sal_Int32	nLayout;
-	sal_uInt8	nPlaceHolder[ 8 ];
-
-	sal_uInt8	nUsedObjectPlaceHolder;
-	sal_uInt8	nTypeOfTitle;
-	sal_uInt8	nTypeOfOutliner;
-
-	BOOL	bTitlePossible;
-	BOOL	bOutlinerPossible;
-	BOOL	bSecOutlinerPossible;
-};
-
 struct SOParagraph
 {
 	sal_Bool				bExtendedParameters;
 
 // ------------------------------------------------------------------------
 
-class EscherGraphicProvider;
-class PPTExBulletProvider
-{
-	friend struct PPTExParaSheet;
-
-	protected :
-
-		SvMemoryStream			aBuExPictureStream;
-		SvMemoryStream			aBuExOutlineStream;
-		SvMemoryStream			aBuExMasterStream;
-
-		EscherGraphicProvider*	pGraphicProv;
-
-	public :
-
-		sal_uInt16				GetId( const ByteString& rUniqueId, Size& rGraphicSize );
-
-								PPTExBulletProvider();
-								~PPTExBulletProvider();
-};
-
-struct FontCollectionEntry
-{
-		String					Name;
-        double                  Scaling;
-		sal_Int16				Family;
-		sal_Int16				Pitch;
-		sal_Int16				CharSet;
-    
-        String                  Original;
-        sal_Bool                bIsConverted;
-
-		FontCollectionEntry( const String& rName, sal_Int16 nFamily, sal_Int16 nPitch, sal_Int16 nCharSet ) :
-                            Scaling ( 1.0 ),
-							Family	( nFamily ),
-							Pitch	( nPitch ),
-							CharSet	( nCharSet ),
-                            Original( rName )
-                            {
-                                ImplInit( rName );
-                            };
-
-		FontCollectionEntry( const String& rName ) :
-							Scaling ( 1.0 ),
-                            Original( rName )
-                            {
-                                ImplInit( rName );
-                            };
-        ~FontCollectionEntry();
-
-    private :
-        
-        FontCollectionEntry() {};
-
-        void ImplInit( const String& rName );
-};
-
-class VirtualDevice;
-class FontCollection : private List
-{
-        VirtualDevice* pVDev;
-	public :
-					FontCollection();
-					~FontCollection();
-
-		short		GetScriptDirection( const String& rText ) const;
-		sal_uInt32	GetId( FontCollectionEntry& rFontDescriptor );
-		sal_uInt32	GetCount() const { return List::Count(); };
-		const FontCollectionEntry*						GetById( sal_uInt32 nId );
-		FontCollectionEntry&	GetLast() { return *(FontCollectionEntry*)List::Last(); };
-};
-
-// ------------------------------------------------------------------------
-
-#define PPTEX_STYLESHEETENTRYS	9
-
-enum PPTExTextAttr
-{
-	ParaAttr_BulletOn,
-	ParaAttr_BuHardFont,
-	ParaAttr_BuHardColor,
-	ParaAttr_BuHardHeight,
-	ParaAttr_BulletChar,
-	ParaAttr_BulletFont,
-	ParaAttr_BulletHeight,
-	ParaAttr_BulletColor,
-	ParaAttr_Adjust,
-	ParaAttr_LineFeed,
-	ParaAttr_UpperDist,
-	ParaAttr_LowerDist,
-	ParaAttr_TextOfs,
-	ParaAttr_BulletOfs,
-	ParaAttr_DefaultTab,
-    ParaAttr_AsianLB_1,
-    ParaAttr_AsianLB_2,
-    ParaAttr_AsianLB_3,
-	ParaAttr_BiDi,
-	CharAttr_Bold,
-	CharAttr_Italic,
-	CharAttr_Underline,
-	CharAttr_Shadow,
-	CharAttr_Strikeout,
-	CharAttr_Embossed,
-	CharAttr_Font,
-	CharAttr_AsianOrComplexFont,
-	CharAttr_Symbol,
-	CharAttr_FontHeight,
-	CharAttr_FontColor,
-	CharAttr_Escapement
-};
-
-struct PPTExCharLevel
-{
-	sal_uInt16		mnFlags;
-	sal_uInt16		mnFont;
-	sal_uInt16		mnAsianOrComplexFont;
-	sal_uInt16		mnFontHeight;
-	sal_uInt16		mnEscapement;
-	sal_uInt32		mnFontColor;
-};
-
-struct PPTExCharSheet
-{
-				PPTExCharLevel	maCharLevel[ 5 ];
-
-				PPTExCharSheet( int nInstance );
-
-				void	SetStyleSheet( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > &,
-										FontCollection& rFontCollection, int nLevel );
-				void	Write( SvStream& rSt, PptEscherEx* pEx, sal_uInt16 nLev, sal_Bool bFirst, sal_Bool bSimpleText, 
-                            const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rPagePropSet );
-
-};
-
-struct PPTExParaLevel
-{
-	sal_Bool	    mbIsBullet;
-	sal_uInt16		mnBulletChar;
-	sal_uInt16		mnBulletFont;
-	sal_uInt16		mnBulletHeight;
-	sal_uInt32		mnBulletColor;
-
-	sal_uInt16		mnAdjust;
-	sal_uInt16		mnLineFeed;
-	sal_uInt16		mnUpperDist;
-	sal_uInt16		mnLowerDist;
-	sal_uInt16		mnTextOfs;
-	sal_uInt16		mnBulletOfs;
-	sal_uInt16		mnDefaultTab;
-
-	sal_Bool		mbExtendedBulletsUsed;
-	sal_uInt16		mnBulletId;
-	sal_uInt16		mnBulletStart;
-	sal_uInt32		mnMappedNumType;
-	sal_uInt32		mnNumberingType;
-    sal_uInt16      mnAsianSettings;
-	sal_uInt16		mnBiDi;
-};
-
-struct PPTExParaSheet
-{
-				PPTExBulletProvider& rBuProv;
-
-				sal_uInt32	mnInstance;
-
-				PPTExParaLevel	maParaLevel[ 5 ];
-				PPTExParaSheet( int nInstance, sal_uInt16 nDefaultTab, PPTExBulletProvider& rProv );
-
-				void	SetStyleSheet( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > &,
-										FontCollection& rFontCollection, int nLevel, const PPTExCharLevel& rCharLevel );
-				void	Write( SvStream& rSt, PptEscherEx* pEx, sal_uInt16 nLev, sal_Bool bFirst, sal_Bool bSimpleText,
-                    const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rPagePropSet );
-};
-
-class PPTExStyleSheet
-{
-
-	public :
-
-        	    PPTExCharSheet*		mpCharSheet[ PPTEX_STYLESHEETENTRYS ];
-	            PPTExParaSheet*		mpParaSheet[ PPTEX_STYLESHEETENTRYS ];
-
-				PPTExStyleSheet( sal_uInt16 nDefaultTab, PPTExBulletProvider& rBuProv );
-				~PPTExStyleSheet();
-
-				PPTExParaSheet& GetParaSheet( int nInstance ) { return *mpParaSheet[ nInstance ]; };
-				PPTExCharSheet& GetCharSheet( int nInstance ) { return *mpCharSheet[ nInstance ]; };
-
-				void			SetStyleSheet( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > &,
-												FontCollection& rFontCollection, int nInstance, int nLevel );
-				sal_Bool		IsHardAttribute( sal_uInt32 nInstance, sal_uInt32 nLevel, PPTExTextAttr eAttr, sal_uInt32 nValue );
-
-				sal_uInt32		SizeOfTxCFStyleAtom() const;
-				void			WriteTxCFStyleAtom( SvStream& rSt );
-};
-
-
 struct EPPTHyperlink
 {
 	String		aURL;
 	~TextRuleEntry() { delete pOut; };
 };
 
-// ------------------------------------------------------------------------
-
-struct GroupEntry
-{
-		sal_uInt32					mnCurrentPos;
-		sal_uInt32					mnCount;
-		::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess >			mXIndexAccess;
-								GroupEntry( ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > & rIndex )
-								{
-									mXIndexAccess = rIndex;
-									mnCount =mXIndexAccess->getCount();
-									mnCurrentPos = 0;
-								};
-								GroupEntry( sal_uInt32 nCount )
-								{
-									mnCount = nCount;
-									mnCurrentPos = 0;
-								};
-								~GroupEntry(){};
-};
-
-// ------------------------------------------------------------------------
-
-class GroupTable
-{
-	protected:
-
-		sal_uInt32				mnIndex;
-		sal_uInt32				mnCurrentGroupEntry;
-		sal_uInt32				mnMaxGroupEntry;
-		sal_uInt32				mnGroupsClosed;
-		GroupEntry**			mpGroupEntry;
-
-		void					ImplResizeGroupTable( sal_uInt32 nEntrys );
-
-	public:
-
-		sal_uInt32				GetCurrentGroupIndex() const { return mnIndex; };
-		sal_Int32				GetCurrentGroupLevel() const { return mnCurrentGroupEntry - 1; };	
-		::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > &
-								GetCurrentGroupAccess() const { return mpGroupEntry[  mnCurrentGroupEntry - 1 ]->mXIndexAccess; };
-		sal_uInt32				GetGroupsClosed();
-		void					SkipCurrentGroup();
-		void					ResetGroupTable( sal_uInt32 nCount );
-		void					ClearGroupTable();
-		sal_Bool                EnterGroup( ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > & rIndex );
-		sal_Bool				GetNextGroupEntry();
-								GroupTable();
-								~GroupTable();
-};
-
-class PropValue
-{
-	protected :
-
-		::com::sun::star::uno::Any								mAny;
-
-		::com::sun::star::uno::Reference
-			< ::com::sun::star::beans::XPropertySet	>			mXPropSet;
-
-		sal_Bool	ImplGetPropertyValue( const String& rString );
-		sal_Bool	ImplGetPropertyValue( const ::com::sun::star::uno::Reference
-						< ::com::sun::star::beans::XPropertySet > &, const String& );
-
-	public :
-
-		static sal_Bool GetPropertyValue(
-				::com::sun::star::uno::Any& rAny,
-					const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > &,
-						const String& rPropertyName,
-							sal_Bool bTestPropertyAvailability = sal_False );
-
-		static ::com::sun::star::beans::PropertyState GetPropertyState(
-					const ::com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySet > &,
-						const String& rPropertyName );
-};
-
 class PropStateValue : public PropValue
 {
 	protected :
 
 		sal_uInt16								mnTextAdjust;
 		sal_Int16								mnLineSpacing;
+		sal_Bool								mbFixedLineSpacing;
 		sal_Int16								mnLineSpacingTop;
 		sal_Int16								mnLineSpacingBottom;
         sal_Bool								mbForbiddenRules;

File sd/source/filter/eppt/epptso.cxx

             }
             else
             {
-                if ( pPortion && pPortion->mnCharHeight > (sal_uInt16)( ((double)-nLineSpacing) * 0.001 * 72.0 / 2.54 ) ) // 1/100mm to point
+                if ( !pPara->mbFixedLineSpacing && pPortion && pPortion->mnCharHeight > (sal_uInt16)( ((double)-nLineSpacing) * 0.001 * 72.0 / 2.54 ) ) // 1/100mm to point
                     nLineSpacing = nNormalSpacing;
                 else
                     nLineSpacing = (sal_Int16)( (double)nLineSpacing / 4.40972 );

File sd/source/filter/eppt/makefile.mk

 .ENDIF
 
 SLOFILES =	$(SLO)$/eppt.obj				\
-			$(SLO)$/epptso.obj				\
+			$(SLO)$/epptso.obj			\
 			$(SLO)$/escherex.obj			\
 			$(SLO)$/pptexanimations.obj		\
-			$(SLO)$/pptexsoundcollection.obj
+			$(SLO)$/pptexsoundcollection.obj	\
+			$(SLO)$/pptx-epptbase.obj		\
+			$(SLO)$/pptx-epptooxml.obj
 
 # --- Targets --------------------------------------------------------------
 

File sd/util/makefile.mk

               $(CPPULIB)          \
               $(SALLIB)           \
               $(COMPHELPERLIB)    \
-              $(I18NISOLANGLIB)
+              $(I18NISOLANGLIB)   \
+              $(OOXLIB)           \
+              $(SAXLIB)
 
 # --- Targets -------------------------------------------------------------