[Libreoffice-commits] .: filter/source oox/inc oox/source

Katarina Machalkova bubli at kemper.freedesktop.org
Thu Oct 21 01:24:44 PDT 2010


 filter/source/config/fragments/filters/impress_MS_PowerPoint_2007_XML.xcu          |    2 
 filter/source/config/fragments/filters/impress_MS_PowerPoint_2007_XML_Template.xcu |    2 
 filter/source/config/fragments/types/MS_PowerPoint_2007_XML.xcu                    |    2 
 oox/inc/oox/core/filterbase.hxx                                                    |    5 
 oox/inc/oox/core/xmlfilterbase.hxx                                                 |   29 
 oox/inc/oox/drawingml/chart/converterbase.hxx                                      |    2 
 oox/inc/oox/drawingml/customshapeproperties.hxx                                    |    1 
 oox/inc/oox/drawingml/diagram/diagram.hxx                                          |  242 +++
 oox/inc/oox/drawingml/drawingmltypes.hxx                                           |    3 
 oox/inc/oox/drawingml/graphicshapecontext.hxx                                      |    5 
 oox/inc/oox/drawingml/scene3dcontext.hxx                                           |   56 
 oox/inc/oox/drawingml/shape.hxx                                                    |   29 
 oox/inc/oox/drawingml/shape3dproperties.hxx                                        |  134 -
 oox/inc/oox/drawingml/theme.hxx                                                    |    8 
 oox/inc/oox/export/drawingml.hxx                                                   |   13 
 oox/inc/oox/export/shapes.hxx                                                      |   26 
 oox/inc/oox/ppt/dgmimport.hxx                                                      |   71 -
 oox/inc/oox/ppt/dgmlayout.hxx                                                      |   72 -
 oox/inc/oox/ppt/pptimport.hxx                                                      |    5 
 oox/inc/oox/xls/excelfilter.hxx                                                    |    2 
 oox/inc/oox/xls/workbookhelper.hxx                                                 |    2 
 oox/source/core/facreg.cxx                                                         |    6 
 oox/source/core/filterbase.cxx                                                     |    9 
 oox/source/core/xmlfilterbase.cxx                                                  |  165 --
 oox/source/drawingml/chart/chartspaceconverter.cxx                                 |    5 
 oox/source/drawingml/chart/converterbase.cxx                                       |    4 
 oox/source/drawingml/chart/datasourceconverter.cxx                                 |   13 
 oox/source/drawingml/clrscheme.cxx                                                 |    2 
 oox/source/drawingml/color.cxx                                                     |    1 
 oox/source/drawingml/customshapegeometry.cxx                                       |    6 
 oox/source/drawingml/diagram/constraintlistcontext.cxx                             |  102 -
 oox/source/drawingml/diagram/constraintlistcontext.hxx                             |   54 
 oox/source/drawingml/diagram/datamodelcontext.cxx                                  |  232 ---
 oox/source/drawingml/diagram/datamodelcontext.hxx                                  |   57 
 oox/source/drawingml/diagram/diagram.cxx                                           |  496 +------
 oox/source/drawingml/diagram/diagram.hxx                                           |  323 ----
 oox/source/drawingml/diagram/diagramdefinitioncontext.cxx                          |   13 
 oox/source/drawingml/diagram/diagramdefinitioncontext.hxx                          |    2 
 oox/source/drawingml/diagram/diagramfragmenthandler.cxx                            |  183 --
 oox/source/drawingml/diagram/diagramfragmenthandler.hxx                            |  117 -
 oox/source/drawingml/diagram/diagramlayoutatoms.cxx                                |  689 ----------
 oox/source/drawingml/diagram/diagramlayoutatoms.hxx                                |  318 ----
 oox/source/drawingml/diagram/layoutnodecontext.cxx                                 |  146 --
 oox/source/drawingml/diagram/layoutnodecontext.hxx                                 |    3 
 oox/source/drawingml/diagram/makefile.mk                                           |    1 
 oox/source/drawingml/drawingmltypes.cxx                                            |    4 
 oox/source/drawingml/fillproperties.cxx                                            |    3 
 oox/source/drawingml/graphicshapecontext.cxx                                       |   58 
 oox/source/drawingml/lineproperties.cxx                                            |    5 
 oox/source/drawingml/makefile.mk                                                   |    1 
 oox/source/drawingml/scene3dcontext.cxx                                            |  189 --
 oox/source/drawingml/shape.cxx                                                     |   44 
 oox/source/drawingml/shape3dproperties.cxx                                         |   66 
 oox/source/drawingml/shapepropertiescontext.cxx                                    |    6 
 oox/source/drawingml/textparagraph.cxx                                             |    9 
 oox/source/drawingml/textparagraphproperties.cxx                                   |    1 
 oox/source/export/drawingml.cxx                                                    |  138 --
 oox/source/export/shapes.cxx                                                       |   31 
 oox/source/helper/storagebase.cxx                                                  |   20 
 oox/source/ppt/dgmimport.cxx                                                       |  135 -
 oox/source/ppt/dgmlayout.cxx                                                       |  193 --
 oox/source/ppt/makefile.mk                                                         |    2 
 oox/source/ppt/pptimport.cxx                                                       |   30 
 oox/source/ppt/presentationfragmenthandler.cxx                                     |   13 
 oox/source/ppt/slidepersist.cxx                                                    |   11 
 oox/source/shape/ShapeFilterBase.cxx                                               |    4 
 oox/source/shape/ShapeFilterBase.hxx                                               |    2 
 oox/source/xls/excelfilter.cxx                                                     |    2 
 oox/source/xls/workbookhelper.cxx                                                  |    4 
 69 files changed, 656 insertions(+), 3973 deletions(-)

New commits:
commit 09ffe373368a83098b4cddd0ff22d8b7e1c961df
Author: Katarina Machalkova <kmachalkova at suse.cz>
Date:   Wed Oct 20 18:31:49 2010 +0200

    Undoing pptx filter as a separate lib ( + related changes)
    
    Shared ppt + pptx filter will be merged from cws later

diff --git a/filter/source/config/fragments/filters/impress_MS_PowerPoint_2007_XML.xcu b/filter/source/config/fragments/filters/impress_MS_PowerPoint_2007_XML.xcu
index 138d449..7fdcbd7 100644
--- a/filter/source/config/fragments/filters/impress_MS_PowerPoint_2007_XML.xcu
+++ b/filter/source/config/fragments/filters/impress_MS_PowerPoint_2007_XML.xcu
@@ -1,5 +1,5 @@
 <node oor:name="Impress MS PowerPoint 2007 XML" oor:op="replace">
-    <prop oor:name="Flags"><value>IMPORT EXPORT ALIEN 3RDPARTYFILTER PREFERRED</value></prop>
+    <prop oor:name="Flags"><value>IMPORT ALIEN 3RDPARTYFILTER PREFERRED</value></prop>
     <prop oor:name="UIComponent"/>
     <prop oor:name="FilterService"><value>com.sun.star.comp.Impress.oox.PowerPointImport</value></prop>
     <prop oor:name="UserData"/>
diff --git a/filter/source/config/fragments/filters/impress_MS_PowerPoint_2007_XML_Template.xcu b/filter/source/config/fragments/filters/impress_MS_PowerPoint_2007_XML_Template.xcu
index eb9fea6..28b9ea8 100644
--- a/filter/source/config/fragments/filters/impress_MS_PowerPoint_2007_XML_Template.xcu
+++ b/filter/source/config/fragments/filters/impress_MS_PowerPoint_2007_XML_Template.xcu
@@ -1,5 +1,5 @@
 <node oor:name="Impress MS PowerPoint 2007 XML Template" oor:op="replace">
-    <prop oor:name="Flags"><value>IMPORT EXPORT ALIEN 3RDPARTYFILTER TEMPLATE TEMPLATEPATH PREFERRED</value></prop>
+    <prop oor:name="Flags"><value>IMPORT ALIEN 3RDPARTYFILTER TEMPLATE TEMPLATEPATH PREFERRED</value></prop>
     <prop oor:name="UIComponent"/>
     <prop oor:name="FilterService"><value>com.sun.star.comp.Impress.oox.PowerPointImport</value></prop>
     <prop oor:name="UserData"/>
diff --git a/filter/source/config/fragments/types/MS_PowerPoint_2007_XML.xcu b/filter/source/config/fragments/types/MS_PowerPoint_2007_XML.xcu
index 1cc12bf..99f22ee 100644
--- a/filter/source/config/fragments/types/MS_PowerPoint_2007_XML.xcu
+++ b/filter/source/config/fragments/types/MS_PowerPoint_2007_XML.xcu
@@ -1,7 +1,7 @@
 <node oor:name="MS PowerPoint 2007 XML" oor:op="replace" >
     <prop oor:name="DetectService"><value>com.sun.star.comp.oox.FormatDetector</value></prop>
     <prop oor:name="URLPattern"/>
-    <prop oor:name="Extensions"><value>pptx pptm</value></prop>
+    <prop oor:name="Extensions"><value>pptm pptx</value></prop>
     <prop oor:name="MediaType"/>
     <prop oor:name="Preferred"><value>true</value></prop>
     <prop oor:name="PreferredFilter"><value>Impress MS PowerPoint 2007 XML</value></prop>
diff --git a/oox/inc/oox/core/filterbase.hxx b/oox/inc/oox/core/filterbase.hxx
index 3dc372a..d54c534 100644
--- a/oox/inc/oox/core/filterbase.hxx
+++ b/oox/inc/oox/core/filterbase.hxx
@@ -50,7 +50,6 @@ namespace com { namespace sun { namespace star {
     namespace task { class XStatusIndicator; }
     namespace task { class XInteractionHandler; }
     namespace frame { class XFrame; }
-    namespace drawing { class XShape; }
     namespace io { class XInputStream; }
     namespace io { class XOutputStream; }
     namespace io { class XStream; }
@@ -134,10 +133,6 @@ public:
     const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >&
                         getTargetFrame() const;
 
-    /// Returns the parent shape to load into (if any)
-    const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >&
-                        getParentShape() const;
-
     /** Returns the status indicator (may be null). */
     const ::com::sun::star::uno::Reference< ::com::sun::star::task::XStatusIndicator >&
                         getStatusIndicator() const;
diff --git a/oox/inc/oox/core/xmlfilterbase.hxx b/oox/inc/oox/core/xmlfilterbase.hxx
index a6e260f..4cfccca 100644
--- a/oox/inc/oox/core/xmlfilterbase.hxx
+++ b/oox/inc/oox/core/xmlfilterbase.hxx
@@ -42,10 +42,8 @@
 namespace com { namespace sun { namespace star {
     namespace container { class XNameContainer; }
     namespace document { class XDocumentProperties; }
-    namespace xml { namespace dom { class XDocument; } }
     namespace xml { namespace sax { class XLocator; } }
     namespace xml { namespace sax { class XFastDocumentHandler; } }
-    namespace xml { namespace sax { class XFastSAXSerializable; } }
 } } }
 
 namespace oox { namespace drawingml { class Theme; } }
@@ -91,7 +89,7 @@ public:
 
     /** Has to be implemented by each filter, returns a filter-specific chart
         converter object, that should be global per imported document. */
-    virtual ::oox::drawingml::chart::ChartConverter* getChartConverter() = 0;
+    virtual ::oox::drawingml::chart::ChartConverter& getChartConverter() = 0;
 
     /** Has to be implemented by each filter to return the table style list. */
     virtual const ::oox::drawingml::table::TableStyleListPtr getTableStyles() = 0;
@@ -109,31 +107,6 @@ public:
      */
     bool                importFragment( const ::rtl::Reference< FragmentHandler >& rxHandler );
 
-    /** Imports a fragment into an xml::dom::XDocument.
-
-        @param rFragmentPath path to fragment
-
-        @return a non-empty reference to the XDocument, if the
-        fragment could be imported.
-     */
-    ::com::sun::star::uno::Reference<
-       ::com::sun::star::xml::dom::XDocument> importFragment( const ::rtl::OUString& rFragmentPath );
-
-    /** Imports a fragment from an xml::dom::XDocument using the
-        passed fragment handler
-
-        @param rxHandler fragment handler; path to fragment is
-        ignored, input source is the rxSerializer
-
-        @param rxSerializer usually retrieved from a
-        xml::dom::XDocument, will get serialized into rxHandler
-
-        @return true, if the fragment could be imported.
-     */
-    bool importFragment( const ::rtl::Reference< FragmentHandler >& rxHandler,
-                         const ::com::sun::star::uno::Reference<
-                               ::com::sun::star::xml::sax::XFastSAXSerializable >& rxSerializer );
-
     /** Imports the relations fragment associated with the specified fragment.
 
         @return  The relations collection of the specified fragment.
diff --git a/oox/inc/oox/drawingml/chart/converterbase.hxx b/oox/inc/oox/drawingml/chart/converterbase.hxx
index c1c8986..5c26d73 100644
--- a/oox/inc/oox/drawingml/chart/converterbase.hxx
+++ b/oox/inc/oox/drawingml/chart/converterbase.hxx
@@ -82,7 +82,7 @@ protected:
     /** Returns the filter object of the imported/exported document. */
     ::oox::core::XmlFilterBase& getFilter() const;
     /** Returns the chart converter. */
-    ChartConverter*     getChartConverter() const;
+    ChartConverter&     getChartConverter() const;
     /** Returns the API chart document model. */
     ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartDocument >
                         getChartDocument() const;
diff --git a/oox/inc/oox/drawingml/customshapeproperties.hxx b/oox/inc/oox/drawingml/customshapeproperties.hxx
index 6b63352..d402cb9 100644
--- a/oox/inc/oox/drawingml/customshapeproperties.hxx
+++ b/oox/inc/oox/drawingml/customshapeproperties.hxx
@@ -124,7 +124,6 @@ public:
             const ::com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySet > & xPropSet,
                         const ::com::sun::star::uno::Reference < ::com::sun::star::drawing::XShape > & xShape) const;
 
-    const rtl::OUString& getShapePresetType() const { return maShapePresetType; }
     void setShapePresetType( const rtl::OUString& rShapePresetType ){ maShapePresetType = rShapePresetType; };
 
     std::vector< CustomShapeGuide >&	getAdjustmentGuideList(){ return maAdjustmentGuideList; };
diff --git a/oox/inc/oox/drawingml/diagram/diagram.hxx b/oox/inc/oox/drawingml/diagram/diagram.hxx
index e81a216..ef60545 100644
--- a/oox/inc/oox/drawingml/diagram/diagram.hxx
+++ b/oox/inc/oox/drawingml/diagram/diagram.hxx
@@ -25,40 +25,232 @@
  *
  ************************************************************************/
 
+
+
 #ifndef OOX_DRAWINGML_DIAGRAM_HXX
 #define OOX_DRAWINGML_DIAGRAM_HXX
 
-#include <rtl/ustring.hxx>
+#include <vector>
+#include <boost/shared_ptr.hpp>
+#include <boost/enable_shared_from_this.hpp>
 #include "oox/drawingml/shape.hxx"
-#include "oox/core/xmlfilterbase.hxx"
-
-#include <com/sun/star/xml/dom/XDocument.hpp>
+#include "oox/drawingml/diagram/diagramlayoutatoms.hxx"
 
 namespace oox { namespace drawingml {
 
-/** load diagram data, and put resulting graphic into shape
+namespace dgm {
 
-    This method loads the diagram data fragments from the given paths,
-    generate and layout the shapes, and push it as children into the
-    referenced shape.
+/** A Connection
  */
-void loadDiagram( const ShapePtr& pShape,
-                  core::XmlFilterBase& rFilter,
-                  const ::rtl::OUString& rDataModelPath,
-                  const ::rtl::OUString& rLayoutPath,
-                  const ::rtl::OUString& rQStylePath,
-                  const ::rtl::OUString& rColorStylePath );
-
-void loadDiagram( const ShapePtr& pShape,
-                  core::XmlFilterBase& rFilter,
-                  const ::com::sun::star::uno::Reference<
-                     ::com::sun::star::xml::dom::XDocument>& rXDataModelDom,
-                  const ::com::sun::star::uno::Reference<
-                     ::com::sun::star::xml::dom::XDocument>& rXLayoutDom,
-                  const ::com::sun::star::uno::Reference<
-                     ::com::sun::star::xml::dom::XDocument>& rXQStyleDom,
-                  const ::com::sun::star::uno::Reference<
-                     ::com::sun::star::xml::dom::XDocument>& rXColorStyleDom );
+class Connection
+{
+public:
+    Connection()
+        : mnType( 0 )
+        , mnSourceOrder( 0 )
+        , mnDestOrder( 0 )
+        {
+        }
+
+    void dump();
+
+    sal_Int32 mnType;
+    ::rtl::OUString msModelId;
+    ::rtl::OUString msSourceId;
+    ::rtl::OUString msDestId;
+    ::rtl::OUString msParTransId;
+    ::rtl::OUString msPresId;
+    ::rtl::OUString msSibTransId;
+    sal_Int32 mnSourceOrder;
+    sal_Int32 mnDestOrder;
+
+};
+
+typedef boost::shared_ptr< Connection > ConnectionPtr;
+typedef std::vector< ConnectionPtr > Connections;
+
+class Point;
+
+typedef boost::shared_ptr< Point > PointPtr;
+typedef std::vector< PointPtr >      Points;
+/** A point
+ */
+class Point
+{
+public:
+    Point();
+    ShapePtr & getShape( )
+        { return mpShape; }
+
+    void setCnxId( const ::rtl::OUString & sCnxId )
+        { msCnxId = sCnxId; }
+    void setModelId( const ::rtl::OUString & sModelId );
+    const ::rtl::OUString & getModelId() const
+        { return msModelId; }
+    void setType( const sal_Int32 nType )
+        { mnType = nType; }
+    sal_Int32 getType() const
+        { return mnType; }
+
+    void dump();
+private:
+    ShapePtr        mpShape;
+    ::rtl::OUString msCnxId;
+    ::rtl::OUString msModelId;
+    sal_Int32       mnType;
+};
+
+
+class PointsTree;
+typedef boost::shared_ptr< PointsTree > PointsTreePtr;
+
+/** a points tree node */
+class PointsTree
+    : public boost::enable_shared_from_this< PointsTree >
+{
+public:
+    typedef std::vector< PointsTreePtr > Childrens;
+    PointsTree()
+        {};
+    PointsTree( const PointPtr & pPoint )
+        : mpNode( pPoint )
+        { }
+    bool addChild( const PointsTreePtr & pChild );
+    const PointPtr & getPoint() const
+        { return mpNode; }
+    PointsTreePtr getParent() const;
+    Childrens::const_iterator beginChild() const
+        { return maChildrens.begin(); }
+    Childrens::const_iterator endChild() const
+        { return maChildrens.end(); }
+private:
+    PointPtr                           mpNode;
+    boost::weak_ptr< PointsTree >      mpParent;
+    Childrens       maChildrens;
+};
+
+}
+
+////////////////////
+
+class DiagramData
+{
+public:
+
+    DiagramData();
+    FillPropertiesPtr & getFillProperties()
+        { return mpFillProperties; }
+    dgm::Connections & getConnections()
+        { return maConnections; }
+    dgm::Points & getPoints()
+        { return maPoints; }
+    void dump();
+private:
+    FillPropertiesPtr   mpFillProperties;
+    dgm::Connections    maConnections;
+    dgm::Points         maPoints;
+};
+
+typedef boost::shared_ptr< DiagramData > DiagramDataPtr;
+
+
+
+////////////////////
+
+class DiagramLayout
+{
+public:
+    void setDefStyle( const ::rtl::OUString & sDefStyle )
+        { msDefStyle = sDefStyle; }
+    void setMinVer( const ::rtl::OUString & sMinVer )
+        { msMinVer = sMinVer; }
+    void setUniqueId( const ::rtl::OUString & sUniqueId )
+        { msUniqueId = sUniqueId; }
+    const ::rtl::OUString & getUniqueId()
+        { return msUniqueId; }
+    void setTitle( const ::rtl::OUString & sTitle )
+        { msTitle = sTitle; }
+    void setDesc( const ::rtl::OUString & sDesc )
+        { msDesc = sDesc; }
+
+    LayoutNodePtr & getNode()
+        { return mpNode; }
+    const LayoutNodePtr & getNode() const
+        { return mpNode; }
+    DiagramDataPtr & getSampData()
+        { return mpSampData; }
+    const DiagramDataPtr & getSampData() const
+        { return mpSampData; }
+    DiagramDataPtr & getStyleData()
+        { return mpStyleData; }
+    const DiagramDataPtr & getStyleData() const
+        { return mpStyleData; }
+
+    void layout( const dgm::PointsTreePtr & pTree, const com::sun::star::awt::Point & pt );
+private:
+    ::rtl::OUString msDefStyle;
+    ::rtl::OUString msMinVer;
+    ::rtl::OUString msUniqueId;
+
+    ::rtl::OUString msTitle;
+    ::rtl::OUString msDesc;
+    LayoutNodePtr  mpNode;
+    DiagramDataPtr mpSampData;
+    DiagramDataPtr mpStyleData;
+    // TODO
+    // catLst
+    // clrData
+};
+
+typedef boost::shared_ptr< DiagramLayout > DiagramLayoutPtr;
+
+///////////////////////
+
+class DiagramQStyles
+{
+
+};
+
+typedef boost::shared_ptr< DiagramQStyles > DiagramQStylesPtr;
+
+///////////////////////
+
+class DiagramColors
+{
+
+};
+
+typedef boost::shared_ptr< DiagramColors > DiagramColorsPtr;
+
+///////////////////////
+
+class Diagram
+{
+public:
+    void setData( const DiagramDataPtr & );
+    void setLayout( const DiagramLayoutPtr & );
+    DiagramLayoutPtr getLayout() const
+        {
+            return mpLayout;
+        }
+    void setQStyles( const DiagramQStylesPtr & );
+    void setColors( const DiagramColorsPtr & );
+
+    void addTo( const ShapePtr & pShape );
+    ::rtl::OUString getLayoutId() const;
+private:
+    void build( );
+    DiagramDataPtr    mpData;
+    DiagramLayoutPtr  mpLayout;
+    DiagramQStylesPtr mpQStyles;
+    DiagramColorsPtr  mpColors;
+    std::map< ::rtl::OUString, ShapePtr > maShapeMap;
+    dgm::PointsTreePtr  mpRoot;
+};
+
+
+typedef boost::shared_ptr< Diagram > DiagramPtr;
+
 } }
 
 #endif
diff --git a/oox/inc/oox/drawingml/drawingmltypes.hxx b/oox/inc/oox/drawingml/drawingmltypes.hxx
index b18414f..c513446 100644
--- a/oox/inc/oox/drawingml/drawingmltypes.hxx
+++ b/oox/inc/oox/drawingml/drawingmltypes.hxx
@@ -58,9 +58,6 @@ typedef ::boost::shared_ptr< FillProperties > FillPropertiesPtr;
 struct GraphicProperties;
 typedef ::boost::shared_ptr< GraphicProperties > GraphicPropertiesPtr;
 
-struct Shape3DProperties;
-typedef ::boost::shared_ptr< Shape3DProperties > Shape3DPropertiesPtr;
-
 struct TextCharacterProperties;
 typedef ::boost::shared_ptr< TextCharacterProperties > TextCharacterPropertiesPtr;
 
diff --git a/oox/inc/oox/drawingml/graphicshapecontext.hxx b/oox/inc/oox/drawingml/graphicshapecontext.hxx
index ea49d47..c7239fc 100644
--- a/oox/inc/oox/drawingml/graphicshapecontext.hxx
+++ b/oox/inc/oox/drawingml/graphicshapecontext.hxx
@@ -30,6 +30,7 @@
 
 #include "oox/drawingml/shape.hxx"
 #include "oox/drawingml/shapecontext.hxx"
+#include "oox/drawingml/diagram/diagram.hxx"
 
 namespace oox { namespace vml { struct OleObjectInfo; } }
 
@@ -72,8 +73,6 @@ private:
 
 // ====================================================================
 
-class Diagram;
-
 class DiagramGraphicDataContext
     : public ShapeContext
 {
@@ -83,6 +82,8 @@ public:
     virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 Element, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
 
 private:
+    DiagramPtr loadDiagram();
+
     ::rtl::OUString msDm;
     ::rtl::OUString msLo;
     ::rtl::OUString msQs;
diff --git a/oox/inc/oox/drawingml/scene3dcontext.hxx b/oox/inc/oox/drawingml/scene3dcontext.hxx
deleted file mode 100644
index c64bbf3..0000000
--- a/oox/inc/oox/drawingml/scene3dcontext.hxx
+++ /dev/null
@@ -1,56 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: fillpropertiesgroupcontext.hxx,v $
- * $Revision: 1.6 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org.  If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef OOX_DRAWINGML_SCENE3DPROPERTIESCONTEXT_HPP
-#define OOX_DRAWINGML_SCENE3DPROPERTIESCONTEXT_HPP
-
-#include "oox/core/contexthandler.hxx"
-
-namespace oox { namespace drawingml {
-
-struct Shape3DProperties;
-
-// ---------------------------------------------------------------------
-
-class Scene3DPropertiesContext : public ::oox::core::ContextHandler
-{
-public:
-    Scene3DPropertiesContext( ::oox::core::ContextHandler& rParent, Shape3DProperties& r3DProperties ) throw();
-
-    ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 Element, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs )
-            throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
-
-private:
-    Shape3DProperties& mr3DProperties;
-};
-
-} }
-
-#endif // OOX_DRAWINGML_SCENE3DPROPERTIESCONTEXT_HPP
diff --git a/oox/inc/oox/drawingml/shape.hxx b/oox/inc/oox/drawingml/shape.hxx
index e1ee451..ccfb75f 100644
--- a/oox/inc/oox/drawingml/shape.hxx
+++ b/oox/inc/oox/drawingml/shape.hxx
@@ -32,7 +32,6 @@
 #include "oox/drawingml/drawingmltypes.hxx"
 #include "oox/drawingml/customshapeproperties.hxx"
 #include "oox/drawingml/textliststyle.hxx"
-#include "oox/drawingml/shape3dproperties.hxx"
 
 #include <com/sun/star/frame/XModel.hpp>
 #include <com/sun/star/drawing/XDrawPage.hpp>
@@ -96,8 +95,7 @@ class Shape
 {
 public:
 
-    explicit Shape( const sal_Char* pServiceType = NULL );
-    explicit Shape( const ShapePtr& pSourceShape );
+    Shape( const sal_Char* pServiceType = NULL );
     virtual ~Shape();
 
     rtl::OUString&                  getServiceName(){ return msServiceName; }
@@ -116,20 +114,13 @@ public:
 
     CustomShapePropertiesPtr        getCustomShapeProperties(){ return mpCustomShapePropertiesPtr; }
 
-    Shape3DProperties&              get3DProperties() { return *mp3DPropertiesPtr; }
-    const Shape3DProperties&        get3DProperties() const { return *mp3DPropertiesPtr; }
-
     table::TablePropertiesPtr		getTableProperties();
 
     void                              setChildPosition( com::sun::star::awt::Point nPosition ){ maChPosition = nPosition; }
     void                              setChildSize( com::sun::star::awt::Size aSize ){ maChSize = aSize; }
 
-    void                              setPosition( com::sun::star::awt::Point nPosition ){ maPosition = nPosition; }
-    const com::sun::star::awt::Point& getPosition() const { return maPosition; }
-
-    void                              setSize( com::sun::star::awt::Size aSize ){ maSize = aSize; }
-    const com::sun::star::awt::Size&  getSize() const { return maSize; }
-
+    void                            setPosition( com::sun::star::awt::Point nPosition ){ maPosition = nPosition; }
+    void                            setSize( com::sun::star::awt::Size aSize ){ maSize = aSize; }
     void                            setRotation( sal_Int32 nRotation ) { mnRotation = nRotation; }
     void                            setFlip( sal_Bool bFlipH, sal_Bool bFlipV ) { mbFlipH = bFlipH; mbFlipV = bFlipV; }
     void                            addChild( const ShapePtr pChildPtr ) { maChildren.push_back( pChildPtr ); }
@@ -167,13 +158,6 @@ public:
                             const ::com::sun::star::awt::Rectangle* pShapeRect = 0,
                             ShapeIdMap* pShapeMap = 0 );
 
-    void                addChildren(
-                            const ::oox::core::XmlFilterBase& rFilterBase,
-                            const Theme* pTheme,
-                            const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes,
-                            const ::com::sun::star::awt::Rectangle* pShapeRect = 0,
-                            ShapeIdMap* pShapeMap = 0 );
-
     void				setXShape( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& rXShape )
                             { mxShape = rXShape; };
     const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > &
@@ -213,7 +197,6 @@ protected:
     GraphicPropertiesPtr        mpGraphicPropertiesPtr;
     CustomShapePropertiesPtr    mpCustomShapePropertiesPtr;
     table::TablePropertiesPtr	mpTablePropertiesPtr;
-    Shape3DPropertiesPtr        mp3DPropertiesPtr;
     PropertyMap                 maShapeProperties;
     PropertyMap                 maDefaultShapeProperties;
     TextListStylePtr            mpMasterTextListStyle;
@@ -238,11 +221,7 @@ private:
     sal_Bool						mbHidden;
 };
 
