#i10000# Bring module to HEAD.
[LibreOffice.git] / oox / source / drawingml / spdefcontext.cxx
blob55530b3ffefb9644e21f0b885700e8f8aa7542e1
1 /*************************************************************************
3 * OpenOffice.org - a multi-platform office productivity suite
5 * $RCSfile: spdefcontext.cxx,v $
7 * $Revision: 1.2 $
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,
32 * MA 02111-1307 USA
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"
41 #include "tokens.hxx"
43 using rtl::OUString;
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 )
51 : Context( xHandler )
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 );
64 break;
66 case NMSP_DRAWINGML|XML_bodyPr:
68 xRet = new TextBodyPropertiesContext( this, xAttribs, mrDefaultObject );
69 break;
71 case NMSP_DRAWINGML|XML_lstStyle:
72 xRet.set( new TextListStyleContext( getHandler(), *(mrDefaultObject.getMasterTextListStyle().get()) ) );
73 break;
74 case NMSP_DRAWINGML|XML_style:
75 break;
77 if( !xRet.is() )
78 xRet.set( this );
80 return xRet;
83 } }