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

Muthu Subramanian sumuthu at kemper.freedesktop.org
Tue Jul 5 03:47:20 PDT 2011


 oox/inc/oox/ppt/backgroundproperties.hxx         |    8 
 oox/inc/oox/ppt/customshowlistcontext.hxx        |   10 
 oox/inc/oox/ppt/layoutfragmenthandler.hxx        |    3 
 oox/inc/oox/ppt/presentationfragmenthandler.hxx  |   10 
 oox/inc/oox/ppt/slidefragmenthandler.hxx         |    8 
 oox/inc/oox/ppt/slidemastertextstylescontext.hxx |    8 
 oox/inc/oox/ppt/slidetimingcontext.hxx           |   11 
 oox/inc/oox/ppt/slidetransitioncontext.hxx       |   16 -
 oox/inc/oox/ppt/soundactioncontext.hxx           |   10 
 oox/inc/oox/ppt/timenodelistcontext.hxx          |   17 -
 oox/source/ppt/animvariantcontext.cxx            |   41 +--
 oox/source/ppt/animvariantcontext.hxx            |   10 
 oox/source/ppt/backgroundproperties.cxx          |   16 -
 oox/source/ppt/buildlistcontext.cxx              |   35 +-
 oox/source/ppt/buildlistcontext.hxx              |   10 
 oox/source/ppt/commonbehaviorcontext.cxx         |   31 --
 oox/source/ppt/commonbehaviorcontext.hxx         |   15 -
 oox/source/ppt/commontimenodecontext.cxx         |   43 +--
 oox/source/ppt/commontimenodecontext.hxx         |    6 
 oox/source/ppt/conditioncontext.cxx              |   37 ---
 oox/source/ppt/conditioncontext.hxx              |    8 
 oox/source/ppt/customshowlistcontext.cxx         |   39 +--
 oox/source/ppt/headerfootercontext.cxx           |   23 -
 oox/source/ppt/headerfootercontext.hxx           |    8 
 oox/source/ppt/layoutfragmenthandler.cxx         |   17 -
 oox/source/ppt/presentationfragmenthandler.cxx   |   43 +--
 oox/source/ppt/slidefragmenthandler.cxx          |   69 ++---
 oox/source/ppt/slidemastertextstylescontext.cxx  |   13 -
 oox/source/ppt/slidetimingcontext.cxx            |   32 --
 oox/source/ppt/slidetransitioncontext.cxx        |   65 ++---
 oox/source/ppt/soundactioncontext.cxx            |   29 --
 oox/source/ppt/timeanimvaluecontext.cxx          |   27 --
 oox/source/ppt/timeanimvaluecontext.hxx          |   11 
 oox/source/ppt/timenodelistcontext.cxx           |  281 +++++++----------------
 oox/source/ppt/timetargetelementcontext.cxx      |   60 +---
 oox/source/ppt/timetargetelementcontext.hxx      |    9 
 36 files changed, 405 insertions(+), 674 deletions(-)

New commits:
commit 77075eb7eae53f945226a1e22c7b46e43601826a
Author: Muthu Subramanian <sumuthu at novell.com>
Date:   Tue Jul 5 16:32:50 2011 +0530

    Moving the pptx classes to use FragmentHandler2/ContextHandler2.
    
    This is to make it use the better and newer parent handlers.
    And to support MCE.
    [PB] Probable candidate for typo breakages.

diff --git a/oox/inc/oox/ppt/backgroundproperties.hxx b/oox/inc/oox/ppt/backgroundproperties.hxx
index 155819f..27f1323 100644
--- a/oox/inc/oox/ppt/backgroundproperties.hxx
+++ b/oox/inc/oox/ppt/backgroundproperties.hxx
@@ -29,18 +29,18 @@
 #ifndef OOX_POWERPOINT_BACKGROUNDPROPERTIES_HXX
 #define OOX_POWERPOINT_BACKGROUNDPROPERTIES_HXX
 
-#include "oox/core/contexthandler.hxx"
+#include "oox/core/fragmenthandler2.hxx"
 #include "oox/drawingml/fillproperties.hxx"
 
 namespace oox { namespace ppt {
 
 // ---------------------------------------------------------------------
 
-class BackgroundPropertiesContext : public ::oox::core::ContextHandler
+class BackgroundPropertiesContext : public ::oox::core::FragmentHandler2
 {
 public:
-    BackgroundPropertiesContext( ::oox::core::ContextHandler& rParent, ::oox::drawingml::FillProperties& rFillProperties ) throw();
-    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);
+    BackgroundPropertiesContext( ::oox::core::FragmentHandler2& rParent, ::oox::drawingml::FillProperties& rFillProperties );
+    virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs );
 
 protected:
     ::oox::drawingml::FillProperties& mrFillProperties;
diff --git a/oox/inc/oox/ppt/customshowlistcontext.hxx b/oox/inc/oox/ppt/customshowlistcontext.hxx
index 4885cdd..0254dbe 100644
--- a/oox/inc/oox/ppt/customshowlistcontext.hxx
+++ b/oox/inc/oox/ppt/customshowlistcontext.hxx
@@ -31,7 +31,7 @@
 #ifndef OOX_POWERPOINT_CUSTOMSHOWLISTCONTEXT_HXX
 #define OOX_POWERPOINT_CUSTOMSHOWLISTCONTEXT_HXX
 
-#include "oox/core/contexthandler.hxx"
+#include "oox/core/fragmenthandler2.hxx"
 #include <vector>
 
 namespace oox { namespace ppt {
@@ -45,18 +45,16 @@ namespace oox { namespace ppt {
     };
 
     /** CT_ */
-    class CustomShowListContext : public ::oox::core::ContextHandler
+    class CustomShowListContext : public ::oox::core::FragmentHandler2
     {
         std::vector< CustomShow >& mrCustomShowList;
 
     public:
-        CustomShowListContext( ::oox::core::ContextHandler& rParent,
+        CustomShowListContext( ::oox::core::FragmentHandler2& rParent,
                 std::vector< CustomShow >& rCustomShowList );
 
         ~CustomShowListContext( );
-        virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL
-            createFastChildContext( ::sal_Int32 aElementToken, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& /*xAttribs*/ )
-                throw ( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
+        virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs );
     };
 
 } }
diff --git a/oox/inc/oox/ppt/layoutfragmenthandler.hxx b/oox/inc/oox/ppt/layoutfragmenthandler.hxx
index aab47b1..f79adaf 100644
--- a/oox/inc/oox/ppt/layoutfragmenthandler.hxx
+++ b/oox/inc/oox/ppt/layoutfragmenthandler.hxx
@@ -41,8 +41,7 @@ public:
     LayoutFragmentHandler( ::oox::core::XmlFilterBase& rFilter, const ::rtl::OUString& rFragmentPath, SlidePersistPtr pMasterPersistPtr ) throw();
     virtual ~LayoutFragmentHandler() throw();
 
-    virtual void SAL_CALL endDocument() 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);
+    virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs );
 };
 
 } }
diff --git a/oox/inc/oox/ppt/presentationfragmenthandler.hxx b/oox/inc/oox/ppt/presentationfragmenthandler.hxx
index 94b16bb..570459a 100644
--- a/oox/inc/oox/ppt/presentationfragmenthandler.hxx
+++ b/oox/inc/oox/ppt/presentationfragmenthandler.hxx
@@ -33,7 +33,9 @@
 #include <com/sun/star/awt/Size.hpp>
 #include "oox/drawingml/textliststyle.hxx"
 #include "oox/ppt/slidepersist.hxx"
+#include "oox/core/contexthandler.hxx"
 #include "oox/core/fragmenthandler.hxx"
+#include "oox/core/fragmenthandler2.hxx"
 #include "oox/core/relations.hxx"
 #include "oox/ppt/customshowlistcontext.hxx"
 
