1 /*************************************************************************
3 * OpenOffice.org - a multi-platform office productivity suite
5 * $RCSfile: spdefcontext.cxx,v $
9 * last change: $Author: rt $ $Date: 2008-01-17 08:05:51 $
11 * The Contents of this file are made available subject to
12 * the terms of GNU Lesser General Public License Version 2.1.
15 * GNU Lesser General Public License Version 2.1
16 * =============================================
17 * Copyright 2005 by Sun Microsystems, Inc.
18 * 901 San Antonio Road, Palo Alto, CA 94303, USA
20 * This library is free software; you can redistribute it and/or
21 * modify it under the terms of the GNU Lesser General Public
22 * License version 2.1, as published by the Free Software Foundation.
24 * This library is distributed in the hope that it will be useful,
25 * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
27 * Lesser General Public License for more details.
29 * You should have received a copy of the GNU Lesser General Public
30 * License along with this library; if not, write to the Free Software
31 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
34 ************************************************************************/
36 #include "oox/drawingml/spdefcontext.hxx"
37 #include "oox/drawingml/shapepropertiescontext.hxx"
38 #include "oox/drawingml/textbodypropertiescontext.hxx"
39 #include "oox/drawingml/textliststylecontext.hxx"
40 #include "oox/core/namespaces.hxx"
44 using namespace ::oox::core
;
45 using namespace ::com::sun::star::uno
;
46 using namespace ::com::sun::star::xml::sax
;
48 namespace oox
{ namespace drawingml
{
50 spDefContext::spDefContext( const ::oox::core::FragmentHandlerRef
& xHandler
, oox::drawingml::Shape
& rDefaultObject
)
52 , mrDefaultObject( rDefaultObject
)
56 Reference
< XFastContextHandler
> spDefContext::createFastChildContext( sal_Int32 aElementToken
, const Reference
< XFastAttributeList
>& xAttribs
) throw (SAXException
, RuntimeException
)
58 Reference
< XFastContextHandler
> xRet
;
59 switch( aElementToken
)
61 case NMSP_DRAWINGML
|XML_spPr
:
63 xRet
= new ShapePropertiesContext( this, mrDefaultObject
);
66 case NMSP_DRAWINGML
|XML_bodyPr
:
68 xRet
= new TextBodyPropertiesContext( this, xAttribs
, mrDefaultObject
);
71 case NMSP_DRAWINGML
|XML_lstStyle
:
72 xRet
.set( new TextListStyleContext( getHandler(), *(mrDefaultObject
.getMasterTextListStyle().get()) ) );
74 case NMSP_DRAWINGML
|XML_style
: