1 /**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License. You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied. See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22
23
24 #include <osl/diagnose.h>
25
26 #include "oox/drawingml/table/tablepartstylecontext.hxx"
27 #include "oox/drawingml/table/tablestyletextstylecontext.hxx"
28 #include "oox/drawingml/table/tablestylecellstylecontext.hxx"
29
30 using namespace ::oox::core;
31 using namespace ::com::sun::star;
32 using namespace ::com::sun::star::uno;
33 using namespace ::com::sun::star::xml::sax;
34 using ::rtl::OUString;
35
36 namespace oox { namespace drawingml { namespace table {
37
TablePartStyleContext(ContextHandler & rParent,TableStylePart & rTableStylePart)38 TablePartStyleContext::TablePartStyleContext( ContextHandler& rParent, TableStylePart& rTableStylePart )
39 : ContextHandler( rParent )
40 , mrTableStylePart( rTableStylePart )
41 {
42 }
43
~TablePartStyleContext()44 TablePartStyleContext::~TablePartStyleContext()
45 {
46 }
47
48 // CT_TablePartStyle
49 uno::Reference< xml::sax::XFastContextHandler > SAL_CALL
createFastChildContext(::sal_Int32 aElementToken,const uno::Reference<xml::sax::XFastAttributeList> & xAttribs)50 TablePartStyleContext::createFastChildContext( ::sal_Int32 aElementToken, const uno::Reference< xml::sax::XFastAttributeList >& xAttribs )
51 {
52 uno::Reference< xml::sax::XFastContextHandler > xRet;
53
54 switch( aElementToken )
55 {
56 case A_TOKEN( tcTxStyle ): // CT_TableStyleTextStyle
57 xRet.set( new TableStyleTextStyleContext( *this, xAttribs, mrTableStylePart ) );
58 break;
59 case A_TOKEN( tcStyle ): // CT_TableStyleCellStyle
60 xRet.set( new TableStyleCellStyleContext( *this, mrTableStylePart ) );
61 break;
62 }
63 if( !xRet.is() )
64 {
65 uno::Reference<XFastContextHandler> xTmp(this);
66 xRet.set( xTmp );
67 }
68 return xRet;
69 }
70
71 } } }
72