-// ---------------------------------------------------------------------
-
-/** Get custom shape preset string from xml token id
- */
-::rtl::OUString GetShapePresetType( sal_Int32 nType );
+::rtl::OUString GetShapeType( sal_Int32 nType );
 
 } }
 
diff --git a/oox/inc/oox/drawingml/shape3dproperties.hxx b/oox/inc/oox/drawingml/shape3dproperties.hxx
deleted file mode 100644
index 1ebee30..0000000
--- a/oox/inc/oox/drawingml/shape3dproperties.hxx
+++ /dev/null
@@ -1,134 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: fillproperties.hxx,v $
- * $Revision: 1.7 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org.  If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef OOX_DRAWINGML_SHAPE3DPROPERTIES_HXX
-#define OOX_DRAWINGML_SHAPE3DPROPERTIES_HXX
-
-#include <map>
-#include <com/sun/star/graphic/XGraphic.hpp>
-#include <com/sun/star/geometry/IntegerRectangle2D.hpp>
-#include "oox/core/xmlfilterbase.hxx"
-#include "oox/drawingml/color.hxx"
-#include "oox/helper/helper.hxx"
-
-namespace oox { class PropertyMap; }
-namespace oox { class PropertySet; }
-namespace oox { namespace core { class ModelObjectContainer; } }
-
-namespace oox {
-namespace drawingml {
-
-// ============================================================================
-
-struct Shape3DPropertyNames
-{
-    ::rtl::OUString     maFillStyle;
-    ::rtl::OUString     maFillColor;
-    ::rtl::OUString     maFillTransparence;
-    ::rtl::OUString     maFillGradient;
-    ::rtl::OUString     maFillBitmap;
-    ::rtl::OUString     maFillBitmapMode;
-    ::rtl::OUString     maFillBitmapTile;
-    ::rtl::OUString     maFillBitmapStretch;
-    ::rtl::OUString     maFillBitmapLogicalSize;
-    ::rtl::OUString     maFillBitmapSizeX;
-    ::rtl::OUString     maFillBitmapSizeY;
-    ::rtl::OUString     maFillBitmapOffsetX;
-    ::rtl::OUString     maFillBitmapOffsetY;
-    ::rtl::OUString     maFillBitmapRectanglePoint;
-    bool                mbNamedFillGradient;
-    bool                mbNamedFillBitmap;
-    bool                mbTransformGraphic;
-
-    Shape3DPropertyNames();
-};
-
-// ============================================================================
-
-struct Shape3DProperties
-{
-    typedef ::std::map< double, Color > GradientStopMap;
-
-    OptValue< sal_Int32 > moFillType;           /// Fill type (OOXML token).
-    OptValue< bool >    moRotateWithShape;      /// True = rotate gradient/bitmap with shape.
-    Color               maFillColor;            /// Solid fill color and transparence.
-    GradientStopMap     maGradientStops;        /// Gradient stops (colors/transparence).
-    OptValue< sal_Int32 > moGradientPath;       /// If set, gradient follows rectangle, circle, or shape.
-    OptValue< sal_Int32 > moShadeAngle;         /// Rotation angle of linear gradients.
-    OptValue< bool >    moShadeScaled;
-    OptValue< sal_Int32 > moFlipModeToken;
-    OptValue< com::sun::star::geometry::IntegerRectangle2D > moFillToRect;
-    OptValue< com::sun::star::geometry::IntegerRectangle2D > moTileRect;
-    OptValue< sal_Int32 > moPattPreset;         /// Preset pattern type.
-    Color               maPattFgColor;          /// Pattern foreground color.
-    Color               maPattBgColor;          /// Pattern background color.
-    ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > mxGraphic;
-    Color               maColorChangeFrom;      /// Start color of color transformation.
-    Color               maColorChangeTo;        /// Destination color of color transformation.
-    OptValue< sal_Int32 > moBitmapMode;         /// Bitmap tile or stretch.
-    OptValue< sal_Int32 > moTileX;              /// Width of bitmap tiles.
-    OptValue< sal_Int32 > moTileY;              /// Height of bitmap tiles.
-    OptValue< sal_Int32 > moTileSX;
-    OptValue< sal_Int32 > moTileSY;
-    OptValue< sal_Int32 > moTileAlign;          /// Anchor point inside bitmap.
-
-    static Shape3DPropertyNames DEFAULTNAMES;      /// Default fill property names for shape fill.
-    static Shape3DPropertyNames DEFAULTPICNAMES;   /// Default fill property names for pictures.
-
-    /** Overwrites all members that are explicitly set in rSourceProps. */
-    void                assignUsed( const Shape3DProperties& rSourceProps );
-
-    /** Tries to resolve current settings to a solid color, e.g. returns the
-        start color of a gradient. */
-    Color               getBestSolidColor() const;
-
-    /** Writes the properties to the passed property map. */
-    void                pushToPropMap(
-                            PropertyMap& rPropMap,
-                            const Shape3DPropertyNames& rPropNames,
-                            const ::oox::core::XmlFilterBase& rFilter,
-                            ::oox::core::ModelObjectContainer& rObjContainer,
-                            sal_Int32 nShapeRotation, sal_Int32 nPhClr ) const;
-
-    /** Writes the properties to the passed property set. */
-    void                pushToPropSet(
-                            PropertySet& rPropSet,
-                            const Shape3DPropertyNames& rPropNames,
-                            const ::oox::core::XmlFilterBase& rFilter,
-                            ::oox::core::ModelObjectContainer& rObjContainer,
-                            sal_Int32 nShapeRotation, sal_Int32 nPhClr ) const;
-};
-
-// ============================================================================
-
-} // namespace drawingml
-} // namespace oox
-
-#endif
diff --git a/oox/inc/oox/drawingml/theme.hxx b/oox/inc/oox/drawingml/theme.hxx
index 903ff1d..30a6aa1 100644
--- a/oox/inc/oox/drawingml/theme.hxx
+++ b/oox/inc/oox/drawingml/theme.hxx
@@ -32,7 +32,6 @@
 #include "oox/drawingml/clrscheme.hxx"
 #include "oox/drawingml/shape.hxx"
 #include "oox/drawingml/textfont.hxx"
