#i10000# Bring module to HEAD.
[LibreOffice.git] / oox / source / drawingml / objectdefaultcontext.cxx
blob4e76cf1fb633944d72b0ccb21e5a8daa6cfbe632
1 /*************************************************************************
3 * OpenOffice.org - a multi-platform office productivity suite
5 * $RCSfile: objectdefaultcontext.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/objectdefaultcontext.hxx"
37 #include "oox/drawingml/spdefcontext.hxx"
38 #include "oox/core/namespaces.hxx"
39 #include "tokens.hxx"
41 using rtl::OUString;
42 using namespace ::oox::core;
43 using namespace ::com::sun::star::uno;
44 using namespace ::com::sun::star::xml::sax;
46 namespace oox { namespace drawingml {
48 objectDefaultContext::objectDefaultContext( const ::oox::core::FragmentHandlerRef& xHandler, Theme& rTheme )
49 : Context( xHandler )
50 , mrTheme( rTheme )
54 Reference< XFastContextHandler > objectDefaultContext::createFastChildContext( sal_Int32 aElementToken, const Reference< XFastAttributeList >& /* xAttribs */ ) throw (SAXException, RuntimeException)
56 Reference< XFastContextHandler > xRet;
57 switch( aElementToken )
59 case NMSP_DRAWINGML|XML_spDef:
61 xRet.set( new spDefContext( getHandler(), *(mrTheme.getspDef().get()) ) );
62 break;
64 case NMSP_DRAWINGML|XML_lnDef:
66 xRet.set( new spDefContext( getHandler(), *(mrTheme.getlnDef().get()) ) );
67 break;
69 case NMSP_DRAWINGML|XML_txDef:
71 xRet.set( new spDefContext( getHandler(), *(mrTheme.gettxDef().get()) ) );
72 break;
75 if( !xRet.is() )
76 xRet.set( this );
78 return xRet;
81 } }