merge the formfield patch from ooo-build
[ooovba.git] / oox / source / drawingml / table / tablepartstylecontext.cxx
blob8f76684f51d14ab9c36e200782026c9da2a4efec
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: tablepartstylecontext.cxx,v $
10 * $Revision: 1.2 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #include <osl/diagnose.h>
33 #include "oox/drawingml/table/tablepartstylecontext.hxx"
34 #include "oox/drawingml/table/tablestyletextstylecontext.hxx"
35 #include "oox/drawingml/table/tablestylecellstylecontext.hxx"
36 #include "oox/core/namespaces.hxx"
37 #include "tokens.hxx"
38 using namespace ::oox::core;
39 using namespace ::com::sun::star;
40 using namespace ::com::sun::star::uno;
41 using namespace ::com::sun::star::xml::sax;
42 using ::rtl::OUString;
44 namespace oox { namespace drawingml { namespace table {
46 TablePartStyleContext::TablePartStyleContext( ContextHandler& rParent, TableStylePart& rTableStylePart )
47 : ContextHandler( rParent )
48 , mrTableStylePart( rTableStylePart )
52 TablePartStyleContext::~TablePartStyleContext()
56 // CT_TablePartStyle
57 uno::Reference< xml::sax::XFastContextHandler > SAL_CALL
58 TablePartStyleContext::createFastChildContext( ::sal_Int32 aElementToken, const uno::Reference< xml::sax::XFastAttributeList >& xAttribs )
59 throw ( xml::sax::SAXException, uno::RuntimeException)
61 uno::Reference< xml::sax::XFastContextHandler > xRet;
63 switch( aElementToken )
65 case NMSP_DRAWINGML|XML_tcTxStyle: // CT_TableStyleTextStyle
66 xRet.set( new TableStyleTextStyleContext( *this, xAttribs, mrTableStylePart ) );
67 break;
68 case NMSP_DRAWINGML|XML_tcStyle: // CT_TableStyleCellStyle
69 xRet.set( new TableStyleCellStyleContext( *this, mrTableStylePart ) );
70 break;
72 if( !xRet.is() )
74 uno::Reference<XFastContextHandler> xTmp(this);
75 xRet.set( xTmp );
77 return xRet;
80 } } }