-#include <com/sun/star/xml/dom/XDocument.hpp>
 
 namespace oox {
 namespace drawingml {
@@ -95,11 +94,6 @@ public:
     inline Shape&                   getTxDef() { return maTxDef; }
     inline const Shape&             getTxDef() const { return maTxDef; }
 
-    void                            setFragment( const ::com::sun::star::uno::Reference<
-                                                    ::com::sun::star::xml::dom::XDocument>& xRef ) { mxFragment=xRef; }
-    const ::com::sun::star::uno::Reference<
-        ::com::sun::star::xml::dom::XDocument>& getFragment() const { return mxFragment; }
-
 private:
     ::rtl::OUString     maStyleName;
     ClrScheme           maClrScheme;
@@ -111,8 +105,6 @@ private:
     Shape               maSpDef;
     Shape               maLnDef;
     Shape               maTxDef;
-    ::com::sun::star::uno::Reference<
-        ::com::sun::star::xml::dom::XDocument> mxFragment;
 };
 
 // ============================================================================
diff --git a/oox/inc/oox/export/drawingml.hxx b/oox/inc/oox/export/drawingml.hxx
index 10397a5..5d19c42 100644
--- a/oox/inc/oox/export/drawingml.hxx
+++ b/oox/inc/oox/export/drawingml.hxx
@@ -20,9 +20,6 @@ namespace beans {
 namespace drawing {
     class XShape;
 }
-namespace style {
-    struct LineSpacing;
-}
 namespace text {
     class XTextContent;
     class XTextRange;
@@ -41,6 +38,9 @@ public:
     enum DocumentType { DOCUMENT_DOCX, DOCUMENT_PPTX, DOCUMENT_XLSX };
 
 private:
+    ::sax_fastparser::FSHelperPtr mpFS;
+    ::oox::core::XmlFilterBase* mpFB;
+
     static int mnImageCounter;
 
     /// To specify where write eg. the images to (like 'ppt', or 'word' - according to the OPC).
@@ -48,8 +48,6 @@ private:
 
 protected:
     ::com::sun::star::uno::Any mAny;
-    ::sax_fastparser::FSHelperPtr mpFS;
-    ::oox::core::XmlFilterBase* mpFB;
 
     bool GetProperty( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > rXPropSet, String aName );
     bool GetPropertyAndState( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > rXPropSet,
@@ -60,7 +58,7 @@ protected:
     rtl::OUString WriteImage( const rtl::OUString& rURL );
 
 public:
-    DrawingML( ::sax_fastparser::FSHelperPtr pFS, ::oox::core::XmlFilterBase* pFB = NULL, DocumentType eDocumentType = DOCUMENT_PPTX ) : meDocumentType( eDocumentType ), mpFS( pFS ), mpFB( pFB ) {}
+    DrawingML( ::sax_fastparser::FSHelperPtr pFS, ::oox::core::XmlFilterBase* pFB = NULL, DocumentType eDocumentType = DOCUMENT_PPTX ) : mpFS( pFS ), mpFB( pFB ), meDocumentType( eDocumentType ) {}
     void SetFS( ::sax_fastparser::FSHelperPtr pFS ) { mpFS = pFS; }
     ::sax_fastparser::FSHelperPtr GetFS() { return mpFS; }
     ::oox::core::XmlFilterBase* GetFB() { return mpFB; }
@@ -79,9 +77,8 @@ public:
     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( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > rXPropSet, ::rtl::OUString& rURL );
+    ::rtl::OUString WriteBlip( ::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,
diff --git a/oox/inc/oox/export/shapes.hxx b/oox/inc/oox/export/shapes.hxx
index 74d9a54..47f50d7 100644
--- a/oox/inc/oox/export/shapes.hxx
+++ b/oox/inc/oox/export/shapes.hxx
@@ -48,8 +48,14 @@ namespace drawing {
 namespace oox { namespace drawingml {
 
 class OOX_DLLPUBLIC ShapeExport : public DrawingML {
-
 private:
+    sal_Int32           mnXmlNamespace;
+    sal_Int32           mnShapeIdMax, mnPictureIdMax;
+    Fraction            maFraction;
+    MapMode             maMapModeSrc, maMapModeDest;
+
+    ::com::sun::star::awt::Size MapSize( const ::com::sun::star::awt::Size& ) const;
+
     struct ShapeCheck
     {
         bool operator()( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape> s1, const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape> s2 ) const
@@ -65,25 +71,11 @@ private:
         size_t operator()( const ::com::sun::star::uno::Reference < ::com::sun::star::drawing::XShape > ) const;
     };
 
-public:
     typedef std::hash_map< const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape>, sal_Int32, ShapeHash, ShapeCheck> ShapeHashMap;
-
-protected:
-    sal_Int32           mnShapeIdMax, mnPictureIdMax;
-
-private:
-    sal_Int32           mnXmlNamespace;
-    Fraction            maFraction;
-    MapMode             maMapModeSrc, maMapModeDest;
-
-    ::com::sun::star::awt::Size MapSize( const ::com::sun::star::awt::Size& ) const;
-
     ShapeHashMap maShapeMap;
-    ShapeHashMap* mpShapeMap;
 
 public:
-
-    ShapeExport( sal_Int32 nXmlNamespace, ::sax_fastparser::FSHelperPtr pFS, ShapeHashMap* pShapeMap = NULL, ::oox::core::XmlFilterBase* pFB = NULL, DocumentType eDocumentType = DOCUMENT_PPTX );
+    ShapeExport( sal_Int32 nXmlNamespace, ::sax_fastparser::FSHelperPtr pFS, ::oox::core::XmlFilterBase* pFB = NULL, DocumentType eDocumentType = DOCUMENT_PPTX );
     virtual ~ShapeExport() {}
 
     sal_Int32           GetXmlNamespace() const;
@@ -162,9 +154,7 @@ public:
                         WriteUnknownShape( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape );
 
     sal_Int32 GetNewShapeID( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > rShape );
-    sal_Int32 GetNewShapeID( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > rShape, ::oox::core::XmlFilterBase* pFB );
     sal_Int32 GetShapeID( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > rShape );
-    static sal_Int32 GetShapeID( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > rShape, ShapeHashMap* pShapeMap );
 };
 
 }}
diff --git a/oox/inc/oox/ppt/dgmimport.hxx b/oox/inc/oox/ppt/dgmimport.hxx
deleted file mode 100644
index 955b1fa..0000000
--- a/oox/inc/oox/ppt/dgmimport.hxx
+++ /dev/null
@@ -1,71 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: pptimport.hxx,v $
- * $Revision: 1.6 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org.  If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef OOX_POWERPOINT_QUICKDIAGRAMMINGIMPORT_HXX
-#define OOX_POWERPOINT_QUICKDIAGRAMMINGIMPORT_HXX
-
-#include "oox/core/xmlfilterbase.hxx"
-
-#include <com/sun/star/animations/XAnimationNode.hpp>
-#include <oox/drawingml/theme.hxx>
-#include "oox/ppt/presentationfragmenthandler.hxx"
-#include "oox/ppt/slidepersist.hxx"
-#include "tokens.hxx"
-#include <vector>
-#include <map>
-
-namespace oox { namespace ppt {
-
-// ---------------------------------------------------------------------
-
-class QuickDiagrammingImport : public oox::core::XmlFilterBase
-{
-public:
-
-    QuickDiagrammingImport( const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > & rSMgr  );
-
-    // from FilterBase
-    virtual bool importDocument() throw();
-    virtual bool exportDocument() throw();
-
-    virtual const ::oox::drawingml::Theme* getCurrentTheme() const;
-    virtual sal_Int32 getSchemeClr( sal_Int32 nColorSchemeToken ) const;
-    virtual const oox::drawingml::table::TableStyleListPtr getTableStyles();
-
-    virtual oox::vml::Drawing* getVmlDrawing();
-    virtual oox::drawingml::chart::ChartConverter* getChartConverter();
-
-private:
-    virtual ::rtl::OUString implGetImplementationName() const;
-};
-
-} }
-
-#endif // OOX_POWERPOINT_QUICKDIAGRAMMINGIMPORT_HXX
diff --git a/oox/inc/oox/ppt/dgmlayout.hxx b/oox/inc/oox/ppt/dgmlayout.hxx
deleted file mode 100644
index 8e3847b..0000000
--- a/oox/inc/oox/ppt/dgmlayout.hxx
+++ /dev/null
@@ -1,72 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: pptimport.hxx,v $
- * $Revision: 1.6 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org.  If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef OOX_POWERPOINT_QUICKDIAGRAMMINGLAYOUT_HXX
-#define OOX_POWERPOINT_QUICKDIAGRAMMINGLAYOUT_HXX
-
-#include "oox/core/xmlfilterbase.hxx"
-
-#include <com/sun/star/animations/XAnimationNode.hpp>
-#include <oox/drawingml/theme.hxx>
-#include "oox/ppt/presentationfragmenthandler.hxx"
-#include "oox/ppt/slidepersist.hxx"
-#include "tokens.hxx"
-#include <vector>
-#include <map>
-
-namespace oox { namespace ppt {
-
-// ---------------------------------------------------------------------
-
-class QuickDiagrammingLayout : public oox::core::XmlFilterBase
-{
-public:
-
-    QuickDiagrammingLayout( const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > & rSMgr  );
-
-    // from FilterBase
-    virtual bool importDocument() throw();
-    virtual bool exportDocument() throw();
-
-    virtual const ::oox::drawingml::Theme* getCurrentTheme() const;
-    virtual sal_Int32 getSchemeClr( sal_Int32 nColorSchemeToken ) const;
-    virtual const oox::drawingml::table::TableStyleListPtr getTableStyles();
-
-    virtual ::oox::vml::Drawing* getVmlDrawing();
-    virtual ::oox::drawingml::chart::ChartConverter* getChartConverter();
-
-private:
-    virtual ::rtl::OUString implGetImplementationName() const;
-    drawingml::ThemePtr mpThemePtr;
-};
-
-} }
-
-#endif // OOX_POWERPOINT_QUICKDIAGRAMMINGLAYOUT_HXX
diff --git a/oox/inc/oox/ppt/pptimport.hxx b/oox/inc/oox/ppt/pptimport.hxx
index dadfa1e..31ea885 100644
--- a/oox/inc/oox/ppt/pptimport.hxx
+++ b/oox/inc/oox/ppt/pptimport.hxx
@@ -56,7 +56,7 @@ public:
     virtual const ::oox::drawingml::Theme* getCurrentTheme() const;
     virtual ::oox::vml::Drawing* getVmlDrawing();
     virtual const oox::drawingml::table::TableStyleListPtr getTableStyles();
-    virtual ::oox::drawingml::chart::ChartConverter* getChartConverter();
+    virtual ::oox::drawingml::chart::ChartConverter& getChartConverter();
 
     void													setActualSlidePersist( SlidePersistPtr pActualSlidePersist ){ mpActualSlidePersist = pActualSlidePersist; };
     std::map< rtl::OUString, oox::drawingml::ThemePtr >&	getThemes(){ return maThemes; };
@@ -66,9 +66,6 @@ public:
 
     sal_Int32 getSchemeColor( sal_Int32 nToken ) const;
 
-    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 GraphicHelper* implCreateGraphicHelper() const;
     virtual ::rtl::OUString implGetImplementationName() const;
diff --git a/oox/inc/oox/xls/excelfilter.hxx b/oox/inc/oox/xls/excelfilter.hxx
index 3f72d7a..49a0c85 100644
--- a/oox/inc/oox/xls/excelfilter.hxx
+++ b/oox/inc/oox/xls/excelfilter.hxx
@@ -68,7 +68,7 @@ public:
     virtual const ::oox::drawingml::Theme* getCurrentTheme() const;
     virtual ::oox::vml::Drawing* getVmlDrawing();
     virtual const ::oox::drawingml::table::TableStyleListPtr getTableStyles();
-    virtual ::oox::drawingml::chart::ChartConverter* getChartConverter();
+    virtual ::oox::drawingml::chart::ChartConverter& getChartConverter();
 
     virtual sal_Bool SAL_CALL filter( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rDescriptor ) throw( ::com::sun::star::uno::RuntimeException );
 
diff --git a/oox/inc/oox/xls/workbookhelper.hxx b/oox/inc/oox/xls/workbookhelper.hxx
index 65d89a2..99857ea 100644
--- a/oox/inc/oox/xls/workbookhelper.hxx
+++ b/oox/inc/oox/xls/workbookhelper.hxx
@@ -253,7 +253,7 @@ public:
     /** Returns the converter for string to cell address/range conversion. */
     AddressConverter&   getAddressConverter() const;
     /** Returns the chart object converter. */
-    ExcelChartConverter* getChartConverter() const;
+    ExcelChartConverter& getChartConverter() const;
     /** Returns the page and print settings converter. */
     PageSettingsConverter& getPageSettingsConverter() const;
 
diff --git a/oox/source/core/facreg.cxx b/oox/source/core/facreg.cxx
index c54eb39..7233692 100644
--- a/oox/source/core/facreg.cxx
+++ b/oox/source/core/facreg.cxx
@@ -58,8 +58,6 @@ extern uno::Reference< uno::XInterface > SAL_CALL className##_createInstance(
 namespace oox {
     namespace core { SERVICE( FilterDetect ); }
     namespace ppt { SERVICE( PowerPointImport ); }
-    namespace ppt { SERVICE( QuickDiagrammingImport ); }
-    namespace ppt { SERVICE( QuickDiagrammingLayout ); }
     namespace xls { SERVICE( BiffDetector ); }
     namespace xls { SERVICE( ExcelFilter ); }
     namespace xls { SERVICE( ExcelBiffFilter ); }
@@ -103,8 +101,6 @@ OOX_DLLPUBLIC sal_Bool SAL_CALL component_writeInfo( void * , void * pRegistryKe
 
             WRITEINFO( ::oox::core::FilterDetect );
             WRITEINFO( ::oox::ppt::PowerPointImport );
-            WRITEINFO( ::oox::ppt::QuickDiagrammingImport );
-            WRITEINFO( ::oox::ppt::QuickDiagrammingLayout );
             WRITEINFO( ::oox::xls::BiffDetector );
             WRITEINFO( ::oox::xls::ExcelFilter );
             WRITEINFO( ::oox::xls::ExcelBiffFilter );
@@ -153,8 +149,6 @@ OOX_DLLPUBLIC void * SAL_CALL component_getFactory( const sal_Char * pImplName,
 
         SINGLEFACTORY( ::oox::core::FilterDetect )
         else SINGLEFACTORY( oox::ppt::PowerPointImport )
-        else SINGLEFACTORY( oox::ppt::QuickDiagrammingImport )
-        else SINGLEFACTORY( oox::ppt::QuickDiagrammingLayout )
         else SINGLEFACTORY( ::oox::xls::BiffDetector )
         else SINGLEFACTORY( ::oox::xls::ExcelFilter )
         else SINGLEFACTORY( ::oox::xls::ExcelBiffFilter )
diff --git a/oox/source/core/filterbase.cxx b/oox/source/core/filterbase.cxx
index 8b44236..6890ad4 100644
--- a/oox/source/core/filterbase.cxx
+++ b/oox/source/core/filterbase.cxx
@@ -32,7 +32,6 @@
 #include <com/sun/star/frame/XModel.hpp>
 #include <com/sun/star/task/XStatusIndicator.hpp>
 #include <com/sun/star/task/XInteractionHandler.hpp>
-#include <com/sun/star/drawing/XShape.hpp>
 #include <osl/mutex.hxx>
 #include <rtl/instance.hxx>
 #include <rtl/uri.hxx>
@@ -64,7 +63,6 @@ using ::com::sun::star::io::XInputStream;
 using ::com::sun::star::io::XOutputStream;
 using ::com::sun::star::io::XStream;
 using ::com::sun::star::task::XStatusIndicator;
-using ::com::sun::star::drawing::XShape;
 using ::com::sun::star::task::XInteractionHandler;
 using ::com::sun::star::graphic::XGraphic;
 using ::com::sun::star::container::XNameAccess;
@@ -165,7 +163,6 @@ struct FilterBaseImpl
     Reference< XStream >                mxOutStream;
     Reference< XStatusIndicator >       mxStatusIndicator;
     Reference< XInteractionHandler >    mxInteractionHandler;
-    Reference< XShape >                 mxParentShape;
 
     explicit            FilterBaseImpl( const Reference< XMultiServiceFactory >& rxGlobalFactory );
 
@@ -277,11 +274,6 @@ const Reference< XFrame >& FilterBase::getTargetFrame() const
     return mxImpl->mxTargetFrame;
 }
 
-const Reference< XShape >& FilterBase::getParentShape() const
-{
-    return mxImpl->mxParentShape;
-}
-
 const Reference< XStatusIndicator >& FilterBase::getStatusIndicator() const
 {
     return mxImpl->mxStatusIndicator;
@@ -576,7 +568,6 @@ void FilterBase::setMediaDescriptor( const Sequence< PropertyValue >& rMediaDesc
     mxImpl->mxTargetFrame = mxImpl->maMediaDesc.getUnpackedValueOrDefault( MediaDescriptor::PROP_FRAME(), Reference< XFrame >() );
     mxImpl->mxStatusIndicator = mxImpl->maMediaDesc.getUnpackedValueOrDefault( MediaDescriptor::PROP_STATUSINDICATOR(), Reference< XStatusIndicator >() );
     mxImpl->mxInteractionHandler = mxImpl->maMediaDesc.getUnpackedValueOrDefault( MediaDescriptor::PROP_INTERACTIONHANDLER(), Reference< XInteractionHandler >() );
-    mxImpl->mxParentShape = mxImpl->maMediaDesc.getUnpackedValueOrDefault( CREATE_OUSTRING( "ParentShape" ), mxImpl->mxParentShape );
 
     // Check for ISO OOXML
     OUString sFilterName = mxImpl->maMediaDesc.getUnpackedValueOrDefault( CREATE_OUSTRING( "FilterName" ), OUString() );
diff --git a/oox/source/core/xmlfilterbase.cxx b/oox/source/core/xmlfilterbase.cxx
index 673acfe..37e26f4 100644
--- a/oox/source/core/xmlfilterbase.cxx
+++ b/oox/source/core/xmlfilterbase.cxx
@@ -32,14 +32,10 @@
 
 #include <rtl/strbuf.hxx>
 #include <rtl/ustrbuf.hxx>
-#include <rtl/instance.hxx>
 #include <com/sun/star/container/XNameContainer.hpp>
 #include <com/sun/star/embed/XRelationshipAccess.hpp>
-#include <com/sun/star/xml/dom/XDocument.hpp>
-#include <com/sun/star/xml/dom/XDocumentBuilder.hpp>
 #include <com/sun/star/xml/sax/InputSource.hpp>
 #include <com/sun/star/xml/sax/XFastParser.hpp>
-#include <com/sun/star/xml/sax/XFastSAXSerializable.hpp>
 #include <com/sun/star/document/XDocumentProperties.hpp>
 #include <comphelper/mediadescriptor.hxx>
 #include <sax/fshelper.hxx>
@@ -59,7 +55,6 @@ using ::rtl::OStringBuffer;
 using ::rtl::OUString;
 using ::rtl::OUStringBuffer;
 using ::com::sun::star::beans::StringPair;
-using ::com::sun::star::beans::Pair;
 using ::com::sun::star::uno::Reference;
 using ::com::sun::star::uno::Sequence;
 using ::com::sun::star::uno::Exception;
@@ -80,14 +75,11 @@ using ::com::sun::star::xml::sax::XFastTokenHandler;
 using ::com::sun::star::xml::sax::XFastDocumentHandler;
 using ::com::sun::star::xml::sax::InputSource;
 using ::com::sun::star::xml::sax::SAXException;
-using ::com::sun::star::xml::dom::XDocument;
-using ::com::sun::star::xml::dom::XDocumentBuilder;
 using ::com::sun::star::document::XDocumentProperties;
 using ::com::sun::star::util::DateTime;
 using ::comphelper::MediaDescriptor;
 using ::sax_fastparser::FastSerializerHelper;
 using ::sax_fastparser::FSHelperPtr;
-using namespace ::com::sun::star;
 
 
 #include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
@@ -127,8 +119,6 @@ struct XmlFilterBaseImpl
     typedef RefMap< OUString, Relations > RelationsMap;
 
     Reference< XFastParser > mxFastParser;
-    Reference< XFastTokenHandler >
-                        mxTokenHandler;
     OUString            maBinSuffix;
     OUString            maVmlSuffix;
     RelationsMap        maRelationsMap;
@@ -162,66 +152,6 @@ static Reference< XComponentContext > lcl_getComponentContext(Reference< XMultiS
 
 // ============================================================================
 
-namespace
-{
-    struct NamespaceIds: public rtl::StaticWithInit<
-        Sequence< Pair< OUString, sal_Int32 > >,
-        NamespaceIds>
-    {
-        Sequence< Pair< OUString, sal_Int32 > > operator()()
-        {
-            static const char* const namespaceURIs[] = {
-                "http://www.w3.org/XML/1998/namespace",
-                "http://schemas.openxmlformats.org/package/2006/relationships",
-                "http://schemas.openxmlformats.org/officeDocument/2006/relationships",
-                "http://schemas.openxmlformats.org/drawingml/2006/main",
-                "http://schemas.openxmlformats.org/drawingml/2006/diagram",
-                "http://schemas.openxmlformats.org/drawingml/2006/chart",
-                "http://schemas.openxmlformats.org/drawingml/2006/chartDrawing",
-                "urn:schemas-microsoft-com:vml",
-                "urn:schemas-microsoft-com:office:office",
-                "urn:schemas-microsoft-com:office:word",
-                "urn:schemas-microsoft-com:office:excel",
-                "urn:schemas-microsoft-com:office:powerpoint",
-                "http://schemas.microsoft.com/office/2006/activeX",
-                "http://schemas.openxmlformats.org/spreadsheetml/2006/main",
-                "http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing",
-                "http://schemas.microsoft.com/office/excel/2006/main",
-                "http://schemas.openxmlformats.org/presentationml/2006/main"
-            };
-
-            static const sal_Int32 namespaceIds[] = {
-                NMSP_XML,
-                NMSP_PACKAGE_RELATIONSHIPS,
-                NMSP_RELATIONSHIPS,
-                NMSP_DRAWINGML,
-                NMSP_DIAGRAM,
-                NMSP_CHART,
-                NMSP_CDR,
-                NMSP_VML,
-                NMSP_OFFICE,
-                NMSP_VML_DOC,
-                NMSP_VML_XLS,
-                NMSP_VML_PPT,
-                NMSP_AX,
-                NMSP_XLS,
-                NMSP_XDR,
-                NMSP_XM,
-                NMSP_PPT
-            };
-
-            Sequence< Pair< OUString, sal_Int32 > > aRet(STATIC_ARRAY_SIZE(namespaceIds));
-            for( sal_Int32 i=0; i<aRet.getLength(); ++i )
-                aRet[i] = beans::make_Pair(
-                    ::rtl::OUString::createFromAscii(namespaceURIs[i]),
-                    namespaceIds[i]);
-            return aRet;
-        }
-    };
-}
-
-// ============================================================================
-
 XmlFilterBase::XmlFilterBase( const Reference< XMultiServiceFactory >& rxGlobalFactory ) :
     FilterBase( rxGlobalFactory ),
     mxImpl( new XmlFilterBaseImpl ),
@@ -230,18 +160,32 @@ XmlFilterBase::XmlFilterBase( const Reference< XMultiServiceFactory >& rxGlobalF
 {
     try
     {
-        // create the fast tokenhandler
-        mxImpl->mxTokenHandler.set( new FastTokenHandler );
-
         // create the fast parser
         mxImpl->mxFastParser.set( rxGlobalFactory->createInstance( CREATE_OUSTRING( "com.sun.star.xml.sax.FastParser" ) ), UNO_QUERY_THROW );
-        mxImpl->mxFastParser->setTokenHandler( mxImpl->mxTokenHandler );
+        mxImpl->mxFastParser->setTokenHandler( new FastTokenHandler );
 
         // register XML namespaces
-        const Sequence< Pair< OUString, sal_Int32 > > ids=
-            NamespaceIds::get();
-        for( sal_Int32 i=0; i<ids.getLength(); ++i )
-            mxImpl->mxFastParser->registerNamespace( ids[i].First, ids[i].Second );
+        mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "http://www.w3.org/XML/1998/namespace" ), NMSP_XML );
+        mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "http://schemas.openxmlformats.org/package/2006/relationships" ), NMSP_PACKAGE_RELATIONSHIPS );
+        mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "http://schemas.openxmlformats.org/officeDocument/2006/relationships" ), NMSP_RELATIONSHIPS );
+
+        mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "http://schemas.openxmlformats.org/drawingml/2006/main" ), NMSP_DRAWINGML );
+        mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "http://schemas.openxmlformats.org/drawingml/2006/diagram" ), NMSP_DIAGRAM );
+        mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "http://schemas.openxmlformats.org/drawingml/2006/chart" ), NMSP_CHART );
+        mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "http://schemas.openxmlformats.org/drawingml/2006/chartDrawing" ), NMSP_CDR );
+
+        mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "urn:schemas-microsoft-com:vml" ), NMSP_VML );
+        mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "urn:schemas-microsoft-com:office:office" ), NMSP_OFFICE );
+        mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "urn:schemas-microsoft-com:office:word" ), NMSP_VML_DOC );
+        mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "urn:schemas-microsoft-com:office:excel" ), NMSP_VML_XLS );
+        mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "urn:schemas-microsoft-com:office:powerpoint" ), NMSP_VML_PPT );
+        mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "http://schemas.microsoft.com/office/2006/activeX" ), NMSP_AX );
+
+        mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "http://schemas.openxmlformats.org/spreadsheetml/2006/main"), NMSP_XLS );
+        mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing" ), NMSP_XDR );
+        mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "http://schemas.microsoft.com/office/excel/2006/main" ), NMSP_XM );
+
+        mxImpl->mxFastParser->registerNamespace( CREATE_OUSTRING( "http://schemas.openxmlformats.org/presentationml/2006/main"), NMSP_PPT );
     }
     catch( Exception& )
     {
@@ -354,66 +298,6 @@ bool XmlFilterBase::importFragment( const ::rtl::Reference< FragmentHandler >& r
     return false;
 }
 
-Reference<XDocument> XmlFilterBase::importFragment( const ::rtl::OUString& aFragmentPath )
-{
-    Reference<XDocument> xRet;
-
-    // path to fragment stream valid?
-    OSL_ENSURE( aFragmentPath.getLength() > 0, "XmlFilterBase::importFragment - empty fragment path" );
-    if( aFragmentPath.getLength() == 0 )
-        return xRet;
-
-    // try to open the fragment stream (this may fail - do not assert)
-    Reference< XInputStream > xInStrm = openInputStream( aFragmentPath );
-    if( !xInStrm.is() )
-        return xRet;
-
-    // binary streams (fragment extension is '.bin') currently not supported
-    sal_Int32 nBinSuffixPos = aFragmentPath.getLength() - mxImpl->maBinSuffix.getLength();
-    if( (nBinSuffixPos >= 0) && aFragmentPath.match( mxImpl->maBinSuffix, nBinSuffixPos ) )
-        return xRet;
-
-    // try to import XML stream
-    try
-    {
-        // create the dom parser
-        Reference<XDocumentBuilder> xDomBuilder(
-            getGlobalFactory()->createInstance(
-                CREATE_OUSTRING( "com.sun.star.xml.dom.DocumentBuilder" ) ),
-            UNO_QUERY_THROW );
-
-        // create DOM from fragment
-        xRet = xDomBuilder->parse(xInStrm);
-    }
-    catch( Exception& )
-    {
-    }
-
-    return xRet;
-}
-
-bool XmlFilterBase::importFragment( const ::rtl::Reference< FragmentHandler >& rxHandler,
-                                    const Reference< xml::sax::XFastSAXSerializable >& rxSerializer )
-{
-    Reference< XFastDocumentHandler > xDocHandler( rxHandler.get() );
-    if( !xDocHandler.is() )
-        return false;
-
-    // try to import XML stream
-    try
-    {
-        rxSerializer->fastSerialize( xDocHandler,
-                                     mxImpl->mxTokenHandler,
-                                     uno::Sequence< beans::StringPair >(),
-                                     NamespaceIds::get() );
-        return true;
-    }
-    catch( Exception& )
-    {}
-
-    return false;
-}
-
 RelationsRef XmlFilterBase::importRelations( const OUString& rFragmentPath )
 {
     // try to find cached relations
@@ -681,11 +565,6 @@ XmlFilterBase& XmlFilterBase::exportDocumentProperties( Reference< XDocumentProp
     return *this;
 }
 
-::oox::drawingml::chart::ChartConverter* XmlFilterBase::getChartConverter()
-{
-    return 0;
-}
-
 // protected ------------------------------------------------------------------
 
 Reference< XInputStream > XmlFilterBase::implGetInputStream( MediaDescriptor& rMediaDesc ) const
diff --git a/oox/source/drawingml/chart/chartspaceconverter.cxx b/oox/source/drawingml/chart/chartspaceconverter.cxx
index 50a92dc..175bfc0 100644
--- a/oox/source/drawingml/chart/chartspaceconverter.cxx
+++ b/oox/source/drawingml/chart/chartspaceconverter.cxx
@@ -71,12 +71,9 @@ ChartSpaceConverter::~ChartSpaceConverter()
 
 void ChartSpaceConverter::convertFromModel( const Reference< XShapes >& rxExternalPage, const Point& rChartPos )
 {
-    if( !getChartConverter() )
-        return;
-
     /*  create data provider (virtual function in the ChartConverter class,
         derived converters may create an external data provider) */
-    getChartConverter()->createDataProvider( getChartDocument() );
+    getChartConverter().createDataProvider( getChartDocument() );
 
     // attach number formatter of container document to data receiver
     try
diff --git a/oox/source/drawingml/chart/converterbase.cxx b/oox/source/drawingml/chart/converterbase.cxx
index 49414ed..7a49a46 100644
--- a/oox/source/drawingml/chart/converterbase.cxx
+++ b/oox/source/drawingml/chart/converterbase.cxx
@@ -262,9 +262,9 @@ XmlFilterBase& ConverterRoot::getFilter() const
     return mxData->mrFilter;
 }
 
-ChartConverter* ConverterRoot::getChartConverter() const
+ChartConverter& ConverterRoot::getChartConverter() const
 {
-    return &mxData->mrConverter;
+    return mxData->mrConverter;
 }
 
 Reference< XChartDocument > ConverterRoot::getChartDocument() const
diff --git a/oox/source/drawingml/chart/datasourceconverter.cxx b/oox/source/drawingml/chart/datasourceconverter.cxx
index 4265990..6fde74b 100644
--- a/oox/source/drawingml/chart/datasourceconverter.cxx
+++ b/oox/source/drawingml/chart/datasourceconverter.cxx
@@ -54,15 +54,12 @@ DataSequenceConverter::~DataSequenceConverter()
 Reference< XDataSequence > DataSequenceConverter::createDataSequence( const OUString& rRole )
 {
     // create data sequence from data source model (virtual call at chart converter)
-    Reference< XDataSequence > xDataSeq;
-    if( getChartConverter() )
-    {
-        xDataSeq = getChartConverter()->createDataSequence( getChartDocument()->getDataProvider(), mrModel );
+    Reference< XDataSequence > xDataSeq = getChartConverter().createDataSequence( getChartDocument()->getDataProvider(), mrModel );
+
+    // set sequence role
+    PropertySet aSeqProp( xDataSeq );
+    aSeqProp.setProperty( PROP_Role, rRole );
 
-        // set sequen   ce role
-        PropertySet aSeqProp( xDataSeq );
-        aSeqProp.setProperty( PROP_Role, rRole );
-    }
     return xDataSeq;
 }
 
diff --git a/oox/source/drawingml/clrscheme.cxx b/oox/source/drawingml/clrscheme.cxx
index fc20caf..80cac1b 100644
--- a/oox/source/drawingml/clrscheme.cxx
+++ b/oox/source/drawingml/clrscheme.cxx
@@ -26,7 +26,6 @@
  *
  ************************************************************************/
 
-#include <osl/diagnose.h>
 #include "oox/drawingml/clrscheme.hxx"
 #include "tokens.hxx"
 
@@ -63,7 +62,6 @@ ClrScheme::~ClrScheme()
 
 sal_Bool ClrScheme::getColor( sal_Int32 nSchemeClrToken, sal_Int32& rColor ) const
 {
-    OSL_ASSERT((nSchemeClrToken & sal_Int32(0xFFFF0000))==0);
     switch( nSchemeClrToken )
     {
         case XML_bg1 : nSchemeClrToken = XML_lt1; break;
diff --git a/oox/source/drawingml/color.cxx b/oox/source/drawingml/color.cxx
index d2713e9..618e711 100644
--- a/oox/source/drawingml/color.cxx
+++ b/oox/source/drawingml/color.cxx
@@ -382,7 +382,6 @@ sal_Int32 Color::getColor( const GraphicHelper& rGraphicHelper, sal_Int32 nPhClr
     {
         for( TransformVec::const_iterator aIt = maTransforms.begin(), aEnd = maTransforms.end(); aIt != aEnd; ++aIt )
         {
-        OSL_ASSERT((aIt->mnToken & sal_Int32(0xFFFF0000))==0);
             switch( aIt->mnToken )
             {
                 case XML_red:       toCrgb(); lclSetValue( mnC1, aIt->mnValue );    break;
diff --git a/oox/source/drawingml/customshapegeometry.cxx b/oox/source/drawingml/customshapegeometry.cxx
index c948899..07fb336 100644
--- a/oox/source/drawingml/customshapegeometry.cxx
+++ b/oox/source/drawingml/customshapegeometry.cxx
@@ -1172,9 +1172,8 @@ Path2DListContext::Path2DListContext( ContextHandler& rParent, CustomShapeProper
 
 // ---------------------------------------------------------------------
 
-OUString GetShapePresetType( sal_Int32 nType )
+OUString GetShapeType( sal_Int32 nType )
 {
-    OSL_ASSERT((nType & sal_Int32(0xFFFF0000))==0);
     OUString sType;
      switch( nType )
     {
@@ -1802,7 +1801,6 @@ OUString GetShapePresetType( sal_Int32 nType )
 
 static OUString GetTextShapeType( sal_Int32 nType )
 {
-    OSL_ASSERT((nType & sal_Int32(0xFFFF0000))==0);
     OUString sType;
     switch( nType )
     {
@@ -2033,7 +2031,7 @@ PresetShapeGeometryContext::PresetShapeGeometryContext( ContextHandler& rParent,
     OUString sShapeType;
     sal_Int32 nShapeType = xAttribs->getOptionalValueToken( XML_prst, FastToken::DONTKNOW );
     if ( nShapeType != FastToken::DONTKNOW )
-        sShapeType = GetShapePresetType( nShapeType );
+        sShapeType = GetShapeType( nShapeType );
     OSL_ENSURE( sShapeType.getLength(), "oox::drawingml::CustomShapeCustomGeometryContext::CustomShapeCustomGeometryContext(), unknown shape type" );
     mrCustomShapeProperties.setShapePresetType( sShapeType );
 }
diff --git a/oox/source/drawingml/diagram/constraintlistcontext.cxx b/oox/source/drawingml/diagram/constraintlistcontext.cxx
deleted file mode 100644
index 5351977..0000000
--- a/oox/source/drawingml/diagram/constraintlistcontext.cxx
+++ /dev/null
@@ -1,102 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile$
- * $Revision$
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org.  If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "constraintlistcontext.hxx"
-#include "oox/helper/attributelist.hxx"
-#include "oox/core/namespaces.hxx"
-
-using namespace ::oox::core;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::xml::sax;
-using ::rtl::OUString;
-
-namespace oox { namespace drawingml {
-
-// CT_ConstraintLists
-ConstraintListContext::ConstraintListContext( ContextHandler& rParent,
-                                              const Reference< XFastAttributeList >&,
-                                              const LayoutAtomPtr &pNode )
-    : ContextHandler( rParent )
-    , mpNode( pNode )
-{
-    OSL_ENSURE( pNode, "Node must NOT be NULL" );
-}
-
-
-ConstraintListContext::~ConstraintListContext()
-{
-}
-
-void SAL_CALL ConstraintListContext::endFastElement( ::sal_Int32 )
-    throw (SAXException, RuntimeException)
-{
-}
-
-Reference< XFastContextHandler > SAL_CALL
-ConstraintListContext::createFastChildContext( ::sal_Int32 aElement,
-                                               const Reference< XFastAttributeList >& xAttribs )
-    throw (SAXException, RuntimeException)
-{
-    Reference< XFastContextHandler > xRet;
-
-    OUString aEmptyStr;
-
-    switch( aElement )
-    {
-    case NMSP_DIAGRAM|XML_constr:
-    {
-        ConstraintAtomPtr pNode( new ConstraintAtom() );
-        mpNode->addChild( pNode );
-
-        AttributeList aAttribs( xAttribs );
-        pNode->setFor( aAttribs.getToken( XML_for, XML_none ) );
-        pNode->setForName( aAttribs.getString( XML_forName, aEmptyStr ) );
-        pNode->setPointType( aAttribs.getToken( XML_ptType, XML_none ) );
-        pNode->setType( aAttribs.getToken( XML_type, XML_none ) );
-        pNode->setRefFor( aAttribs.getToken( XML_refFor, XML_none ) );
-        pNode->setRefForName( aAttribs.getString( XML_refForName, aEmptyStr ) );
-        pNode->setRefType( aAttribs.getToken( XML_refType, XML_none ) );
-        pNode->setRefPointType( aAttribs.getToken( XML_refPtType, XML_none ) );
-        pNode->setFactor( aAttribs.getDouble( XML_fact, 1.0 ) );
-        pNode->setValue( aAttribs.getDouble( XML_val, 0.0 ) );
-        pNode->setOperator( aAttribs.getToken( XML_op, XML_none ) );
-        break;
-    }
-    default:
-        break;
-    }
-    if( !xRet.is() )
-        xRet.set(this);
-
-    return xRet;
-}
-
-
-} }
diff --git a/oox/source/drawingml/diagram/constraintlistcontext.hxx b/oox/source/drawingml/diagram/constraintlistcontext.hxx
deleted file mode 100644
index ecbb04c..0000000
--- a/oox/source/drawingml/diagram/constraintlistcontext.hxx
+++ /dev/null
@@ -1,54 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile$
- * $Revision$
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org.  If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef OOX_DRAWINGML_CONSTRAINTLISTCONTEXT_HXX
-#define OOX_DRAWINGML_CONSTRAINTLISTCONTEXT_HXX
-
-#include "oox/core/contexthandler.hxx"
-#include "diagramlayoutatoms.hxx"
-#include "diagram.hxx"
-
-namespace oox { namespace drawingml {
-
-class ConstraintListContext : public ::oox::core::ContextHandler
-{
-public:
-    ConstraintListContext( ContextHandler& rParent, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& xAttributes, const LayoutAtomPtr &pNode );
-    virtual ~ConstraintListContext();
-
-    virtual void SAL_CALL endFastElement( ::sal_Int32 Element ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
-    virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 Element, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
-private:
-    LayoutAtomPtr mpNode;
-};
-
-} }
-
-#endif
diff --git a/oox/source/drawingml/diagram/datamodelcontext.cxx b/oox/source/drawingml/diagram/datamodelcontext.cxx
index 26da022..d7c88b6 100644
--- a/oox/source/drawingml/diagram/datamodelcontext.cxx
+++ b/oox/source/drawingml/diagram/datamodelcontext.cxx
@@ -26,7 +26,7 @@
  *
  ************************************************************************/
 
-#include "datamodelcontext.hxx"
+#include "oox/drawingml/diagram/datamodelcontext.hxx"
 #include "oox/helper/attributelist.hxx"
 #include "oox/core/namespaces.hxx"
 #include "oox/drawingml/fillpropertiesgroupcontext.hxx"
@@ -42,46 +42,40 @@ namespace oox { namespace drawingml {
 
 
 
-// CT_CxnList
-class CxnListContext
+// CL_Cxn
+class CxnContext
     : public ContextHandler
 {
 public:
-    CxnListContext( ContextHandler& rParent,
-                    dgm::Connections & aConnections )
+    CxnContext( ContextHandler& rParent,
+                const Reference< XFastAttributeList >& xAttribs,
+                const dgm::ConnectionPtr & pConnection )
         : ContextHandler( rParent )
-        , mrConnections( aConnections )
+        , mpConnection( pConnection )
         {
+            sal_Int32 nType = xAttribs->getOptionalValueToken( XML_type, XML_parOf );
+            pConnection->mnType = nType;
+            pConnection->msModelId = xAttribs->getOptionalValue( XML_modelId );
+            pConnection->msSourceId = xAttribs->getOptionalValue( XML_srcId );
+            pConnection->msDestId  = xAttribs->getOptionalValue( XML_destId );
+            pConnection->msPresId  = xAttribs->getOptionalValue( XML_presId );
+            pConnection->msSibTransId  = xAttribs->getOptionalValue( XML_sibTransId );
+            AttributeList attribs( xAttribs );
+            pConnection->mnSourceOrder = attribs.getInteger( XML_srcOrd, 0 );
+            pConnection->mnDestOrder = attribs.getInteger( XML_destOrd, 0 );
         }
+
     virtual Reference< XFastContextHandler > SAL_CALL
     createFastChildContext( sal_Int32 aElementToken,
-                            const Reference< XFastAttributeList >& xAttribs )
+                            const Reference< XFastAttributeList >& /*xAttribs*/ )
         throw (SAXException, RuntimeException)
         {
             Reference< XFastContextHandler > xRet;
 
             switch( aElementToken )
             {
-            case NMSP_DIAGRAM|XML_cxn:
-            {
-                mrConnections.push_back( dgm::Connection() );
-                dgm::Connection& rConnection=mrConnections.back();
-
-                const sal_Int32 nType = xAttribs->getOptionalValueToken( XML_type, XML_parOf );
-                rConnection.mnType = nType;
-                rConnection.msModelId = xAttribs->getOptionalValue( XML_modelId );
-                rConnection.msSourceId = xAttribs->getOptionalValue( XML_srcId );
-                rConnection.msDestId  = xAttribs->getOptionalValue( XML_destId );
-                rConnection.msPresId  = xAttribs->getOptionalValue( XML_presId );
-                rConnection.msSibTransId  = xAttribs->getOptionalValue( XML_sibTransId );
-                rConnection.msParTransId  = xAttribs->getOptionalValue( XML_parTransId );
-                const AttributeList attribs( xAttribs );
-                rConnection.mnSourceOrder = attribs.getInteger( XML_srcOrd, 0 );
-                rConnection.mnDestOrder = attribs.getInteger( XML_destOrd, 0 );
-
-                // skip CT_extLst
+            case NMSP_DIAGRAM|XML_extLst:
                 return xRet;
-            }
             default:
                 break;
             }
@@ -89,136 +83,37 @@ public:
                 xRet.set( this );
             return xRet;
         }
-
 private:
-    dgm::Connections& mrConnections;
+    dgm::ConnectionPtr mpConnection;
 };
 
 
-// CT_presLayoutVars
-class PresLayoutVarsContext
+// CT_CxnList
+class CxnListContext
     : public ContextHandler
 {
 public:
-    PresLayoutVarsContext( ContextHandler& rParent,
-                           dgm::Point & rPoint ) :
-        ContextHandler( rParent ),
-        mrPoint( rPoint )
-    {
-    }
-    virtual Reference< XFastContextHandler > SAL_CALL
-    createFastChildContext( sal_Int32 aElementToken,
-                            const Reference< XFastAttributeList >& xAttribs )
-        throw (SAXException, RuntimeException)
+    CxnListContext( ContextHandler& rParent,  dgm::Connections & aConnections )
+        : ContextHandler( rParent )
+        , maConnections( aConnections )
         {
-            Reference< XFastContextHandler > xRet;
-            AttributeList aAttribs( xAttribs );
-
-            switch( aElementToken )
-            {
-                // TODO
-            case NMSP_DIAGRAM|XML_animLvl:
-            case NMSP_DIAGRAM|XML_animOne:
-                break;
-            case NMSP_DIAGRAM|XML_bulletEnabled:
-                mrPoint.mbBulletEnabled = aAttribs.getBool( XML_val, false );
-                break;
-            case NMSP_DIAGRAM|XML_chMax:
-                mrPoint.mnMaxChildren = aAttribs.getInteger( XML_val, -1 );
-                break;
-            case NMSP_DIAGRAM|XML_chPref:
-                mrPoint.mnPreferredChildren = aAttribs.getInteger( XML_val, -1 );
-                break;
-            case NMSP_DIAGRAM|XML_dir:
-                mrPoint.mnDirection = aAttribs.getToken( XML_val, XML_norm );
-                break;
-            case NMSP_DIAGRAM|XML_hierBranch:
-                mrPoint.mnHierarchyBranch = aAttribs.getToken( XML_val, XML_std );
-                break;
-            case NMSP_DIAGRAM|XML_orgChart:
-                mrPoint.mbOrgChartEnabled = aAttribs.getBool( XML_val, false );
-                break;
-            case NMSP_DIAGRAM|XML_resizeHandles:
-                mrPoint.mnResizeHandles = aAttribs.getToken( XML_val, XML_rel );
-                break;
-            default:
-                break;
-            }
-            if( !xRet.is() )
-                xRet.set( this );
-            return xRet;
         }
-
-private:
-    dgm::Point& mrPoint;
-};
-
-
-// CT_prSet
-class PropertiesContext
-    : public ContextHandler
-{
-public:
-    PropertiesContext( ContextHandler& rParent,
-                       dgm::Point & rPoint,
-                       const Reference< XFastAttributeList >& xAttribs ) :
-        ContextHandler( rParent ),
-        mrPoint( rPoint )
-    {
-        OUString aEmptyStr;
-        AttributeList aAttribs( xAttribs );
-
-        mrPoint.msColorTransformCategoryId = aAttribs.getString( XML_csCatId, aEmptyStr );
-        mrPoint.msColorTransformTypeId = aAttribs.getString( XML_csTypeId, aEmptyStr );
-        mrPoint.msLayoutCategoryId = aAttribs.getString( XML_loCatId, aEmptyStr );
-        mrPoint.msLayoutTypeId = aAttribs.getString( XML_loTypeId, aEmptyStr );
-        mrPoint.msPlaceholderText = aAttribs.getString( XML_phldrT, aEmptyStr );
-        mrPoint.msPresentationAssociationId = aAttribs.getString( XML_presAssocID, aEmptyStr );
-        mrPoint.msPresentationLayoutName = aAttribs.getString( XML_presName, aEmptyStr );
-        mrPoint.msPresentationLayoutStyleLabel = aAttribs.getString( XML_presStyleLbl, aEmptyStr );
-        mrPoint.msQuickStyleCategoryId = aAttribs.getString( XML_qsCatId, aEmptyStr );
-        mrPoint.msQuickStyleTypeId = aAttribs.getString( XML_qsTypeId, aEmptyStr );
-
-        mrPoint.mnCustomAngle = aAttribs.getInteger( XML_custAng, -1 );
-        mrPoint.mnPercentageNeighbourWidth = aAttribs.getInteger( XML_custLinFactNeighborX, -1 );
-        mrPoint.mnPercentageNeighbourHeight = aAttribs.getInteger( XML_custLinFactNeighborY, -1 );
-        mrPoint.mnPercentageOwnWidth = aAttribs.getInteger( XML_custLinFactX, -1 );
-        mrPoint.mnPercentageOwnHeight = aAttribs.getInteger( XML_custLinFactY, -1 );
-        mrPoint.mnIncludeAngleScale = aAttribs.getInteger( XML_custRadScaleInc, -1 );
-        mrPoint.mnRadiusScale = aAttribs.getInteger( XML_custRadScaleRad, -1 );
-        mrPoint.mnWidthScale = aAttribs.getInteger( XML_custScaleX, -1 );
-        mrPoint.mnHeightScale = aAttribs.getInteger( XML_custScaleY, -1 );
-        mrPoint.mnWidthOverride = aAttribs.getInteger( XML_custSzX, -1 );
-        mrPoint.mnHeightOverride = aAttribs.getInteger( XML_custSzY, -1 );
-        mrPoint.mnLayoutStyleCount = aAttribs.getInteger( XML_presStyleCnt, -1 );
-        mrPoint.mnLayoutStyleIndex = aAttribs.getInteger( XML_presStyleIdx, -1 );
-
-        mrPoint.mbCoherent3DOffset = aAttribs.getBool( XML_coherent3DOff, false );
-        mrPoint.mbCustomHorizontalFlip = aAttribs.getBool( XML_custFlipHor, false );
-        mrPoint.mbCustomVerticalFlip = aAttribs.getBool( XML_custFlipVert, false );
-        mrPoint.mbCustomText = aAttribs.getBool( XML_custT, false );
-        mrPoint.mbIsPlaceholder = aAttribs.getBool( XML_phldr, false );
-    }
     virtual Reference< XFastContextHandler > SAL_CALL
     createFastChildContext( sal_Int32 aElementToken,
-                            const Reference< XFastAttributeList >& )
+                            const Reference< XFastAttributeList >& xAttribs )
         throw (SAXException, RuntimeException)
         {
             Reference< XFastContextHandler > xRet;
 
             switch( aElementToken )
             {
-            case NMSP_DIAGRAM|XML_presLayoutVars:
+            case NMSP_DIAGRAM|XML_cxn:
             {
-                xRet.set( new PresLayoutVarsContext( *this, mrPoint ) );
+                dgm::ConnectionPtr pConnection( new dgm::Connection() );
+                maConnections.push_back( pConnection );
+                xRet.set( new CxnContext( *this, xAttribs, pConnection ) );
                 break;
             }
-            case NMSP_DIAGRAM|XML_style:
-            {
-                // TODO
-                // skip CT_shapeStyle
-                return xRet;
-            }
             default:
                 break;
             }
@@ -228,10 +123,11 @@ public:
         }
 
 private:
-    dgm::Point& mrPoint;
+    dgm::Connections  & maConnections;
 };
 
 
+
 // CL_Pt
 class PtContext
     : public ContextHandler
@@ -239,25 +135,27 @@ class PtContext
 public:
     PtContext( ContextHandler& rParent,
                const Reference< XFastAttributeList >& xAttribs,
-               dgm::Point & rPoint):
-        ContextHandler( rParent ),
-        mrPoint( rPoint )
-    {
-        mrPoint.msModelId = xAttribs->getOptionalValue( XML_modelId );
-
-        // the default type is XML_node
-        const sal_Int32 nType  = xAttribs->getOptionalValueToken( XML_type, XML_node );
-        mrPoint.mnType = nType;
-
-        // ignore the cxnId unless it is this type. See 5.15.3.1.3 in Primer
-        if( ( nType == XML_parTrans ) || ( nType == XML_sibTrans ) )
-            mrPoint.msCnxId = xAttribs->getOptionalValue( XML_cxnId );
-    }
+               const dgm::PointPtr & pPoint)
+        : ContextHandler( rParent )
+        , mpPoint( pPoint )
+        {
+            mpPoint->setModelId( xAttribs->getOptionalValue( XML_modelId ) );
+            //
+            // the default type is XML_node
+            sal_Int32 nType  = xAttribs->getOptionalValueToken( XML_type, XML_node );
+            mpPoint->setType( nType );
+
+            // ignore the cxnId unless it is this type. See 5.15.3.1.3 in Primer
+            if( ( nType == XML_parTrans ) || ( nType == XML_sibTrans ) )
+            {
+                mpPoint->setCnxId( xAttribs->getOptionalValue( XML_cxnId ) );
+            }
+        }
 
 
     virtual Reference< XFastContextHandler > SAL_CALL
     createFastChildContext( sal_Int32 aElementToken,
-                            const Reference< XFastAttributeList >& xAttribs )
+                            const Reference< XFastAttributeList >& /*xAttribs*/ )
         throw (SAXException, RuntimeException)
         {
             Reference< XFastContextHandler > xRet;
@@ -267,22 +165,18 @@ public:
             case NMSP_DIAGRAM|XML_extLst:
                 return xRet;
             case NMSP_DIAGRAM|XML_prSet:
-                OSL_TRACE( "diagram property set for point");
-                xRet = new PropertiesContext( *this, mrPoint, xAttribs );
+                // TODO
+                // CT_ElemPropSet
                 break;
             case NMSP_DIAGRAM|XML_spPr:
                 OSL_TRACE( "shape props for point");
-                if( !mrPoint.mpShape )
-                    mrPoint.mpShape.reset( new Shape() );
-                xRet = new ShapePropertiesContext( *this, *(mrPoint.mpShape) );
+                xRet = new ShapePropertiesContext( *this, *mpPoint->getShape() );
                 break;
             case NMSP_DIAGRAM|XML_t:
             {
                 OSL_TRACE( "shape text body for point");
                 TextBodyPtr xTextBody( new TextBody );
-                if( !mrPoint.mpShape )
-                    mrPoint.mpShape.reset( new Shape() );
-                mrPoint.mpShape->setTextBody( xTextBody );
+                mpPoint->getShape()->setTextBody( xTextBody );
                 xRet = new TextBodyContext( *this, *xTextBody );
                 break;
             }
@@ -295,7 +189,7 @@ public:
         }
 
 private:
-    dgm::Point& mrPoint;
+    dgm::PointPtr mpPoint;
 };
 
 
@@ -305,10 +199,11 @@ class PtListContext
     : public ContextHandler
 {
 public:
-    PtListContext( ContextHandler& rParent,  dgm::Points& rPoints) :
-        ContextHandler( rParent ),
-        mrPoints( rPoints )
-    {}
+    PtListContext( ContextHandler& rParent,  dgm::Points & aPoints)
+        : ContextHandler( rParent )
+        , maPoints( aPoints )
+        {
+        }
     virtual Reference< XFastContextHandler > SAL_CALL
     createFastChildContext( sal_Int32 aElementToken,
                             const Reference< XFastAttributeList >& xAttribs )
@@ -321,8 +216,9 @@ public:
             case NMSP_DIAGRAM|XML_pt:
             {
                 // CT_Pt
-                mrPoints.push_back( dgm::Point() );
-                xRet.set( new PtContext( *this, xAttribs, mrPoints.back() ) );
+                dgm::PointPtr pPoint( new dgm::Point() );
+                maPoints.push_back( pPoint );
+                xRet.set( new PtContext( *this, xAttribs, pPoint ) );
                 break;
             }
             default:
@@ -334,7 +230,7 @@ public:
         }
 
 private:
-    dgm::Points& mrPoints;
+    dgm::Points  & maPoints;
 };
 
 // CT_BackgroundFormatting
diff --git a/oox/source/drawingml/diagram/datamodelcontext.hxx b/oox/source/drawingml/diagram/datamodelcontext.hxx
deleted file mode 100644
index be79609..0000000
--- a/oox/source/drawingml/diagram/datamodelcontext.hxx
+++ /dev/null
@@ -1,57 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: datamodelcontext.hxx,v $
- * $Revision: 1.4 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org.  If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-#ifndef OOX_DRAWINGML_SHAPECONTEXT_HXX
-#define OOX_DRAWINGML_SHAPECONTEXT_HXX
-
-#include <com/sun/star/drawing/XShapes.hpp>
-
-#include "oox/core/contexthandler.hxx"
-#include "diagram.hxx"
-
-namespace oox { namespace drawingml {
-
-// CT_DataModel
-class DataModelContext : public ::oox::core::ContextHandler
-{
-public:
-    DataModelContext( ::oox::core::ContextHandler& rParent, const DiagramDataPtr & pDataModelPtr );
-    virtual ~DataModelContext();
-
-    virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 Element, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
-
-protected:
-    DiagramDataPtr mpDataModel;
-};
-
-} }
-
-#endif  //  OOX_DRAWINGML_SHAPEGROUPCONTEXT_HXX
diff --git a/oox/source/drawingml/diagram/diagram.cxx b/oox/source/drawingml/diagram/diagram.cxx
index 11c4ef0..baa0250 100644
--- a/oox/source/drawingml/diagram/diagram.cxx
+++ b/oox/source/drawingml/diagram/diagram.cxx
@@ -32,22 +32,10 @@
 
 #include <com/sun/star/awt/Point.hpp>
 #include <com/sun/star/awt/Size.hpp>
-#include <com/sun/star/xml/dom/XDocument.hpp>
-#include <com/sun/star/xml/sax/XFastSAXSerializable.hpp>
-#include <rtl/ustrbuf.hxx>
-#include "oox/drawingml/textbody.hxx"
-#include "oox/drawingml/textparagraph.hxx"
-#include "oox/drawingml/textrun.hxx"
 #include "oox/drawingml/diagram/diagram.hxx"
 #include "oox/drawingml/fillproperties.hxx"
 #include "oox/core/namespaces.hxx"
 #include "tokens.hxx"
-#include "diagram.hxx"
-#include "diagramlayoutatoms.hxx"
-#include "diagramfragmenthandler.hxx"
-
-#include <iostream>
-#include <fstream>
 
 using rtl::OUString;
 using namespace ::com::sun::star;
@@ -59,26 +47,58 @@ namespace dgm {
 
 void Connection::dump()
 {
-    OSL_TRACE("dgm: cnx modelId %s, srcId %s, dstId %s, parTransId %s, presId %s, sibTransId %s, srcOrd %d, dstOrd %d",
+    OSL_TRACE("dgm: cnx modelId %s, srcId %s, dstId %s",
               OUSTRING_TO_CSTR( msModelId ),
               OUSTRING_TO_CSTR( msSourceId ),
-              OUSTRING_TO_CSTR( msDestId ),
-              OUSTRING_TO_CSTR( msParTransId ),
-              OUSTRING_TO_CSTR( msPresId ),
-              OUSTRING_TO_CSTR( msSibTransId ),
-              mnSourceOrder,
-              mnDestOrder );
+              OUSTRING_TO_CSTR( msDestId ) );
+}
+
+Point::Point()
+    : mpShape( new Shape( "com.sun.star.drawing.GraphicObjectShape" ) )
+    , mnType( 0 )
+{
 }
 
 void Point::dump()
 {
-    OSL_TRACE( "dgm: pt text %x, cnxId %s, modelId %s, type %d",
-               mpShape.get(),
+    OSL_TRACE( "dgm: pt cnxId %s, modelId %s",
                OUSTRING_TO_CSTR( msCnxId ),
-               OUSTRING_TO_CSTR( msModelId ),
-               mnType );
+               OUSTRING_TO_CSTR( msModelId ) );
+}
+
+void Point::setModelId( const ::rtl::OUString & sModelId )
+{
+    msModelId = sModelId;
+    mpShape->setName( msModelId );
+}
+
+
+bool PointsTree::addChild( const PointsTreePtr & pChild )
+{
+    bool added = false;
+
+    OSL_ENSURE( pChild->mpParent.expired(), "can't add, has already a parent" );
+    OSL_ENSURE( mpNode, "has no node" );
+    if( mpNode && pChild->mpParent.expired() )
+    {
+        pChild->mpParent = shared_from_this();
+        maChildrens.push_back( pChild );
+        added = true;
+    }
+
+    return added;
 }
 
+PointsTreePtr PointsTree::getParent() const
+{
+    if( !mpParent.expired() )
+    {
+        return mpParent.lock() ;
+    }
+    return PointsTreePtr();
+}
+
+
 } // dgm namespace
 
 DiagramData::DiagramData()
@@ -96,10 +116,18 @@ void DiagramData::dump()
                   boost::bind( &dgm::Point::dump, _1 ) );
 }
 
-void DiagramLayout::layout( const dgm::Points & /*pTree*/, const awt::Point & /*pt*/ )
+static void setPosition( const dgm::PointPtr & pPoint, const awt::Point & pt )
+{
+    ShapePtr pShape = pPoint->getShape();
+    awt::Size sz;
+    sz.Width = 50;
+    sz.Height = 50;
+    pShape->setPosition( pt );
+    pShape->setSize( sz );
+}
+
+void DiagramLayout::layout( const dgm::PointsTreePtr & pTree, const awt::Point & pt )
 {
-    // TODO
-#if 0
     setPosition( pTree->getPoint(), pt );
     awt::Point nextPt = pt;
     nextPt.Y += 50;
@@ -109,7 +137,6 @@ void DiagramLayout::layout( const dgm::Points & /*pTree*/, const awt::Point & /*
         layout( *iter, nextPt );
         nextPt.X += 50;
     }
-#endif
 }
 
 void Diagram::setData( const DiagramDataPtr & pData)
@@ -123,244 +150,19 @@ void Diagram::setLayout( const DiagramLayoutPtr & pLayout)
     mpLayout = pLayout;
 }
 
-#if OSL_DEBUG_LEVEL > 1
-rtl::OString normalizeDotName( const rtl::OUString& rStr )
+void Diagram::setQStyles( const DiagramQStylesPtr & pStyles)
 {
-    rtl::OUStringBuffer aBuf;
-    aBuf.append((sal_Unicode)'N');
-
-    const sal_Int32 nLen(rStr.getLength());
-    sal_Int32 nCurrIndex(0);
-    while( nCurrIndex < nLen )
-    {
-        const sal_Int32 aChar=rStr.iterateCodePoints(&nCurrIndex);
-        if( aChar != '-' && aChar != '{' && aChar != '}' )
-            aBuf.append((sal_Unicode)aChar);
-    }
-
-    return rtl::OUStringToOString(aBuf.makeStringAndClear(),
-                                  RTL_TEXTENCODING_UTF8);
+    mpQStyles = pStyles;
 }
-#endif
 
-static sal_Int32 calcDepth( const rtl::OUString& rNodeName,
-                            const dgm::Connections& rCnx )
-{
-    // find length of longest path in 'isChild' graph, ending with rNodeName
-    dgm::Connections::const_iterator aCurrCxn( rCnx.begin() );
-    const dgm::Connections::const_iterator aEndCxn( rCnx.end() );
-    while( aCurrCxn != aEndCxn )
-    {
-        if( aCurrCxn->msParTransId.getLength() &&
-            aCurrCxn->msSibTransId.getLength() &&
-            aCurrCxn->msSourceId.getLength() &&
-            aCurrCxn->msDestId.getLength() &&
-            aCurrCxn->mnType != XML_presOf &&
-            aCurrCxn->mnType != XML_presParOf &&
-            rNodeName == aCurrCxn->msDestId )
-        {
-            return calcDepth(aCurrCxn->msSourceId,
-                             rCnx) + 1;
-        }
-        ++aCurrCxn;
-    }
 
-    return 0;
+void Diagram::setColors( const DiagramColorsPtr & pColors)
+{
+    mpColors = pColors;
 }
 
-
 void Diagram::build(  )
 {
-    // build name-object maps
-    // ======================
-
-#if OSL_DEBUG_LEVEL > 1
-    std::ofstream output("/tmp/tree.dot");
-
-    output << "digraph datatree {" << std::endl;
-#endif
-
-    dgm::Points::iterator aCurrPoint( getData()->getPoints( ).begin() );
-    const dgm::Points::iterator aEndPoint( getData()->getPoints( ).end() );
-    while( aCurrPoint != aEndPoint )
-    {
-#if OSL_DEBUG_LEVEL > 1
-        output << "\t"
-               << normalizeDotName(aCurrPoint->msModelId).getStr()
-               << "[";
-
-        if( aCurrPoint->msPresentationLayoutName.getLength() )
-            output << "label=\""
-                   << rtl::OUStringToOString(
-                       aCurrPoint->msPresentationLayoutName,
-                       RTL_TEXTENCODING_UTF8).getStr() << "\", ";
-        else
-            output << "label=\""
-                   << rtl::OUStringToOString(
-                       aCurrPoint->msModelId,
-                       RTL_TEXTENCODING_UTF8).getStr() << "\", ";
-
-        switch( aCurrPoint->mnType )
-        {
-            case XML_doc: output << "style=filled, color=red"; break;
-            case XML_asst: output << "style=filled, color=green"; break;
-            default:
-            case XML_node: output << "style=filled, color=blue"; break;
-            case XML_pres: output << "style=filled, color=yellow"; break;
-            case XML_parTrans: output << "color=grey"; break;
-            case XML_sibTrans: output << " "; break;
-        }
-
-        output << "];" << std::endl;
-
-        // does currpoint have any text set?
-        if( aCurrPoint->mpShape &&
-            aCurrPoint->mpShape->getTextBody() &&
-            !aCurrPoint->mpShape->getTextBody()->getParagraphs().empty() &&
-            !aCurrPoint->mpShape->getTextBody()->getParagraphs().front()->getRuns().empty() )
-        {
-            static sal_Int32 nCount=0;
-
-            output << "\t"
-                   << "textNode" << nCount
-                   << " ["
-                   << "label=\""
-                   << rtl::OUStringToOString(
-                       aCurrPoint->mpShape->getTextBody()->getParagraphs().front()->getRuns().front()->getText(),
-                       RTL_TEXTENCODING_UTF8).getStr()
-                   << "\"" << "];" << std::endl;
-            output << "\t"
-                   << normalizeDotName(aCurrPoint->msModelId).getStr()
-                   << " -> "
-                   << "textNode" << nCount++
-                   << ";" << std::endl;
-        }
-
-
-#if 0
-        // msPresentationAssociationId does not appear to be
-        // valid/used, the relation this imposed for several examples
-        // was ~broken
-        if( aCurrPoint->msPresentationAssociationId.getLength() )
-            output << "\t"
-                   << normalizeDotName(aCurrPoint->msModelId).getStr()
-                   << " -> "
-                   << normalizeDotName(aCurrPoint->msPresentationAssociationId).getStr()
-                   << " [style=dotted, color=red, "
-                   << "label=\"presAssocID\"];" << std::endl;
-#endif
-
-#endif
-
-        const bool bInserted1=getData()->getPointNameMap().insert(
-            std::make_pair(aCurrPoint->msModelId,&(*aCurrPoint))).second;
-        (void)bInserted1;
-
-        OSL_ENSURE(bInserted1,"Diagram::build(): non-unique point model id");
-
-        if( aCurrPoint->msPresentationLayoutName.getLength() )
-        {
-            DiagramData::PointsNameMap::value_type::second_type& rVec=
-                getData()->getPointsPresNameMap()[aCurrPoint->msPresentationLayoutName];
-            rVec.push_back(&(*aCurrPoint));
-        }
-        ++aCurrPoint;
-    }
-
-    dgm::Connections::const_iterator aCurrCxn( getData()->getConnections( ).begin() );
-    const dgm::Connections::const_iterator aEndCxn( getData()->getConnections( ).end() );
-    while( aCurrCxn != aEndCxn )
-    {
-#if OSL_DEBUG_LEVEL > 1
-        if( aCurrCxn->msParTransId.getLength() ||
-            aCurrCxn->msSibTransId.getLength() )
-        {
-            if( aCurrCxn->msSourceId.getLength() ||
-                aCurrCxn->msDestId.getLength() )
-            {
-                output << "\t"
-                       << normalizeDotName(aCurrCxn->msSourceId).getStr()
-                       << " -> "
-                       << normalizeDotName(aCurrCxn->msParTransId).getStr()
-                       << " -> "
-                       << normalizeDotName(aCurrCxn->msSibTransId).getStr()
-                       << " -> "
-                       << normalizeDotName(aCurrCxn->msDestId).getStr()
-                       << " [style=dotted,"
-                       << ((aCurrCxn->mnType == XML_presOf) ? " color=red, " : ((aCurrCxn->mnType == XML_presParOf) ? " color=green, " : " "))
-                       << "label=\""
-                       << rtl::OUStringToOString(aCurrCxn->msModelId,
-                                                 RTL_TEXTENCODING_UTF8 ).getStr()
-                       << "\"];" << std::endl;
-            }
-            else
-            {
-                output << "\t"
-                       << normalizeDotName(aCurrCxn->msParTransId).getStr()
-                       << " -> "
-                       << normalizeDotName(aCurrCxn->msSibTransId).getStr()
-                       << " ["
-                       << ((aCurrCxn->mnType == XML_presOf) ? " color=red, " : ((aCurrCxn->mnType == XML_presParOf) ? " color=green, " : " "))
-                       << "label=\""
-                       << rtl::OUStringToOString(aCurrCxn->msModelId,
-                                                 RTL_TEXTENCODING_UTF8 ).getStr()
-                       << "\"];" << std::endl;
-            }
-        }
-        else if( aCurrCxn->msSourceId.getLength() ||
-                 aCurrCxn->msDestId.getLength() )
-            output << "\t"
-                   << normalizeDotName(aCurrCxn->msSourceId).getStr()
-                   << " -> "
-                   << normalizeDotName(aCurrCxn->msDestId).getStr()
-                   << " [label=\""
-                   << rtl::OUStringToOString(aCurrCxn->msModelId,
-                                             RTL_TEXTENCODING_UTF8 ).getStr()
-                   << ((aCurrCxn->mnType == XML_presOf) ? "\", color=red]" : ((aCurrCxn->mnType == XML_presParOf) ? "\", color=green]" : "\"]"))
-                   << ";" << std::endl;
-#endif
-
-        const bool bInserted1=getData()->getConnectionNameMap().insert(
-            std::make_pair(aCurrCxn->msModelId,&(*aCurrCxn))).second;
-        (void)bInserted1;
-
-        OSL_ENSURE(bInserted1,"Diagram::build(): non-unique connection model id");
-
-        if( aCurrCxn->mnType == XML_presOf )
-        {
-            DiagramData::StringMap::value_type::second_type& rVec=getData()->getPresOfNameMap()[aCurrCxn->msDestId];
-            rVec.push_back(
-                std::make_pair(
-                    aCurrCxn->msSourceId,sal_Int32(0)));
-        }
-
-        ++aCurrCxn;
-    }
-
-    // assign outline levels
-    DiagramData::StringMap::iterator aPresOfIter=getData()->getPresOfNameMap().begin();

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list