@@ -42,15 +44,13 @@
 
 namespace oox { namespace ppt {
 
-class PresentationFragmentHandler : public ::oox::core::FragmentHandler
+class PresentationFragmentHandler : public ::oox::core::FragmentHandler2
 {
 public:
     PresentationFragmentHandler( ::oox::core::XmlFilterBase& rFilter, const ::rtl::OUString& rFragmentPath ) throw();
     virtual ~PresentationFragmentHandler() throw();
-
-    virtual void SAL_CALL startDocument(  ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
-    virtual void SAL_CALL endDocument(  ) 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);
+    virtual void finalizeImport();
+    virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs );
 
 protected:
     bool importSlide( const ::oox::core::FragmentHandlerRef& rxSlideFragmentHandler,
diff --git a/oox/inc/oox/ppt/slidefragmenthandler.hxx b/oox/inc/oox/ppt/slidefragmenthandler.hxx
index db4a809..f877a3e 100644
--- a/oox/inc/oox/ppt/slidefragmenthandler.hxx
+++ b/oox/inc/oox/ppt/slidefragmenthandler.hxx
@@ -31,7 +31,7 @@
 
 #include <com/sun/star/drawing/XDrawPage.hpp>
 #include "oox/helper/propertymap.hxx"
-#include "oox/core/fragmenthandler.hxx"
+#include "oox/core/fragmenthandler2.hxx"
 #include "oox/ppt/slidepersist.hxx"
 
 #include <stack>
@@ -40,14 +40,14 @@
 
 namespace oox { namespace ppt {
 
-class SlideFragmentHandler : public ::oox::core::FragmentHandler
+class SlideFragmentHandler : public ::oox::core::FragmentHandler2
 {
 public:
     SlideFragmentHandler( ::oox::core::XmlFilterBase& rFilter, const ::rtl::OUString& rFragmentPath, SlidePersistPtr pPersistPtr, const ShapeLocation eShapeLocation ) throw();
     virtual ~SlideFragmentHandler() throw();
 
-    virtual void SAL_CALL endDocument(  ) 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);
+    virtual void finalizeImport();
+    virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs );
 
 protected:
     SlidePersistPtr     mpSlidePersistPtr;
diff --git a/oox/inc/oox/ppt/slidemastertextstylescontext.hxx b/oox/inc/oox/ppt/slidemastertextstylescontext.hxx
index 8361a78..e88e199 100644
--- a/oox/inc/oox/ppt/slidemastertextstylescontext.hxx
+++ b/oox/inc/oox/ppt/slidemastertextstylescontext.hxx
@@ -31,17 +31,17 @@
 
 #include "oox/drawingml/theme.hxx"
 #include "oox/core/contexthandler.hxx"
-#include "oox/core/fragmenthandler.hxx"
+#include "oox/core/fragmenthandler2.hxx"
 #include "oox/ppt/slidepersist.hxx"
 
 namespace oox { namespace ppt {
 
-class SlideMasterTextStylesContext : public oox::core::ContextHandler
+class SlideMasterTextStylesContext : public oox::core::FragmentHandler2
 {
 public:
-    SlideMasterTextStylesContext( ::oox::core::ContextHandler& rParent, SlidePersistPtr pSlidePersistPtr );
+    SlideMasterTextStylesContext( ::oox::core::FragmentHandler2& rParent, SlidePersistPtr pSlidePersistPtr );
     ~SlideMasterTextStylesContext();
-    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);
+    virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs );
 
 protected:
     SlidePersistPtr     mpSlidePersistPtr;
diff --git a/oox/inc/oox/ppt/slidetimingcontext.hxx b/oox/inc/oox/ppt/slidetimingcontext.hxx
index ae8f9cb..bdc20b0 100644
--- a/oox/inc/oox/ppt/slidetimingcontext.hxx
+++ b/oox/inc/oox/ppt/slidetimingcontext.hxx
@@ -31,23 +31,20 @@
 
 #include <com/sun/star/animations/XTimeContainer.hpp>
 #include "oox/ppt/timenode.hxx"
-#include "oox/core/contexthandler.hxx"
+#include "oox/core/fragmenthandler2.hxx"
 
 #include <stack>
 #include <vector>
 
 namespace oox { namespace ppt {
 
-class SlideTimingContext : public ::oox::core::ContextHandler
+class SlideTimingContext : public ::oox::core::FragmentHandler2
 {
 public:
-    SlideTimingContext( ::oox::core::ContextHandler& rParent, TimeNodePtrList & aTimeNodeList ) throw();
+    SlideTimingContext( ::oox::core::FragmentHandler2& rParent, TimeNodePtrList & aTimeNodeList ) throw();
     virtual ~SlideTimingContext() throw();
 
-    virtual void SAL_CALL endDocument(  ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
-        virtual void SAL_CALL endFastElement( sal_Int32 aElement ) 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);
+    virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs );
 
 private:
     TimeNodePtrList & maTimeNodeList;
diff --git a/oox/inc/oox/ppt/slidetransitioncontext.hxx b/oox/inc/oox/ppt/slidetransitioncontext.hxx
index c956b23..0e3c20b 100644
--- a/oox/inc/oox/ppt/slidetransitioncontext.hxx
+++ b/oox/inc/oox/ppt/slidetransitioncontext.hxx
@@ -29,26 +29,24 @@
 #ifndef OOX_PPT_SLIDETRANSITIONCONTEXT
 #define OOX_PPT_SLIDETRANSITIONCONTEXT
 
-#include "oox/core/contexthandler.hxx"
+#include "oox/core/fragmenthandler2.hxx"
 #include "oox/ppt/slidetransition.hxx"
 
 namespace oox { class PropertyMap; }
 
 namespace oox { namespace ppt {
 
-    class SlideTransitionContext : public ::oox::core::ContextHandler
+    class SlideTransitionContext : public ::oox::core::FragmentHandler2
     {
     public:
-        SlideTransitionContext( ::oox::core::ContextHandler& rParent,
-            const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& xAttributes,
+        SlideTransitionContext( ::oox::core::FragmentHandler2& rParent,
+            const AttributeList& rAttributes,
             PropertyMap & aProperties ) throw();
         virtual ~SlideTransitionContext() throw();
 
-    virtual void SAL_CALL endFastElement( sal_Int32 aElement ) 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);
+    virtual void onEndElement();
+    virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs );
+
 
     private:
         PropertyMap&                    maSlideProperties;
diff --git a/oox/inc/oox/ppt/soundactioncontext.hxx b/oox/inc/oox/ppt/soundactioncontext.hxx
index fcea10b..b11702a 100644
--- a/oox/inc/oox/ppt/soundactioncontext.hxx
+++ b/oox/inc/oox/ppt/soundactioncontext.hxx
@@ -30,20 +30,20 @@
 #ifndef OOX_PPT_SOUNDACTIONCONTEXT
 #define OOX_PPT_SOUNDACTIONCONTEXT
 
-#include "oox/core/contexthandler.hxx"
+#include "oox/core/fragmenthandler2.hxx"
 
 namespace oox { class PropertyMap; }
 
 namespace oox { namespace ppt {
 
-class SoundActionContext : public ::oox::core::ContextHandler
+class SoundActionContext : public ::oox::core::FragmentHandler2
 {
 public:
-    SoundActionContext( ::oox::core::ContextHandler& rParent, PropertyMap & aProperties ) throw();
+    SoundActionContext( ::oox::core::FragmentHandler2& rParent, PropertyMap & aProperties ) throw();
     virtual ~SoundActionContext() throw();
 
-    virtual void SAL_CALL endFastElement( sal_Int32 aElement ) 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);
+    virtual void onEndElement();
+    virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs );
 
 private:
     PropertyMap&                    maSlideProperties;
diff --git a/oox/inc/oox/ppt/timenodelistcontext.hxx b/oox/inc/oox/ppt/timenodelistcontext.hxx
index 9f86df5..0d9c25e 100644
--- a/oox/inc/oox/ppt/timenodelistcontext.hxx
+++ b/oox/inc/oox/ppt/timenodelistcontext.hxx
@@ -29,7 +29,7 @@
 #ifndef OOX_PPT_TIMENODELISTCONTEXT
 #define OOX_PPT_TIMENODELISTCONTEXT
 
-#include "oox/core/contexthandler.hxx"
+#include "oox/core/fragmenthandler2.hxx"
 #include "oox/ppt/timenode.hxx"
 
 #include <com/sun/star/animations/XTimeContainer.hpp>
@@ -37,15 +37,15 @@
 namespace oox { namespace ppt {
 
 
-    class TimeNodeContext : public ::oox::core::ContextHandler
+    class TimeNodeContext : public ::oox::core::FragmentHandler2
     {
     public:
         virtual ~TimeNodeContext() throw();
 
-        static TimeNodeContext * SAL_CALL makeContext( ::oox::core::ContextHandler& rParent, sal_Int32  aElement, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& xAttribs, const TimeNodePtr & pNode );
+        static TimeNodeContext * SAL_CALL makeContext( ::oox::core::FragmentHandler2& rParent, sal_Int32  aElement, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& xAttribs, const TimeNodePtr & pNode );
 
     protected:
-        TimeNodeContext( ::oox::core::ContextHandler& rParent, sal_Int32  aElement, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& xAttribs, const TimeNodePtr & pNode ) throw();
+        TimeNodeContext( ::oox::core::FragmentHandler2& rParent, sal_Int32  aElement, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& xAttribs, const TimeNodePtr & pNode ) throw();
 
         sal_Int32 mnElement;
         TimeNodePtr mpNode;
@@ -54,17 +54,14 @@ namespace oox { namespace ppt {
 
 
 /** FastParser context for XML_tnLst, XML_subTnLst and XML_childTnLst */
-class TimeNodeListContext : public ::oox::core::ContextHandler
+class TimeNodeListContext : public ::oox::core::FragmentHandler2
 {
 public:
-    TimeNodeListContext( ::oox::core::ContextHandler& rParent, TimeNodePtrList & aList ) throw();
+    TimeNodeListContext( ::oox::core::FragmentHandler2& rParent, TimeNodePtrList & aList ) throw();
 
     virtual ~TimeNodeListContext() throw();
+    virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs );
 
-    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:
     TimeNodePtrList & maList;
diff --git a/oox/source/ppt/animvariantcontext.cxx b/oox/source/ppt/animvariantcontext.cxx
index cd87377..700fd60 100644
--- a/oox/source/ppt/animvariantcontext.cxx
+++ b/oox/source/ppt/animvariantcontext.cxx
@@ -48,8 +48,8 @@ using namespace ::com::sun::star::xml::sax;
 
 namespace oox { namespace ppt {
 
-    AnimVariantContext::AnimVariantContext( ContextHandler& rParent, sal_Int32 aElement, Any & aValue )
-        : ContextHandler( rParent )
+    AnimVariantContext::AnimVariantContext( FragmentHandler2& rParent, sal_Int32 aElement, Any & aValue )
+        : FragmentHandler2( rParent )
             , mnElement( aElement )
             , maValue( aValue )
     {
@@ -59,63 +59,52 @@ namespace oox { namespace ppt {
     {
     }
 
-    void SAL_CALL AnimVariantContext::endFastElement( sal_Int32 aElement )
-        throw ( SAXException, RuntimeException)
+    void AnimVariantContext::onEndElement()
     {
-        if( ( aElement == mnElement ) && maColor.isUsed() )
+        if( isCurrentElement( mnElement ) && maColor.isUsed() )
         {
             maValue = makeAny( maColor.getColor( getFilter().getGraphicHelper() ) );
         }
     }
 
 
-    Reference< XFastContextHandler >
-    SAL_CALL AnimVariantContext::createFastChildContext( ::sal_Int32 aElementToken,
-                             const Reference< XFastAttributeList >& xAttribs )
-        throw ( SAXException, RuntimeException )
+    ContextHandlerRef AnimVariantContext::onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs )
     {
-        Reference< XFastContextHandler > xRet;
-        AttributeList attribs(xAttribs);
-
         switch( aElementToken )
         {
         case PPT_TOKEN( boolVal ):
         {
-            bool val = attribs.getBool( XML_val, false );
+            bool val = rAttribs.getBool( XML_val, false );
             maValue = makeAny( val );
-            break;
+            return this;
         }
         case PPT_TOKEN( clrVal ):
-            xRet.set( new ::oox::drawingml::ColorContext( *this, maColor ) );
+            return new ::oox::drawingml::ColorContext( *this, maColor );
             // we'll defer setting the Any until the end.
-            break;
         case PPT_TOKEN( fltVal ):
         {
-            double val = attribs.getDouble( XML_val, 0.0 );
+            double val = rAttribs.getDouble( XML_val, 0.0 );
             maValue = makeAny( val );
-            break;
+            return this;
         }
         case PPT_TOKEN( intVal ):
         {
-            sal_Int32 val = attribs.getInteger( XML_val, 0 );
+            sal_Int32 val = rAttribs.getInteger( XML_val, 0 );
             maValue = makeAny( val );
-            break;
+            return this;
         }
         case PPT_TOKEN( strVal ):
         {
-            OUString val = attribs.getString( XML_val, OUString() );
+            OUString val = rAttribs.getString( XML_val, OUString() );
             convertMeasure( val ); // ignore success or failure if it fails, use as is
             maValue = makeAny( val );
-            break;
+            return this;
         }
         default:
             break;
         }
 
-        if( !xRet.is() )
-            xRet.set( this );
-
-        return xRet;
+        return this;
     }
 
 
diff --git a/oox/source/ppt/animvariantcontext.hxx b/oox/source/ppt/animvariantcontext.hxx
index afb1f2e..f4dca38 100644
--- a/oox/source/ppt/animvariantcontext.hxx
+++ b/oox/source/ppt/animvariantcontext.hxx
@@ -34,20 +34,20 @@
 
 #include <com/sun/star/uno/Any.hxx>
 
-#include "oox/core/contexthandler.hxx"
+#include "oox/core/fragmenthandler2.hxx"
 #include "oox/drawingml/color.hxx"
 
 namespace oox { namespace ppt {
 
     /** context CT_TLAnimVariant */
     class AnimVariantContext
-        : public ::oox::core::ContextHandler
+        : public ::oox::core::FragmentHandler2
     {
     public:
-        AnimVariantContext( ::oox::core::ContextHandler& rParent, ::sal_Int32 aElement, ::com::sun::star::uno::Any & aValue );
+        AnimVariantContext( ::oox::core::FragmentHandler2& rParent, ::sal_Int32 aElement, ::com::sun::star::uno::Any & aValue );
         ~AnimVariantContext( ) throw( );
-        virtual void SAL_CALL endFastElement( sal_Int32 /*aElement*/ ) 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 aElementToken, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& xAttribs ) throw ( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
+        virtual void onEndElement();
+        virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs );
 
     private:
         ::sal_Int32 mnElement;
diff --git a/oox/source/ppt/backgroundproperties.cxx b/oox/source/ppt/backgroundproperties.cxx
index d062f89..c5a4b36 100644
--- a/oox/source/ppt/backgroundproperties.cxx
+++ b/oox/source/ppt/backgroundproperties.cxx
@@ -29,6 +29,7 @@
 #include "oox/ppt/backgroundproperties.hxx"
 #include "oox/drawingml/fillpropertiesgroupcontext.hxx"
 #include "oox/drawingml/drawingmltypes.hxx"
+#include "oox/core/contexthandler2.hxx"
 
 using ::rtl::OUString;
 using namespace ::oox::core;
@@ -38,27 +39,22 @@ using namespace ::com::sun::star::xml::sax;
 namespace oox { namespace ppt {
 // ---------------------------------------------------------------------
 
-BackgroundPropertiesContext::BackgroundPropertiesContext( ContextHandler& rParent, ::oox::drawingml::FillProperties& rFillProperties ) throw()
-: ContextHandler( rParent )
+BackgroundPropertiesContext::BackgroundPropertiesContext( FragmentHandler2& rParent, ::oox::drawingml::FillProperties& rFillProperties )
+: FragmentHandler2( rParent )
 , mrFillProperties( rFillProperties )
 {
 }
 
-Reference< XFastContextHandler > BackgroundPropertiesContext::createFastChildContext( sal_Int32 aElementToken, const Reference< XFastAttributeList >& xAttribs ) throw (SAXException, RuntimeException)
+::oox::core::ContextHandlerRef BackgroundPropertiesContext::onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs )
 {
-    Reference< XFastContextHandler > xRet;
-
     switch( aElementToken )
     {
     case PPT_TOKEN( fill ):	// a:CT_FillEffect
-        break;
+        return this;
     }
 
     // FillPropertiesGroupContext
-    if( !xRet.is() )
-        xRet = ::oox::drawingml::FillPropertiesContext::createFillContext( *this, aElementToken, xAttribs, mrFillProperties );
-
-    return xRet;
+    return dynamic_cast <ContextHandler *> (::oox::drawingml::FillPropertiesContext::createFillContext( *this, aElementToken, rAttribs.getFastAttributeList(), mrFillProperties ).get());
 }
 
 } }
diff --git a/oox/source/ppt/buildlistcontext.cxx b/oox/source/ppt/buildlistcontext.cxx
index c7b48a4..a246154 100644
--- a/oox/source/ppt/buildlistcontext.cxx
+++ b/oox/source/ppt/buildlistcontext.cxx
@@ -38,10 +38,10 @@ using ::rtl::OUString;
 
 namespace oox { namespace ppt {
 
-    BuildListContext::BuildListContext( ContextHandler& rParent,
+    BuildListContext::BuildListContext( FragmentHandler2& rParent,
                 const Reference< XFastAttributeList >& /*xAttribs*/,
                 TimeNodePtrList & aTimeNodeList)
-        : ContextHandler( rParent )
+        : FragmentHandler2( rParent )
         , maTimeNodeList( aTimeNodeList )
         , mbInBldGraphic( false )
         ,	mbBuildAsOne( false )
@@ -52,9 +52,9 @@ namespace oox { namespace ppt {
     {
     }
 
-    void SAL_CALL BuildListContext::endFastElement( sal_Int32 aElement ) throw ( SAXException, RuntimeException)
+    void BuildListContext::onEndElement()
     {
-        switch( aElement )
+        switch( getCurrentElement() )
         {
         case PPT_TOKEN( bldGraphic ):
             mbInBldGraphic = false;
@@ -64,12 +64,8 @@ namespace oox { namespace ppt {
         }
     }
 
-    Reference< XFastContextHandler > SAL_CALL BuildListContext::createFastChildContext( ::sal_Int32 aElementToken,
-                                                                                                                                                                         const Reference< XFastAttributeList >& xAttribs )
-        throw ( SAXException, RuntimeException )
+    ::oox::core::ContextHandlerRef BuildListContext::onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs )
     {
-        Reference< XFastContextHandler > xRet;
-
         switch( aElementToken )
         {
         case PPT_TOKEN( bldAsOne ):
@@ -77,36 +73,31 @@ namespace oox { namespace ppt {
             {
                 mbBuildAsOne = true;
             }
-            break;
+            return this;
         case PPT_TOKEN( bldSub ):
             if( mbInBldGraphic )
             {
             }
-            break;
+            return this;
         case PPT_TOKEN( bldGraphic ):
         {
             mbInBldGraphic = true;
-            AttributeList attribs( xAttribs );
-            OUString sShapeId = xAttribs->getOptionalValue( XML_spid );
+            OUString sShapeId = rAttribs.getString( XML_spid, OUString() );
 // TODO
-//		bool uiExpand = attribs.getBool( XML_uiExpand, true );
+//		bool uiExpand = rAttribs.getBool( XML_uiExpand, true );
                 /* this is unsigned */
-//		sal_uInt32 nGroupId =  attribs.getUnsignedInteger( XML_grpId, 0 );
-            break;
+//		sal_uInt32 nGroupId =  rAttribs.getUnsignedInteger( XML_grpId, 0 );
+        return this;
         }
         case A_TOKEN( bldDgm ):
         case A_TOKEN( bldOleChart ):
         case A_TOKEN( bldP ):
-
-            break;
+            return this;
         default:
             break;
         }
 
-        if( !xRet.is() )
-            xRet.set(this);
-
-        return xRet;
+        return this;
     }
 
 
diff --git a/oox/source/ppt/buildlistcontext.hxx b/oox/source/ppt/buildlistcontext.hxx
index ececa02..1a2b05b 100644
--- a/oox/source/ppt/buildlistcontext.hxx
+++ b/oox/source/ppt/buildlistcontext.hxx
@@ -32,25 +32,25 @@
 #define OOX_PPT_BUILDLISTCONTEXT
 
 #include "oox/ppt/timenode.hxx"
-#include "oox/core/contexthandler.hxx"
+#include "oox/core/fragmenthandler2.hxx"
 
 namespace oox { namespace ppt {
 
 
     /** CT_BuildList */
     class BuildListContext
-        : public ::oox::core::ContextHandler
+        : public ::oox::core::FragmentHandler2
     {
     public:
-        BuildListContext( ::oox::core::ContextHandler& rParent,
+        BuildListContext( ::oox::core::FragmentHandler2& rParent,
                 const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& xAttribs,
                 TimeNodePtrList & aTimeNodeList);
 
         ~BuildListContext( );
 
-        virtual void SAL_CALL endFastElement( sal_Int32 aElement ) throw ( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+        virtual void onEndElement();
 
-        virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 aElementToken, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& /*xAttribs*/ ) throw ( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
+        virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs );
     private:
         TimeNodePtrList & maTimeNodeList;
         bool              mbInBldGraphic;
diff --git a/oox/source/ppt/commonbehaviorcontext.cxx b/oox/source/ppt/commonbehaviorcontext.cxx
index 750d273..56b3297 100644
--- a/oox/source/ppt/commonbehaviorcontext.cxx
+++ b/oox/source/ppt/commonbehaviorcontext.cxx
@@ -53,7 +53,7 @@ using namespace ::com::sun::star::animations;
 
 namespace oox { namespace ppt {
 
-    CommonBehaviorContext::CommonBehaviorContext( ContextHandler& rParent,
+    CommonBehaviorContext::CommonBehaviorContext( FragmentHandler2& rParent,
             const Reference< XFastAttributeList >& xAttribs,
             const TimeNodePtr & pNode )
         : TimeNodeContext( rParent, PPT_TOKEN( cBhvr ), xAttribs, pNode )
@@ -69,10 +69,9 @@ namespace oox { namespace ppt {
 
 
 
-    void SAL_CALL CommonBehaviorContext::endFastElement( sal_Int32 aElement )
-        throw ( SAXException, RuntimeException)
+    void CommonBehaviorContext::onEndElement()
     {
-        switch( aElement )
+        switch( getCurrentElement() )
         {
         case PPT_TOKEN( cBhvr ):
         {
@@ -126,8 +125,7 @@ namespace oox { namespace ppt {
     }
 
 
-    void CommonBehaviorContext::characters( const OUString& aChars )
-        throw( SAXException, RuntimeException )
+    void CommonBehaviorContext::onCharacters( const OUString& aChars )
     {
         if( mbIsInAttrName )
         {
@@ -136,23 +134,17 @@ namespace oox { namespace ppt {
     }
 
 
-    Reference< XFastContextHandler > SAL_CALL CommonBehaviorContext::createFastChildContext( ::sal_Int32 aElementToken,
-                                                                                                                                                                                     const Reference< XFastAttributeList >& xAttribs )
-        throw ( SAXException, RuntimeException )
+    ::oox::core::ContextHandlerRef CommonBehaviorContext::onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs )
     {
-        Reference< XFastContextHandler > xRet;
-
         switch ( aElementToken )
         {
         case PPT_TOKEN( cTn ):
-            xRet.set( new CommonTimeNodeContext( *this, aElementToken, xAttribs, mpNode ) );
-            break;
+            return new CommonTimeNodeContext( *this, aElementToken, rAttribs.getFastAttributeList(), mpNode );
         case PPT_TOKEN( tgtEl ):
-            xRet.set( new TimeTargetElementContext( *this, mpNode->getTarget() ) );
-            break;
+            return new TimeTargetElementContext( *this, mpNode->getTarget() );
         case PPT_TOKEN( attrNameLst ):
             mbInAttrList = true;
-            break;
+            return this;
         case PPT_TOKEN( attrName ):
         {
             if( mbInAttrList )
@@ -164,16 +156,13 @@ namespace oox { namespace ppt {
             {
                 OSL_TRACE( "OOX: Attribute Name outside an Attribute List" );
             }
-            break;
+            return this;
         }
         default:
             break;
         }
 
-        if( !xRet.is() )
-            xRet.set( this );
-
-        return xRet;
+        return this;
     }
 
 } }
diff --git a/oox/source/ppt/commonbehaviorcontext.hxx b/oox/source/ppt/commonbehaviorcontext.hxx
index f9556dd..bc60f67 100644
--- a/oox/source/ppt/commonbehaviorcontext.hxx
+++ b/oox/source/ppt/commonbehaviorcontext.hxx
@@ -50,24 +50,17 @@ namespace oox { namespace ppt {
         : public TimeNodeContext
     {
     public:
-        CommonBehaviorContext( ::oox::core::ContextHandler& rParent,
+        CommonBehaviorContext( ::oox::core::FragmentHandler2& rParent,
              const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& xAttribs,
              const TimeNodePtr & pNode );
         ~CommonBehaviorContext( )
             throw( );
 
-        virtual void SAL_CALL endFastElement( sal_Int32 aElement )
-            throw ( ::com::sun::star::xml::sax::SAXException,
-                            ::com::sun::star::uno::RuntimeException );
+        virtual void onEndElement();
 
-        virtual void SAL_CALL characters( const ::rtl::OUString& aChars )
-            throw ( ::com::sun::star::xml::sax::SAXException,
-                            ::com::sun::star::uno::RuntimeException );
+        virtual void onCharacters( const ::rtl::OUString& aChars );
 
-        virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 aElementToken,
-                                                                                                                                                                                                                                                                 const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& /*xAttribs*/ )
-            throw ( ::com::sun::star::xml::sax::SAXException,
-                            ::com::sun::star::uno::RuntimeException );
+        virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs );
 
     private:
         bool              mbInAttrList;
diff --git a/oox/source/ppt/commontimenodecontext.cxx b/oox/source/ppt/commontimenodecontext.cxx
index db7b116..dd7aa9e 100644
--- a/oox/source/ppt/commontimenodecontext.cxx
+++ b/oox/source/ppt/commontimenodecontext.cxx
@@ -374,7 +374,7 @@ static OUString getConvertedSubType( sal_Int16 nPresetClass, sal_Int32 nPresetId
 // END
 
     CommonTimeNodeContext::CommonTimeNodeContext(
-            ContextHandler& rParent,
+            FragmentHandler2& rParent,
             sal_Int32  aElement,
             const Reference< XFastAttributeList >& xAttribs,
             const TimeNodePtr & pNode )
@@ -614,39 +614,34 @@ static OUString getConvertedSubType( sal_Int16 nPresetClass, sal_Int32 nPresetId
     }
 
 
-    void SAL_CALL CommonTimeNodeContext::endFastElement( sal_Int32 aElement ) throw ( SAXException, RuntimeException)
+    void CommonTimeNodeContext::onEndElement()
     {
-        if( aElement == ( PPT_TOKEN( iterate ) ) )
+        if( isCurrentElement( PPT_TOKEN( iterate ) ) )
         {
             mbIterate = false;
         }
     }
 
 
-    Reference< XFastContextHandler > SAL_CALL CommonTimeNodeContext::createFastChildContext( ::sal_Int32 aElementToken, const Reference< XFastAttributeList >& xAttribs ) throw ( SAXException, RuntimeException )
+    ::oox::core::ContextHandlerRef CommonTimeNodeContext::onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs )
     {
-        Reference< XFastContextHandler > xRet;
 
         switch ( aElementToken )
         {
         case PPT_TOKEN( childTnLst ):
         case PPT_TOKEN( subTnLst ):
-            xRet.set( new TimeNodeListContext( *this, mpNode->getChildren() ) );
-            break;
+            return new TimeNodeListContext( *this, mpNode->getChildren() );
 
         case PPT_TOKEN( stCondLst ):
-            xRet.set( new CondListContext( *this, aElementToken, xAttribs, mpNode, mpNode->getStartCondition() ) );
-            break;
+            return new CondListContext( *this, aElementToken, rAttribs.getFastAttributeList(), mpNode, mpNode->getStartCondition() );
         case PPT_TOKEN( endCondLst ):
-            xRet.set( new CondListContext( *this, aElementToken, xAttribs, mpNode, mpNode->getEndCondition() ) );
-            break;
+            return new CondListContext( *this, aElementToken, rAttribs.getFastAttributeList(), mpNode, mpNode->getEndCondition() );
 
         case PPT_TOKEN( endSync ):
-            xRet.set( new CondContext( *this, xAttribs, mpNode, mpNode->getEndSyncValue() ) );
-            break;
+            return new CondContext( *this, rAttribs.getFastAttributeList(), mpNode, mpNode->getEndSyncValue() );
         case PPT_TOKEN( iterate ):
         {
-            sal_Int32 nVal = xAttribs->getOptionalValueToken( XML_type, XML_el );
+            sal_Int32 nVal = rAttribs.getToken( XML_type, XML_el );
             if( nVal != 0 )
             {
                 // TODO put that in a function
@@ -671,37 +666,31 @@ static OUString getConvertedSubType( sal_Int16 nPresetClass, sal_Int32 nPresetId
                 mpNode->getNodeProperties()[ NP_ITERATETYPE ] <<= nEnum;
             }
             // in case of exception we ignore the whole tag.
-            AttributeList attribs( xAttribs );
             // TODO what to do with this
-            /*bool bBackwards =*/ attribs.getBool( XML_backwards, false );
+            /*bool bBackwards =*/ rAttribs.getBool( XML_backwards, false );
             mbIterate = true;
-            break;
+            return this;
         }
         case PPT_TOKEN( tmAbs ):
             if( mbIterate )
             {
-                AttributeList attribs( xAttribs );
-                double fTime = attribs.getUnsigned( XML_val, 0 );
+                double fTime = rAttribs.getUnsigned( XML_val, 0 );
                 // time in ms. property is in % TODO
                 mpNode->getNodeProperties()[ NP_ITERATEINTERVAL ] <<= fTime;
             }
-            break;
+            return this;
         case PPT_TOKEN( tmPct ):
             if( mbIterate )
             {
-                AttributeList attribs( xAttribs );
-                double fPercent = (double)attribs.getUnsigned( XML_val, 0 ) / 100000.0;
+                double fPercent = (double)rAttribs.getUnsigned( XML_val, 0 ) / 100000.0;
                 mpNode->getNodeProperties()[ NP_ITERATEINTERVAL ] <<= fPercent;
             }
-            break;
+            return this;
         default:
             break;
         }
 
-        if( !xRet.is() )
-            xRet.set( this );
-
-        return xRet;
+        return this;
     }
 
 } }
diff --git a/oox/source/ppt/commontimenodecontext.hxx b/oox/source/ppt/commontimenodecontext.hxx
index c4ae2f6..8059d43 100644
--- a/oox/source/ppt/commontimenodecontext.hxx
+++ b/oox/source/ppt/commontimenodecontext.hxx
@@ -44,12 +44,12 @@ namespace oox { namespace ppt {
         : public TimeNodeContext
     {
     public:
-        CommonTimeNodeContext( ::oox::core::ContextHandler& rParent, sal_Int32  aElement, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& xAttribs, const TimeNodePtr & pNode);
+        CommonTimeNodeContext( ::oox::core::FragmentHandler2& rParent, sal_Int32  aElement, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& xAttribs, const TimeNodePtr & pNode);
         ~CommonTimeNodeContext( ) throw( );
 
-        virtual void SAL_CALL endFastElement( sal_Int32 aElement ) throw ( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+        virtual void onEndElement();
 
-        virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 aElementToken, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& /*xAttribs*/ ) throw ( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
+        virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs );
 
     private:
         bool mbIterate;
diff --git a/oox/source/ppt/conditioncontext.cxx b/oox/source/ppt/conditioncontext.cxx
index 9b19228..325613f 100644
--- a/oox/source/ppt/conditioncontext.cxx
+++ b/oox/source/ppt/conditioncontext.cxx
@@ -51,7 +51,7 @@ using namespace ::com::sun::star::animations;
 
 namespace oox { namespace ppt {
 
-    CondContext::CondContext( ContextHandler& rParent, const Reference< XFastAttributeList >& xAttribs,
+    CondContext::CondContext( FragmentHandler2& rParent, const Reference< XFastAttributeList >& xAttribs,
                 const TimeNodePtr & pNode, AnimationCondition & aValue )
         :  TimeNodeContext( rParent, PPT_TOKEN( cond ), xAttribs, pNode )
         , maCond( aValue )
@@ -116,10 +116,8 @@ namespace oox { namespace ppt {
         }
     }
 
-    Reference< XFastContextHandler > SAL_CALL CondContext::createFastChildContext( ::sal_Int32 aElementToken, const Reference< XFastAttributeList >& xAttribs ) throw ( SAXException, RuntimeException )
+    ::oox::core::ContextHandlerRef CondContext::onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs )
     {
-        Reference< XFastContextHandler > xRet;
-
         switch( aElementToken )
         {
         case PPT_TOKEN( rtn ):
@@ -127,7 +125,7 @@ namespace oox { namespace ppt {
             // ST_TLTriggerRuntimeNode { first, last, all }
             sal_Int32 aTok;
             sal_Int16 nEnum;
-            aTok = xAttribs->getOptionalValueToken( XML_val, XML_first );
+            aTok = rAttribs.getToken( XML_val, XML_first );
             switch( aTok )
             {
             case XML_first:
@@ -144,28 +142,23 @@ namespace oox { namespace ppt {
             }
             maCond.mnType = aElementToken;
             maCond.maValue = makeAny( nEnum );
-            break;
+            return this;
         }
         case PPT_TOKEN( tn ):
         {
             maCond.mnType = aElementToken;
-            AttributeList attribs( xAttribs );
-            sal_uInt32 nId = attribs.getUnsigned( XML_val, 0 );
+            sal_uInt32 nId = rAttribs.getUnsigned( XML_val, 0 );
             maCond.maValue = makeAny( nId );
-            break;
+            return this;
         }
         case PPT_TOKEN( tgtEl ):
             // CT_TLTimeTargetElement
-            xRet.set( new TimeTargetElementContext( *this, maCond.getTarget() ) );
-            break;
+            return new TimeTargetElementContext( *this, maCond.getTarget() );
         default:
             break;
         }
 
-        if( !xRet.is() )
-            xRet.set( this );
-
-        return xRet;
+        return this;
 
     }
 
@@ -173,7 +166,7 @@ namespace oox { namespace ppt {
 
     /** CT_TLTimeConditionList */
     CondListContext::CondListContext(
-            ContextHandler& rParent, sal_Int32  aElement,
+            FragmentHandler2& rParent, sal_Int32  aElement,
             const Reference< XFastAttributeList >& xAttribs,
             const TimeNodePtr & pNode,
             AnimationConditionList & aCond )
@@ -187,25 +180,19 @@ namespace oox { namespace ppt {
     {
     }
 
-    Reference< XFastContextHandler > CondListContext::createFastChildContext( ::sal_Int32 aElement, const Reference< XFastAttributeList >& xAttribs ) throw ( SAXException, RuntimeException )
+    ::oox::core::ContextHandlerRef CondListContext::onCreateContext( sal_Int32 aElement, const AttributeList& rAttribs )
     {
-        Reference< XFastContextHandler > xRet;
-
         switch( aElement )
         {
         case PPT_TOKEN( cond ):
             // add a condition to the list
             maConditions.push_back( AnimationCondition() );
-            xRet.set( new CondContext( *this, xAttribs, mpNode, maConditions.back() ) );
+            return new CondContext( *this, rAttribs.getFastAttributeList(), mpNode, maConditions.back() );
             break;
         default:
             break;
         }
-
-        if( !xRet.is() )
-            xRet.set( this );
-
-        return xRet;
+        return this;
     }
 
 
diff --git a/oox/source/ppt/conditioncontext.hxx b/oox/source/ppt/conditioncontext.hxx
index d318b62..9397c59 100644
--- a/oox/source/ppt/conditioncontext.hxx
+++ b/oox/source/ppt/conditioncontext.hxx
@@ -46,11 +46,11 @@ namespace oox { namespace ppt {
         : public TimeNodeContext
     {
     public:
-        CondContext( ::oox::core::ContextHandler& rParent,
+        CondContext( ::oox::core::FragmentHandler2& rParent,
                      const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& xAttribs,
                      const TimeNodePtr & pNode, AnimationCondition & aCond );
         ~CondContext( ) throw( );
-        virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 aElementToken, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& xAttribs ) throw ( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
+        virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs );
 
     private:
 //		::com::sun::star::uno::Any &         maCond;
@@ -66,13 +66,13 @@ namespace oox { namespace ppt {
         : public TimeNodeContext
     {
     public:
-        CondListContext( ::oox::core::ContextHandler& rParent,
+        CondListContext( ::oox::core::FragmentHandler2& rParent,
              sal_Int32  aElement,
              const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& xAttribs,
              const TimeNodePtr & pNode, AnimationConditionList & aCondList );
         ~CondListContext( ) throw( );
 
-        virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 aElementToken, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& /*xAttribs*/ ) throw ( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
+       virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs );
 
     private:
         AnimationConditionList     & maConditions;
diff --git a/oox/source/ppt/customshowlistcontext.cxx b/oox/source/ppt/customshowlistcontext.cxx
index 713ffde..10dfe5b 100644
--- a/oox/source/ppt/customshowlistcontext.cxx
+++ b/oox/source/ppt/customshowlistcontext.cxx
@@ -34,24 +34,22 @@ using namespace ::com::sun::star::xml::sax;
 
 namespace oox { namespace ppt {
 
-class CustomShowContext : public ::oox::core::ContextHandler
+class CustomShowContext : public ::oox::core::FragmentHandler2
 {
     CustomShow mrCustomShow;
 
 public:
-    CustomShowContext( ::oox::core::ContextHandler& rParent,
+    CustomShowContext( ::oox::core::FragmentHandler2& rParent,
         const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& xAttribs,
             CustomShow& rCustomShow );
     ~CustomShowContext( );
-    virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL
-        createFastChildContext( ::sal_Int32 aElementToken, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& /*xAttribs*/ )
-            throw ( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
+    virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs );
 };
 
-CustomShowContext::CustomShowContext( ContextHandler& rParent,
+CustomShowContext::CustomShowContext( FragmentHandler2& rParent,
     const Reference< XFastAttributeList >& rxAttribs,
         CustomShow& rCustomShow )
-: ContextHandler( rParent )
+: FragmentHandler2( rParent )
 , mrCustomShow( rCustomShow )
 {
     mrCustomShow.maName = rxAttribs->getOptionalValue( XML_name );
@@ -62,29 +60,25 @@ CustomShowContext::~CustomShowContext( )
 {
 }
 
-Reference< XFastContextHandler > SAL_CALL CustomShowContext::createFastChildContext( sal_Int32 aElementToken,
-    const Reference< XFastAttributeList >& xAttribs )
-        throw ( SAXException, RuntimeException )
+::oox::core::ContextHandlerRef CustomShowContext::onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs )
 {
-    Reference< XFastContextHandler > xRet;
     switch( aElementToken )
     {
         case PPT_TOKEN( sld ) :
-            mrCustomShow.maSldLst.push_back( xAttribs->getOptionalValue( R_TOKEN( id ) ) );
+            mrCustomShow.maSldLst.push_back( rAttribs.getString( R_TOKEN( id ), rtl::OUString() ) );
+            return this;
         default:
         break;
     }
-    if( !xRet.is() )
-        xRet.set( this );
 
-    return xRet;
+    return this;
 }
 
 //---------------------------------------------------------------------------
 
-CustomShowListContext::CustomShowListContext( ContextHandler& rParent,
+CustomShowListContext::CustomShowListContext( FragmentHandler2& rParent,
     std::vector< CustomShow >& rCustomShowList )
-: ContextHandler( rParent )
+: FragmentHandler2( rParent )
 , mrCustomShowList( rCustomShowList )
 {
 }
@@ -93,26 +87,21 @@ CustomShowListContext::~CustomShowListContext( )
 {
 }
 
-Reference< XFastContextHandler > SAL_CALL CustomShowListContext::createFastChildContext( sal_Int32 aElementToken,
-    const Reference< XFastAttributeList >& xAttribs )
-        throw ( SAXException, RuntimeException )
+::oox::core::ContextHandlerRef CustomShowListContext::onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs )
 {
-    Reference< XFastContextHandler > xRet;
     switch( aElementToken )
     {
         case PPT_TOKEN( custShow ) :
         {
             CustomShow aCustomShow;
             mrCustomShowList.push_back( aCustomShow );
-            xRet = new CustomShowContext( *this, xAttribs, mrCustomShowList.back() );
+            return new CustomShowContext( *this, rAttribs.getFastAttributeList(), mrCustomShowList.back() );
         }
         default:
         break;
     }
-    if( !xRet.is() )
-        xRet.set( this );
 
-    return xRet;
+    return this;
 }
 
 
diff --git a/oox/source/ppt/headerfootercontext.cxx b/oox/source/ppt/headerfootercontext.cxx
index bdbd040..05371fc 100644
--- a/oox/source/ppt/headerfootercontext.cxx
+++ b/oox/source/ppt/headerfootercontext.cxx
@@ -35,26 +35,25 @@ using namespace ::com::sun::star::xml::sax;
 
 namespace oox { namespace ppt {
 
-    HeaderFooterContext::HeaderFooterContext( ContextHandler& rParent,
-        const Reference< XFastAttributeList >& xAttribs, HeaderFooter& rHeaderFooter )
-        : ContextHandler( rParent )
+    HeaderFooterContext::HeaderFooterContext( FragmentHandler2& rParent,
+        const AttributeList& rAttribs, HeaderFooter& rHeaderFooter )
+        : FragmentHandler2( rParent )
     {
-        AttributeList aAttribs( xAttribs );
-        if ( xAttribs->hasAttribute( XML_sldNum ) )
+        if ( rAttribs.hasAttribute( XML_sldNum ) )
         {
-            rHeaderFooter.mbSlideNumber = aAttribs.getBool( XML_sldNum, sal_True );
+            rHeaderFooter.mbSlideNumber = rAttribs.getBool( XML_sldNum, sal_True );
         }
-        if ( xAttribs->hasAttribute( XML_hdr ) )
+        if ( rAttribs.hasAttribute( XML_hdr ) )
         {
-            rHeaderFooter.mbHeader = aAttribs.getBool( XML_hdr, sal_True );
+            rHeaderFooter.mbHeader = rAttribs.getBool( XML_hdr, sal_True );
         }
-        if ( xAttribs->hasAttribute( XML_ftr ) )
+        if ( rAttribs.hasAttribute( XML_ftr ) )
         {
-            rHeaderFooter.mbFooter = aAttribs.getBool( XML_ftr, sal_True );
+            rHeaderFooter.mbFooter = rAttribs.getBool( XML_ftr, sal_True );
         }
-        if ( xAttribs->hasAttribute( XML_dt ) )
+        if ( rAttribs.hasAttribute( XML_dt ) )
         {
-            rHeaderFooter.mbDateTime = aAttribs.getBool( XML_dt, sal_True );
+            rHeaderFooter.mbDateTime = rAttribs.getBool( XML_dt, sal_True );
         }
     }
 
diff --git a/oox/source/ppt/headerfootercontext.hxx b/oox/source/ppt/headerfootercontext.hxx
index 229b055..9fe0b62 100644
--- a/oox/source/ppt/headerfootercontext.hxx
+++ b/oox/source/ppt/headerfootercontext.hxx
@@ -32,16 +32,16 @@
 #define OOX_PPT_HEADERFOOTERCONTEXT
 
 #include "oox/ppt/headerfooter.hxx"
-#include "oox/core/contexthandler.hxx"
+#include "oox/core/fragmenthandler2.hxx"
 
 namespace oox { namespace ppt {
 
     /** CT_HeaderFooter */
-    class HeaderFooterContext : public ::oox::core::ContextHandler
+    class HeaderFooterContext : public ::oox::core::FragmentHandler2
     {
     public:
-        HeaderFooterContext( ::oox::core::ContextHandler& rParent,
-            const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& xAttribs, HeaderFooter& rHeaderFooter );
+        HeaderFooterContext( ::oox::core::FragmentHandler2& rParent,
+            const AttributeList& rAttribs, HeaderFooter& rHeaderFooter );
 
         ~HeaderFooterContext( );
     };
diff --git a/oox/source/ppt/layoutfragmenthandler.cxx b/oox/source/ppt/layoutfragmenthandler.cxx
index 7e33c82..dcc6ce4 100644
--- a/oox/source/ppt/layoutfragmenthandler.cxx
+++ b/oox/source/ppt/layoutfragmenthandler.cxx
@@ -60,27 +60,20 @@ LayoutFragmentHandler::~LayoutFragmentHandler()
 
 }
 
-Reference< XFastContextHandler > LayoutFragmentHandler::createFastChildContext( sal_Int32 aElementToken, const Reference< XFastAttributeList >& xAttribs )
-    throw (SAXException, RuntimeException)
+ContextHandlerRef LayoutFragmentHandler::onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs )
 {
-    Reference< XFastContextHandler > xRet = getFastContextHandler();
     switch( aElementToken )
     {
         case PPT_TOKEN( sldLayout ):		// CT_SlideLayout
-            mpSlidePersistPtr->setLayoutValueToken( xAttribs->getOptionalValueToken( XML_type, 0 ) );	// CT_SlideLayoutType
+            mpSlidePersistPtr->setLayoutValueToken( rAttribs.getToken( XML_type, 0 ) );	// CT_SlideLayoutType
         break;
         case PPT_TOKEN( hf ):				// CT_HeaderFooter
-            xRet.set( new HeaderFooterContext( *this, xAttribs, mpSlidePersistPtr->getHeaderFooter() ) );
+            return new HeaderFooterContext( *this, rAttribs, mpSlidePersistPtr->getHeaderFooter() );
         break;
         default:
-            xRet.set( SlideFragmentHandler::createFastChildContext( aElementToken, xAttribs ) );
+            return SlideFragmentHandler::onCreateContext( aElementToken, rAttribs );
     }
-    return xRet;
-}
-
-void SAL_CALL LayoutFragmentHandler::endDocument()
-    throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException)
-{
+    return this;
 }
 
 } }
diff --git a/oox/source/ppt/presentationfragmenthandler.cxx b/oox/source/ppt/presentationfragmenthandler.cxx
index cbae082..73cd938 100644
--- a/oox/source/ppt/presentationfragmenthandler.cxx
+++ b/oox/source/ppt/presentationfragmenthandler.cxx
@@ -61,7 +61,7 @@ using namespace ::com::sun::star::xml::sax;
 namespace oox { namespace ppt {
 
 PresentationFragmentHandler::PresentationFragmentHandler( XmlFilterBase& rFilter, const OUString& rFragmentPath ) throw()
-: FragmentHandler( rFilter, rFragmentPath )
+: FragmentHandler2( rFilter, rFragmentPath )
 , mpTextListStyle( new TextListStyle )
 {
     TextParagraphPropertiesVector& rParagraphDefaulsVector( mpTextListStyle->getListStyle() );
@@ -76,10 +76,6 @@ PresentationFragmentHandler::PresentationFragmentHandler( XmlFilterBase& rFilter
 
 PresentationFragmentHandler::~PresentationFragmentHandler() throw()
 {
-
-}
-void PresentationFragmentHandler::startDocument() throw (SAXException, RuntimeException)
-{
 }
 
 void ResolveTextFields( XmlFilterBase& rFilter )
@@ -142,7 +138,7 @@ void ResolveTextFields( XmlFilterBase& rFilter )
     }
 }
 
-void PresentationFragmentHandler::endDocument() throw (SAXException, RuntimeException)
+void PresentationFragmentHandler::finalizeImport()
 {
     // todo: localized progress bar text
     const Reference< task::XStatusIndicator >& rxStatusIndicator( getFilter().getStatusIndicator() );
@@ -300,41 +296,36 @@ void PresentationFragmentHandler::endDocument() throw (SAXException, RuntimeExce
 }
 
 // CT_Presentation
-Reference< XFastContextHandler > PresentationFragmentHandler::createFastChildContext( sal_Int32 aElementToken, const Reference< XFastAttributeList >& xAttribs ) throw (SAXException, RuntimeException)
+::oox::core::ContextHandlerRef PresentationFragmentHandler::onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs )
 {
-    Reference< XFastContextHandler > xRet;
     switch( aElementToken )
     {
     case PPT_TOKEN( presentation ):
     case PPT_TOKEN( sldMasterIdLst ):
     case PPT_TOKEN( notesMasterIdLst ):
     case PPT_TOKEN( sldIdLst ):
-        break;
+        return this;
     case PPT_TOKEN( sldMasterId ):
-        maSlideMasterVector.push_back( xAttribs->getOptionalValue( R_TOKEN( id ) ) );
-        break;
+        maSlideMasterVector.push_back( rAttribs.getString( R_TOKEN( id ), OUString() ) );
+        return this;
     case PPT_TOKEN( sldId ):
-        maSlidesVector.push_back( xAttribs->getOptionalValue( R_TOKEN( id ) ) );
-        break;
+        maSlidesVector.push_back( rAttribs.getString( R_TOKEN( id ), OUString() ) );
+        return this;
     case PPT_TOKEN( notesMasterId ):
-        maNotesMasterVector.push_back( xAttribs->getOptionalValue(R_TOKEN( id ) ) );
-        break;
+        maNotesMasterVector.push_back( rAttribs.getString( R_TOKEN( id ), OUString() ) );
+        return this;
     case PPT_TOKEN( sldSz ):
-        maSlideSize = GetSize2D( xAttribs );
-        break;
+        maSlideSize = GetSize2D( rAttribs.getFastAttributeList() );
+        return this;
     case PPT_TOKEN( notesSz ):
-        maNotesSize = GetSize2D( xAttribs );
-        break;
+        maNotesSize = GetSize2D( rAttribs.getFastAttributeList() );
+        return this;
     case PPT_TOKEN( custShowLst ):
-        xRet.set( new CustomShowListContext( *this, maCustomShowList ) );
-        break;
+        return new CustomShowListContext( *this, maCustomShowList );
     case PPT_TOKEN( defaultTextStyle ):
-        xRet.set( new TextListStyleContext( *this, *mpTextListStyle ) );
-        break;
+        return new TextListStyleContext( *this, *mpTextListStyle );
     }
-    if ( !xRet.is() )
-        xRet = getFastContextHandler();
-    return xRet;
+    return this;
 }
 
 bool PresentationFragmentHandler::importSlide( const FragmentHandlerRef& rxSlideFragmentHandler,
diff --git a/oox/source/ppt/slidefragmenthandler.cxx b/oox/source/ppt/slidefragmenthandler.cxx
index cb185cc..80c36c4 100644
--- a/oox/source/ppt/slidefragmenthandler.cxx
+++ b/oox/source/ppt/slidefragmenthandler.cxx
@@ -59,7 +59,7 @@ using namespace ::com::sun::star::container;
 namespace oox { namespace ppt {
 
 SlideFragmentHandler::SlideFragmentHandler( XmlFilterBase& rFilter, const OUString& rFragmentPath, SlidePersistPtr pPersistPtr, const ShapeLocation eShapeLocation ) throw()
-: FragmentHandler( rFilter, rFragmentPath )
+: FragmentHandler2( rFilter, rFragmentPath )
 , mpSlidePersistPtr( pPersistPtr )
 , meShapeLocation( eShapeLocation )
 {
@@ -75,109 +75,102 @@ SlideFragmentHandler::~SlideFragmentHandler() throw()
     mpSlidePersistPtr->getDrawing()->convertAndInsert();
 }
 
-Reference< XFastContextHandler > SlideFragmentHandler::createFastChildContext( sal_Int32 aElementToken, const Reference< XFastAttributeList >& xAttribs ) throw (SAXException, RuntimeException)
+::oox::core::ContextHandlerRef SlideFragmentHandler::onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs )
 {
-    Reference< XFastContextHandler > xRet;
-    AttributeList aAttribs( xAttribs );
-
     switch( aElementToken )
     {
     case PPT_TOKEN( sldMaster ):		// CT_SlideMaster
     case PPT_TOKEN( handoutMaster ):	// CT_HandoutMaster
     case PPT_TOKEN( sld ):				// CT_CommonSlideData
     {
-        AttributeList attribs( xAttribs );
-
         Reference< XDrawPage > xSlide( mpSlidePersistPtr->getPage() );
         PropertyMap aPropMap;
         PropertySet aSlideProp( xSlide );
 
-        aPropMap[ PROP_Visible ] = Any( attribs.getBool( XML_show, sal_True ) );
+        aPropMap[ PROP_Visible ] = Any( rAttribs.getBool( XML_show, sal_True ) );
         aSlideProp.setProperties( aPropMap );
 
-        break;
+        return this;
     }
     case PPT_TOKEN( notes ):			// CT_NotesSlide
     case PPT_TOKEN( notesMaster ):		// CT_NotesMaster
-        break;
+        return this;
     case PPT_TOKEN( cSld ):				// CT_CommonSlideData
-        maSlideName = xAttribs->getOptionalValue(XML_name);
-        break;
+        maSlideName = rAttribs.getString(XML_name, OUString());
+        return this;
 
     case PPT_TOKEN( spTree ):			// CT_GroupShape
         {
-            xRet.set( new PPTShapeGroupContext(
+            // TODO Convert this to FragmentHandler2
+            return new PPTShapeGroupContext(
                 *this, mpSlidePersistPtr, meShapeLocation, mpSlidePersistPtr->getShapes(),
-                oox::drawingml::ShapePtr( new PPTShape( meShapeLocation, "com.sun.star.drawing.GroupShape" ) ) ) );
+                oox::drawingml::ShapePtr( new PPTShape( meShapeLocation, "com.sun.star.drawing.GroupShape" ) ) );
         }
         break;
 
     case PPT_TOKEN( controls ):
-        xRet = getFastContextHandler();
-        break;
+        return this;
     case PPT_TOKEN( control ):
         {
             ::oox::vml::ControlInfo aInfo;
-            aInfo.setShapeId( aAttribs.getInteger( XML_spid, 0 ) );
-            aInfo.maFragmentPath = getFragmentPathFromRelId( aAttribs.getString( R_TOKEN( id ), OUString() ) );
-            aInfo.maName = aAttribs.getXString( XML_name, OUString() );
+            aInfo.setShapeId( rAttribs.getInteger( XML_spid, 0 ) );
+            aInfo.maFragmentPath = getFragmentPathFromRelId( rAttribs.getString( R_TOKEN( id ), OUString() ) );
+            aInfo.maName = rAttribs.getXString( XML_name, OUString() );
             mpSlidePersistPtr->getDrawing()->registerControl( aInfo );
         }
-        return xRet;
+        return this;
 
     case PPT_TOKEN( timing ): // CT_SlideTiming
-        xRet.set( new SlideTimingContext( *this, mpSlidePersistPtr->getTimeNodeList() ) );
-        break;
+        return new SlideTimingContext( *this, mpSlidePersistPtr->getTimeNodeList() );
     case PPT_TOKEN( transition ): // CT_SlideTransition
-        xRet.set( new SlideTransitionContext( *this, xAttribs, maSlideProperties ) );
-        break;
+        return new SlideTransitionContext( *this, rAttribs, maSlideProperties );
     case PPT_TOKEN( hf ):
-        xRet.set( new HeaderFooterContext( *this, xAttribs, mpSlidePersistPtr->getHeaderFooter() ) );
-        break;
+        return new HeaderFooterContext( *this, rAttribs, mpSlidePersistPtr->getHeaderFooter() );
 
     // BackgroundGroup
+    case PPT_TOKEN( bg ):
+        return this;
     case PPT_TOKEN( bgPr ):				// CT_BackgroundProperties
         {
             FillPropertiesPtr pFillPropertiesPtr( new FillProperties );
-            xRet.set( new BackgroundPropertiesContext( *this, *pFillPropertiesPtr ) );
             mpSlidePersistPtr->setBackgroundProperties( pFillPropertiesPtr );
+            return new BackgroundPropertiesContext( *this, *pFillPropertiesPtr );
         }
         break;
 
     case PPT_TOKEN( bgRef ):			// a:CT_StyleMatrixReference
         {
             FillPropertiesPtr pFillPropertiesPtr( new FillProperties(
-                *mpSlidePersistPtr->getTheme()->getFillStyle( xAttribs->getOptionalValue( XML_idx ).toInt32() ) ) );
-            xRet.set( new ColorContext( *this, mpSlidePersistPtr->getBackgroundColor() ) );
+                *mpSlidePersistPtr->getTheme()->getFillStyle( rAttribs.getInteger( XML_idx, -1 ) ) ) );
+            ContextHandlerRef ret = new ColorContext( *this, mpSlidePersistPtr->getBackgroundColor() );
             mpSlidePersistPtr->setBackgroundProperties( pFillPropertiesPtr );
+            return ret;
         }
         break;
 
     case PPT_TOKEN( clrMap ):			// CT_ColorMapping
         {
             oox::drawingml::ClrMapPtr pClrMapPtr( new oox::drawingml::ClrMap() );
-            xRet.set( new oox::drawingml::clrMapContext( *this, xAttribs, *pClrMapPtr ) );
+            ContextHandlerRef ret = new oox::drawingml::clrMapContext( *this, rAttribs.getFastAttributeList(), *pClrMapPtr );
             mpSlidePersistPtr->setClrMap( pClrMapPtr );
+            return ret;
         }
         break;
     case PPT_TOKEN( clrMapOvr ):		// CT_ColorMappingOverride
     case PPT_TOKEN( sldLayoutIdLst ):	// CT_SlideLayoutIdList
-        break;
+        return this;
     case PPT_TOKEN( txStyles ):			// CT_SlideMasterTextStyles
-        xRet.set( new SlideMasterTextStylesContext( *this, mpSlidePersistPtr ) );
+        return new SlideMasterTextStylesContext( *this, mpSlidePersistPtr );
         break;
     case PPT_TOKEN( custDataLst ):		// CT_CustomerDataList
     case PPT_TOKEN( tagLst ):			// CT_TagList
-        break;
+        return this;
     }
 
-    if( !xRet.is() )
-        xRet = getFastContextHandler();
-
-    return xRet;
+    return this;
 }
 
-void SAL_CALL SlideFragmentHandler::endDocument(  ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException)
+void SlideFragmentHandler::finalizeImport()
 {
     try
     {
diff --git a/oox/source/ppt/slidemastertextstylescontext.cxx b/oox/source/ppt/slidemastertextstylescontext.cxx
index 9ee4fcd..5a66525 100644
--- a/oox/source/ppt/slidemastertextstylescontext.cxx
+++ b/oox/source/ppt/slidemastertextstylescontext.cxx
@@ -37,8 +37,8 @@ using namespace ::com::sun::star::xml::sax;
 
 namespace oox { namespace ppt {
 
-SlideMasterTextStylesContext::SlideMasterTextStylesContext( ContextHandler& rParent, SlidePersistPtr pSlidePersistPtr )
-: ContextHandler( rParent )
+SlideMasterTextStylesContext::SlideMasterTextStylesContext( FragmentHandler2& rParent, SlidePersistPtr pSlidePersistPtr )
+: FragmentHandler2( rParent )
 , mpSlidePersistPtr( pSlidePersistPtr )
 {
 }
@@ -47,10 +47,9 @@ SlideMasterTextStylesContext::~SlideMasterTextStylesContext()
 {
 }
 
-Reference< XFastContextHandler > SlideMasterTextStylesContext::createFastChildContext( sal_Int32 aElementToken, const Reference< XFastAttributeList >& /* xAttribs */ ) throw (SAXException, RuntimeException)
+::oox::core::ContextHandlerRef SlideMasterTextStylesContext::onCreateContext( sal_Int32 aElementToken, const AttributeList& /*rAttribs*/ )
 {
     oox::drawingml::TextListStylePtr aTextListStylePtr;
-    Reference< XFastContextHandler > xRet;
     switch( aElementToken )
     {
         case PPT_TOKEN( titleStyle ):
@@ -78,12 +77,10 @@ Reference< XFastContextHandler > SlideMasterTextStylesContext::createFastChildCo
     {									// are obtained. i got some documents without having the textsize set at 
         for ( int i = 0; i < 9; i++ )	// any point, the master reference application is using 18pt then
             aTextListStylePtr->getListStyle()[ i ]->getTextCharacterProperties().moHeight = 1800;
-        xRet.set( new oox::drawingml::TextListStyleContext( *this, *aTextListStylePtr ) );
+        return new oox::drawingml::TextListStyleContext( *this, *aTextListStylePtr );
     }
-    if( !xRet.is() )
-        xRet.set( this );
 
-    return xRet;
+    return this;
 }
 
 } }
diff --git a/oox/source/ppt/slidetimingcontext.cxx b/oox/source/ppt/slidetimingcontext.cxx
index 45cabc7..063c878 100644
--- a/oox/source/ppt/slidetimingcontext.cxx
+++ b/oox/source/ppt/slidetimingcontext.cxx
@@ -49,8 +49,8 @@ using namespace ::com::sun::star::container;
 
 namespace oox { namespace ppt {
 
-SlideTimingContext::SlideTimingContext( ContextHandler& rParent, TimeNodePtrList & aTimeNodeList ) throw()
-    : ContextHandler( rParent )
+SlideTimingContext::SlideTimingContext( FragmentHandler2& rParent, TimeNodePtrList & aTimeNodeList ) throw()
+    : FragmentHandler2( rParent )
     , maTimeNodeList( aTimeNodeList )
 {
 }
@@ -60,42 +60,26 @@ SlideTimingContext::~SlideTimingContext() throw()
 
 }
 
-void SlideTimingContext::endFastElement( sal_Int32 /*aElement*/ ) throw ( SAXException, RuntimeException)
+::oox::core::ContextHandlerRef SlideTimingContext::onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs )
 {
-}
-
-
-Reference< XFastContextHandler > SlideTimingContext::createFastChildContext( sal_Int32 aElementToken, const Reference< XFastAttributeList >& xAttribs ) throw (SAXException, RuntimeException)
-{
-    Reference< XFastContextHandler > xRet;
-
     switch( aElementToken )
     {
     case PPT_TOKEN( bldLst ):
-        xRet.set( new BuildListContext( *this, xAttribs, maTimeNodeList ) );
-        break;
+        return new BuildListContext( *this, rAttribs.getFastAttributeList(), maTimeNodeList );
     case PPT_TOKEN( extLst ):
-        return xRet;
+        return this;
     case PPT_TOKEN( tnLst ):
         // timing nodes
     {
-        xRet.set( new TimeNodeListContext( *this, maTimeNodeList ) );
+        return new TimeNodeListContext( *this, maTimeNodeList );
     }
     break;
 
     default:
-        break;
+        return this;
     }
 
-    if( !xRet.is() )
-        xRet.set(this);
-
-    return xRet;
-}
-
-void SAL_CALL SlideTimingContext::endDocument(  ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException)
-{
-
+    return this;
 }
 
 } }
diff --git a/oox/source/ppt/slidetransitioncontext.cxx b/oox/source/ppt/slidetransitioncontext.cxx
index 82a4ac5..9043ffb 100644
--- a/oox/source/ppt/slidetransitioncontext.cxx
+++ b/oox/source/ppt/slidetransitioncontext.cxx
@@ -51,23 +51,21 @@ using namespace ::com::sun::star::container;
 namespace oox { namespace ppt {
 
 
-SlideTransitionContext::SlideTransitionContext( ContextHandler& rParent, const Reference< XFastAttributeList >& xAttribs, PropertyMap & aProperties ) throw()
-: ContextHandler( rParent )
+SlideTransitionContext::SlideTransitionContext( FragmentHandler2& rParent, const AttributeList& rAttribs, PropertyMap & aProperties ) throw()
+: FragmentHandler2( rParent )
 , maSlideProperties( aProperties )
 , mbHasTransition( sal_False )
 {
-    AttributeList attribs(xAttribs);
-
     // ST_TransitionSpeed
-    maTransition.setOoxTransitionSpeed( xAttribs->getOptionalValueToken( XML_spd, XML_fast ) );
+    maTransition.setOoxTransitionSpeed( rAttribs.getToken( XML_spd, XML_fast ) );
 
     // TODO
-    attribs.getBool( XML_advClick, true );
+    rAttribs.getBool( XML_advClick, true );
 
     // careful. if missing, no auto advance... 0 looks like a valid value
     // for auto advance
-    if(attribs.hasAttribute( XML_advTm ))
-        maTransition.setOoxAdvanceTime( attribs.getInteger( XML_advTm, -1 ) );
+    if(rAttribs.hasAttribute( XML_advTm ))
+        maTransition.setOoxAdvanceTime( rAttribs.getInteger( XML_advTm, -1 ) );
 }
 
 SlideTransitionContext::~SlideTransitionContext() throw()
@@ -75,10 +73,8 @@ SlideTransitionContext::~SlideTransitionContext() throw()
 
 }
 
-Reference< XFastContextHandler > SlideTransitionContext::createFastChildContext( sal_Int32 aElementToken, const Reference< XFastAttributeList >& xAttribs ) throw (SAXException, RuntimeException)
+::oox::core::ContextHandlerRef SlideTransitionContext::onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs )
 {
-    Reference< XFastContextHandler > xRet;
-
     switch( aElementToken )
     {
     case PPT_TOKEN( blinds ):
@@ -88,67 +84,65 @@ Reference< XFastContextHandler > SlideTransitionContext::createFastChildContext(
         if (!mbHasTransition)
         {
             mbHasTransition = true;
-            maTransition.setOoxTransitionType( aElementToken, xAttribs->getOptionalValueToken( XML_dir, XML_horz ), 0);
+            maTransition.setOoxTransitionType( aElementToken, rAttribs.getToken( XML_dir, XML_horz ), 0);
             // ST_Direction { XML_horz, XML_vert }
         }
-        break;
+        return this;
     case PPT_TOKEN( cover ):
     case PPT_TOKEN( pull ):
         if (!mbHasTransition)
         {
             mbHasTransition = true;
-            maTransition.setOoxTransitionType( aElementToken, xAttribs->getOptionalValueToken( XML_dir, XML_l ), 0 );
+            maTransition.setOoxTransitionType( aElementToken, rAttribs.getToken( XML_dir, XML_l ), 0 );
             // ST_TransitionEightDirectionType { ST_TransitionSideDirectionType {
             //                                   XML_d, XML_d, XML_r, XML_u },
             //                                   ST_TransitionCornerDirectionType {
             //                                   XML_ld, XML_lu, XML_rd, XML_ru }
         }
-        break;
+        return this;
     case PPT_TOKEN( cut ):
     case PPT_TOKEN( fade ):
         if (!mbHasTransition)
         {
             mbHasTransition = true;
-            AttributeList attribs(xAttribs);
             // CT_OptionalBlackTransition xdb:bool
-            maTransition.setOoxTransitionType( aElementToken, attribs.getBool( XML_thruBlk, false ), 0);
+            maTransition.setOoxTransitionType( aElementToken, rAttribs.getBool( XML_thruBlk, false ), 0);
         }
-        break;
+        return this;
     case PPT_TOKEN( push ):
     case PPT_TOKEN( wipe ):
         if (!mbHasTransition)
         {
             mbHasTransition = true;
-            maTransition.setOoxTransitionType( aElementToken, xAttribs->getOptionalValueToken( XML_dir, XML_l ), 0 );
+            maTransition.setOoxTransitionType( aElementToken, rAttribs.getToken( XML_dir, XML_l ), 0 );
             // ST_TransitionSideDirectionType { XML_d, XML_l, XML_r, XML_u }
         }
-        break;
+        return this;
     case PPT_TOKEN( split ):
         if (!mbHasTransition)
         {
             mbHasTransition = true;
-            maTransition.setOoxTransitionType( aElementToken, xAttribs->getOptionalValueToken( XML_orient, XML_horz ),	xAttribs->getOptionalValueToken( XML_dir, XML_out ) );
+            maTransition.setOoxTransitionType( aElementToken, rAttribs.getToken( XML_orient, XML_horz ),	rAttribs.getToken( XML_dir, XML_out ) );
             // ST_Direction { XML_horz, XML_vert }
             // ST_TransitionInOutDirectionType { XML_out, XML_in }
         }
-        break;
+        return this;
     case PPT_TOKEN( zoom ):
         if (!mbHasTransition)
         {
             mbHasTransition = true;
-            maTransition.setOoxTransitionType( aElementToken, xAttribs->getOptionalValueToken( XML_dir, XML_out ), 0 );
+            maTransition.setOoxTransitionType( aElementToken, rAttribs.getToken( XML_dir, XML_out ), 0 );
             // ST_TransitionInOutDirectionType { XML_out, XML_in }
         }
-        break;
+        return this;
     case PPT_TOKEN( wheel ):
         if (!mbHasTransition)
         {
             mbHasTransition = true;
-            AttributeList attribs(xAttribs);
-            maTransition.setOoxTransitionType( aElementToken, attribs.getUnsigned( XML_spokes, 4 ), 0 );
+            maTransition.setOoxTransitionType( aElementToken, rAttribs.getUnsigned( XML_spokes, 4 ), 0 );
             // unsignedInt
         }
-        break;
+        return this;
     case PPT_TOKEN( circle ):
     case PPT_TOKEN( diamond ):
     case PPT_TOKEN( dissolve ):
@@ -162,28 +156,23 @@ Reference< XFastContextHandler > SlideTransitionContext::createFastChildContext(
             mbHasTransition = true;
             maTransition.setOoxTransitionType( aElementToken, 0, 0 );
         }
-        break;
-
+        return this;
 
     case PPT_TOKEN( sndAc ): // CT_TransitionSoundAction
         //"Sound"
-        xRet.set( new SoundActionContext ( *this, maSlideProperties ) );
-        break;
+        return new SoundActionContext ( *this, maSlideProperties );
     case PPT_TOKEN( extLst ): // CT_OfficeArtExtensionList
-        return xRet;
+        return this;
     default:
         break;
     }
 
-    if( !xRet.is() )
-        xRet.set(this);
-
-    return xRet;
+    return this;
 }
 
-void SlideTransitionContext::endFastElement( sal_Int32 aElement ) throw (::com::sun::star::xml::sax::SAXException, RuntimeException)
+void SlideTransitionContext::onEndElement()
 {
-    if( aElement == (PPT_TOKEN( transition )) )
+    if( isCurrentElement(PPT_TOKEN( transition )) )
     {
         if( mbHasTransition )
         {
diff --git a/oox/source/ppt/soundactioncontext.cxx b/oox/source/ppt/soundactioncontext.cxx
index 4b8eb37..06278da 100644
--- a/oox/source/ppt/soundactioncontext.cxx
+++ b/oox/source/ppt/soundactioncontext.cxx
@@ -44,8 +44,8 @@ using namespace ::com::sun::star::uno;
 namespace oox { namespace ppt {
 
 
-    SoundActionContext::SoundActionContext( ContextHandler& rParent, PropertyMap & aProperties ) throw()
-    : ContextHandler( rParent )
+    SoundActionContext::SoundActionContext( FragmentHandler2& rParent, PropertyMap & aProperties ) throw()
+    : FragmentHandler2( rParent )
     , maSlideProperties( aProperties )
     , mbHasStartSound( false )
     , mbLoopSound( false )
@@ -59,9 +59,9 @@ namespace oox { namespace ppt {
     }
 
 
-    void SoundActionContext::endFastElement( sal_Int32 aElement ) throw (SAXException, RuntimeException)
+    void SoundActionContext::onEndElement()
     {
-        if ( aElement == PPT_TOKEN( sndAc ) )
+        if ( isCurrentElement( PPT_TOKEN( sndAc ) ) )
         {
             if( mbHasStartSound )
             {
@@ -97,37 +97,32 @@ namespace oox { namespace ppt {
     }
 
 
-    Reference< XFastContextHandler > SoundActionContext::createFastChildContext( ::sal_Int32 aElement, const Reference< XFastAttributeList >& xAttribs ) throw (SAXException, RuntimeException)
+    ::oox::core::ContextHandlerRef SoundActionContext::onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs )
     {
-        Reference< XFastContextHandler > xRet;
-        AttributeList attribs(xAttribs);
-
-        switch( aElement )
+        switch( aElementToken )
         {
         case PPT_TOKEN( snd ):
             if( mbHasStartSound )
             {
                 drawingml::EmbeddedWAVAudioFile aAudio;
-                drawingml::getEmbeddedWAVAudioFile( getRelations(), xAttribs, aAudio);
+                drawingml::getEmbeddedWAVAudioFile( getRelations(), rAttribs.getFastAttributeList(), aAudio);
 
                 msSndName = ( aAudio.mbBuiltIn ? aAudio.msName : aAudio.msEmbed );
             }
-            break;
+            return this;
         case PPT_TOKEN( endSnd ):
             // CT_Empty
             mbStopSound = true;
-            break;
+            return this;
         case PPT_TOKEN( stSnd ):
             mbHasStartSound = true;
-            mbLoopSound = attribs.getBool( XML_loop, false );
+            mbLoopSound = rAttribs.getBool( XML_loop, false );
+            return this;
         default:
             break;
         }
 
-        if( !xRet.is() )
-            xRet.set( this );
-
-        return xRet;
+        return this;
     }
 
 
diff --git a/oox/source/ppt/timeanimvaluecontext.cxx b/oox/source/ppt/timeanimvaluecontext.cxx
index ca4b600..4817c1b 100644
--- a/oox/source/ppt/timeanimvaluecontext.cxx
+++ b/oox/source/ppt/timeanimvaluecontext.cxx
@@ -36,10 +36,10 @@ using namespace ::com::sun::star::xml::sax;
 
 namespace oox { namespace ppt {
 
-    TimeAnimValueListContext::TimeAnimValueListContext( ContextHandler& rParent,
+    TimeAnimValueListContext::TimeAnimValueListContext( FragmentHandler2& rParent,
                 const Reference< XFastAttributeList >& /*xAttribs*/,
                 TimeAnimationValueList & aTavList )
-        : ContextHandler( rParent )
+        : FragmentHandler2( rParent )
             , maTavList( aTavList )
             , mbInValue( false )
     {
@@ -51,21 +51,17 @@ namespace oox { namespace ppt {
     }
 
 
-    void SAL_CALL TimeAnimValueListContext::endFastElement( sal_Int32 aElement )
-        throw ( SAXException, RuntimeException)
+    void TimeAnimValueListContext::onEndElement()
     {
-        if( aElement == PPT_TOKEN( tav ) )
+        if( isCurrentElement( PPT_TOKEN( tav ) ) )
         {
             mbInValue = false;
         }
     }
 
 
-    Reference< XFastContextHandler > SAL_CALL TimeAnimValueListContext::createFastChildContext( ::sal_Int32 aElementToken,
-                                                                                                                                                                                            const Reference< XFastAttributeList >& xAttribs )
-        throw ( SAXException, RuntimeException )
+    ::oox::core::ContextHandlerRef TimeAnimValueListContext::onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs )
     {
-        Reference< XFastContextHandler > xRet;
 
         switch ( aElementToken )
         {
@@ -73,26 +69,23 @@ namespace oox { namespace ppt {
         {
             mbInValue = true;
             TimeAnimationValue val;
-            val.msFormula = xAttribs->getOptionalValue( XML_fmla );
-            val.msTime =  xAttribs->getOptionalValue( XML_tm );
+            val.msFormula = rAttribs.getString( XML_fmla, rtl::OUString() );
+            val.msTime =  rAttribs.getString( XML_tm, rtl::OUString() );
             maTavList.push_back( val );
-            break;
+            return this;
         }
         case PPT_TOKEN( val ):
             if( mbInValue )
             {
                 // CT_TLAnimVariant
-                xRet.set( new AnimVariantContext( *this, aElementToken, maTavList.back().maValue ) );
+                return new AnimVariantContext( *this, aElementToken, maTavList.back().maValue );
             }
             break;
         default:
             break;
         }
 
-        if( !xRet.is() )
-            xRet.set( this );
-
-        return xRet;
+        return this;
     }
 
 
diff --git a/oox/source/ppt/timeanimvaluecontext.hxx b/oox/source/ppt/timeanimvaluecontext.hxx
index 23941aa..3732092 100644
--- a/oox/source/ppt/timeanimvaluecontext.hxx
+++ b/oox/source/ppt/timeanimvaluecontext.hxx
@@ -31,26 +31,25 @@
 #ifndef OOX_PPT_TIMEANIMVALUELISTCONTEXT
 #define OOX_PPT_TIMEANIMVALUELISTCONTEXT
 
-#include "oox/core/contexthandler.hxx"
+#include "oox/core/fragmenthandler2.hxx"
 #include "oox/ppt/animationspersist.hxx"
 
 namespace oox { namespace ppt {
 
     /** CT_TLTimeAnimateValueList */
     class TimeAnimValueListContext
-        : public ::oox::core::ContextHandler
+        : public ::oox::core::FragmentHandler2
     {
     public:
-        TimeAnimValueListContext( ::oox::core::ContextHandler& rParent,
+        TimeAnimValueListContext( ::oox::core::FragmentHandler2& rParent,
             const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& xAttribs,
             TimeAnimationValueList & aTavList );
 
         ~TimeAnimValueListContext( );
 
-        virtual void SAL_CALL endFastElement( sal_Int32 aElement ) 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 aElementToken, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& /*xAttribs*/ ) throw ( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
+        virtual void onEndElement();
 
+        virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs );
 
     private:
         TimeAnimationValueList & maTavList;
diff --git a/oox/source/ppt/timenodelistcontext.cxx b/oox/source/ppt/timenodelistcontext.cxx
index 00d5cac..0be3720 100644
--- a/oox/source/ppt/timenodelistcontext.cxx
+++ b/oox/source/ppt/timenodelistcontext.cxx
@@ -117,7 +117,7 @@ namespace oox { namespace ppt {
         : public TimeNodeContext
     {
     public:
-        MediaNodeContext( ContextHandler& rParent, sal_Int32  aElement,
+        MediaNodeContext( FragmentHandler2& rParent, sal_Int32  aElement,
                             const Reference< XFastAttributeList >& xAttribs,
                             const TimeNodePtr & pNode )
             : TimeNodeContext( rParent, aElement, xAttribs, pNode )
@@ -139,9 +139,9 @@ namespace oox { namespace ppt {
                 }
             }
 
-        virtual void SAL_CALL endFastElement( sal_Int32 aElement )
-            throw ( SAXException, RuntimeException)
+        virtual void onEndElement()
             {
+                sal_Int32 aElement = getCurrentElement();
                 if( aElement == PPT_TOKEN( audio ) )
                 {
                     // TODO deal with mbIsNarration
@@ -152,25 +152,18 @@ namespace oox { namespace ppt {
                 }
             }
 
-        virtual Reference< XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 aElementToken,
-                                                                                                                                                            const Reference< XFastAttributeList >& xAttribs )
-            throw ( SAXException, RuntimeException )
+        virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs )
             {
-                Reference< XFastContextHandler > xRet;
-
                 switch ( aElementToken )
                 {
                 case PPT_TOKEN( cBhvr ):
-                    xRet.set( new CommonBehaviorContext ( *this, xAttribs, mpNode ) );
+                    return new CommonBehaviorContext ( *this, rAttribs.getFastAttributeList(), mpNode );
                     break;
                 default:
                     break;
                 }
 
-                if( !xRet.is() )
-                    xRet.set( this );
-
-                return xRet;
+                return this;
             }
 
     private:
@@ -185,7 +178,7 @@ namespace oox { namespace ppt {
         : public TimeNodeContext
     {
     public:
-        SetTimeNodeContext( ContextHandler& rParent, sal_Int32  aElement,
+        SetTimeNodeContext( FragmentHandler2& rParent, sal_Int32  aElement,
                             const Reference< XFastAttributeList >& xAttribs,
                             const TimeNodePtr & pNode )
             : TimeNodeContext( rParent, aElement, xAttribs, pNode )
@@ -212,35 +205,20 @@ namespace oox { namespace ppt {
 
             }
 
-        virtual void SAL_CALL endFastElement( sal_Int32 /*aElement*/ )
-            throw ( SAXException, RuntimeException)
+            virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs )
             {
-            }
-
-
-        virtual Reference< XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 aElementToken,
-                                                                                                                                                            const Reference< XFastAttributeList >& xAttribs )
-            throw ( SAXException, RuntimeException )
-            {
-                Reference< XFastContextHandler > xRet;
-
                 switch ( aElementToken )
                 {
                 case PPT_TOKEN( cBhvr ):
-                    xRet.set( new CommonBehaviorContext ( *this, xAttribs, mpNode ) );
-                    break;
+                    return new CommonBehaviorContext ( *this, rAttribs.getFastAttributeList(), mpNode );
                 case PPT_TOKEN( to ):
                     // CT_TLAnimVariant
-                    xRet.set( new AnimVariantContext( *this, aElementToken, maTo ) );
-                    break;
+                    return new AnimVariantContext( *this, aElementToken, maTo );
                 default:
                     break;
                 }
 
-                if( !xRet.is() )
-                    xRet.set( this );
-
-                return xRet;
+                return this;
             }
     private:
         Any  maTo;
@@ -252,7 +230,7 @@ namespace oox { namespace ppt {
         : public TimeNodeContext
     {
     public:
-        CmdTimeNodeContext( ContextHandler& rParent, sal_Int32  aElement,
+        CmdTimeNodeContext( FragmentHandler2& rParent, sal_Int32  aElement,
                             const Reference< XFastAttributeList >& xAttribs,
                             const TimeNodePtr & pNode )
             : TimeNodeContext( rParent, aElement, xAttribs, pNode )
@@ -273,10 +251,9 @@ namespace oox { namespace ppt {
             {
             }
 
-        virtual void SAL_CALL endFastElement( sal_Int32 aElement )
-            throw ( SAXException, RuntimeException)
+        virtual void onEndElement()
             {
-                if( aElement == PPT_TOKEN( cmd ) )
+                if( isCurrentElement( PPT_TOKEN( cmd ) ) )
                 {
                     try {
                         // see sd/source/filter/ppt/pptinanimations.cxx
@@ -347,25 +324,17 @@ namespace oox { namespace ppt {
             }
 
 
-        virtual Reference< XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 aElementToken,
-                                                                                                                                                            const Reference< XFastAttributeList >& xAttribs )
-            throw ( SAXException, RuntimeException )
+        virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs )
             {
-                Reference< XFastContextHandler > xRet;
-
                 switch ( aElementToken )
                 {
                 case PPT_TOKEN( cBhvr ):
-                    xRet.set( new CommonBehaviorContext ( *this, xAttribs, mpNode ) );
-                    break;
+                    return new CommonBehaviorContext ( *this, rAttribs.getFastAttributeList(), mpNode );
                 default:
                     break;
                 }
 
-                if( !xRet.is() )
-                    xRet.set( this );
-
-                return xRet;
+                return this;
             }
 
     private:
@@ -380,7 +349,7 @@ namespace oox { namespace ppt {
         : public TimeNodeContext
     {
     public:
-        SequenceTimeNodeContext( ContextHandler& rParent, sal_Int32  aElement,
+        SequenceTimeNodeContext( FragmentHandler2& rParent, sal_Int32  aElement,
                                  const Reference< XFastAttributeList >& xAttribs,
                                  const TimeNodePtr & pNode )
             : TimeNodeContext( rParent, aElement, xAttribs, pNode )
@@ -400,33 +369,23 @@ namespace oox { namespace ppt {
             }
 
 
-        virtual Reference< XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 aElementToken,
-                                                                                                                                                            const Reference< XFastAttributeList >& xAttribs )
-            throw ( SAXException, RuntimeException )
+        virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs )
             {
-                Reference< XFastContextHandler > xRet;
-
                 switch ( aElementToken )
                 {
                 case PPT_TOKEN( cTn ):
-                    xRet.set( new CommonTimeNodeContext( *this, aElementToken, xAttribs, mpNode ) );
-                    break;
+                    return new CommonTimeNodeContext( *this, aElementToken, rAttribs.getFastAttributeList(), mpNode );
                 case PPT_TOKEN( nextCondLst ):
-                    xRet.set( new CondListContext( *this, aElementToken, xAttribs, mpNode,
-                                                   mpNode->getNextCondition() ) );
-                    break;
+                    return new CondListContext( *this, aElementToken, rAttribs.getFastAttributeList(), mpNode,
+                                                   mpNode->getNextCondition() );
                 case PPT_TOKEN( prevCondLst ):
-                    xRet.set( new CondListContext( *this, aElementToken, xAttribs, mpNode,
-                                                   mpNode->getPrevCondition() ) );
-                    break;
+                    return new CondListContext( *this, aElementToken, rAttribs.getFastAttributeList(), mpNode,
+                                                   mpNode->getPrevCondition() );
                 default:
                     break;
                 }
 
-                if( !xRet.is() )
-                    xRet.set( this );
-
-                return xRet;
+                return this;
             }
     private:
         bool mbConcurrent;
@@ -441,32 +400,24 @@ namespace oox { namespace ppt {
         : public TimeNodeContext
     {
     public:
-        ParallelExclTimeNodeContext( ContextHandler& rParent, sal_Int32  aElement,
+        ParallelExclTimeNodeContext( FragmentHandler2& rParent, sal_Int32  aElement,
                                      const Reference< XFastAttributeList >& xAttribs,
                                      const TimeNodePtr & pNode )
             : TimeNodeContext( rParent, aElement, xAttribs, pNode )
             {
             }
 
-        virtual Reference< XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 aElementToken,
-                                                                                                                                                            const Reference< XFastAttributeList >& xAttribs )
-            throw ( SAXException, RuntimeException )
+        virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs )
             {
-                Reference< XFastContextHandler > xRet;
-
                 switch ( aElementToken )
                 {
                 case PPT_TOKEN( cTn ):
-                    xRet.set( new CommonTimeNodeContext( *this, aElementToken, xAttribs, mpNode ) );
-                    break;
+                    return new CommonTimeNodeContext( *this, aElementToken, rAttribs.getFastAttributeList(), mpNode );
                 default:
                     break;
                 }
 
-                if( !xRet.is() )
-                    xRet.set( this );
-
-                return xRet;
+                return this;
             }
 
     protected:
@@ -479,7 +430,7 @@ namespace oox { namespace ppt {
         : public TimeNodeContext
     {
     public:
-        AnimColorContext( ContextHandler& rParent, sal_Int32  aElement,
+        AnimColorContext( FragmentHandler2& rParent, sal_Int32  aElement,
                             const Reference< XFastAttributeList >& xAttribs,
                             const TimeNodePtr & pNode ) throw()
             : TimeNodeContext( rParent, aElement, xAttribs, pNode )
@@ -495,10 +446,10 @@ namespace oox { namespace ppt {
             {
             }
 
-        virtual void SAL_CALL endFastElement( sal_Int32 aElement ) throw ( SAXException, RuntimeException)
+        virtual void onEndElement()
             {
                 //xParentNode
-                if( aElement == mnElement )
+                if( isCurrentElement( mnElement ) )
                 {
                     NodePropertyMap & pProps(mpNode->getNodeProperties());
                     pProps[ NP_DIRECTION ] = makeAny( mnDir == XML_cw );
@@ -514,10 +465,8 @@ namespace oox { namespace ppt {
             }
 
 
-        virtual Reference< XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 aElementToken, const Reference< XFastAttributeList >& xAttribs ) throw ( SAXException, RuntimeException )
+            virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs )
             {
-                Reference< XFastContextHandler > xRet;
-
                 switch ( aElementToken )
                 {
                 case PPT_TOKEN( hsl ):
@@ -526,12 +475,11 @@ namespace oox { namespace ppt {
                     if( mbHasByColor )
                     {
                         m_byColor.colorSpace = AnimationColorSpace::HSL;
-                        m_byColor.one = xAttribs->getOptionalValue( XML_h ).toInt32( );
-                        m_byColor.two = xAttribs->getOptionalValue( XML_s ).toInt32( );
-                        m_byColor.three = xAttribs->getOptionalValue( XML_l ).toInt32( );
+                        m_byColor.one = rAttribs.getInteger( XML_h, 0 );
+                        m_byColor.two = rAttribs.getInteger( XML_s, 0 );
+                        m_byColor.three = rAttribs.getInteger( XML_l, 0 );
                     }
-                    xRet.set(this);
-                    break;
+                    return this;
                 }
                 case PPT_TOKEN( rgb ):
                 {
@@ -539,38 +487,30 @@ namespace oox { namespace ppt {
                     {
                         // CT_TLByRgbColorTransform
                         m_byColor.colorSpace = AnimationColorSpace::RGB;
-                        m_byColor.one = xAttribs->getOptionalValue( XML_r ).toInt32();
-                        m_byColor.two = xAttribs->getOptionalValue( XML_g ).toInt32();
-                        m_byColor.three = xAttribs->getOptionalValue( XML_b ).toInt32();
+                        m_byColor.one = rAttribs.getInteger( XML_r, 0 );
+                        m_byColor.two = rAttribs.getInteger( XML_g, 0 );
+                        m_byColor.three = rAttribs.getInteger( XML_b, 0 );
                     }
-                    xRet.set(this);
-                    break;
+                    return this;
                 }
                 case PPT_TOKEN( by ):
                     // CT_TLByAnimateColorTransform
                     mbHasByColor = true;
-                    xRet.set(this);
-                    break;
+                    return this;
                 case PPT_TOKEN( cBhvr ):
-                    xRet.set( new CommonBehaviorContext ( *this, xAttribs, mpNode ) );
-                    break;
+                    return new CommonBehaviorContext ( *this, rAttribs.getFastAttributeList(), mpNode );
                 case PPT_TOKEN( to ):
                     // CT_Color
-                    xRet.set( new ColorContext( *this, maToClr ) );
-                    break;
+                    return new ColorContext( *this, maToClr );
                 case PPT_TOKEN( from ):
                     // CT_Color
-                    xRet.set( new ColorContext( *this, maFromClr ) );
-                    break;
+                    return new ColorContext( *this, maFromClr );
 
                 default:
                     break;
                 }
 
-                if( !xRet.is() )
-                    xRet.set( this );
-
-                return xRet;
+                return this;
             }
 
 
@@ -589,7 +529,7 @@ namespace oox { namespace ppt {
         : public TimeNodeContext
     {
     public:
-        AnimContext( ContextHandler& rParent, sal_Int32  aElement,
+        AnimContext( FragmentHandler2& rParent, sal_Int32  aElement,
                      const Reference< XFastAttributeList >& xAttribs,
                       const TimeNodePtr & pNode ) throw()
             : TimeNodeContext( rParent, aElement, xAttribs, pNode )

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list