xref: /AOO41X/main/oox/source/ppt/buildlistcontext.cxx (revision ca5ec2004b000a7d9aaa8381be8ac2853e3b1dc7)
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 "buildlistcontext.hxx"
25 #include <rtl/ustring.hxx>
26 #include "oox/helper/attributelist.hxx"
27 
28 
29 using namespace ::oox::core;
30 using namespace ::com::sun::star::uno;
31 using namespace ::com::sun::star::xml::sax;
32 using ::rtl::OUString;
33 
34 namespace oox { namespace ppt {
35 
BuildListContext(ContextHandler & rParent,const Reference<XFastAttributeList> &,TimeNodePtrList & aTimeNodeList)36     BuildListContext::BuildListContext( ContextHandler& rParent,
37                 const Reference< XFastAttributeList >& /*xAttribs*/,
38                 TimeNodePtrList & aTimeNodeList)
39         : ContextHandler( rParent )
40         , maTimeNodeList( aTimeNodeList )
41         , mbInBldGraphic( false )
42         ,   mbBuildAsOne( false )
43     {
44     }
45 
~BuildListContext()46     BuildListContext::~BuildListContext( )
47     {
48     }
49 
endFastElement(sal_Int32 aElement)50     void SAL_CALL BuildListContext::endFastElement( sal_Int32 aElement ) throw ( SAXException, RuntimeException)
51     {
52         switch( aElement )
53         {
54         case PPT_TOKEN( bldGraphic ):
55             mbInBldGraphic = false;
56             break;
57         default:
58             break;
59         }
60     }
61 
createFastChildContext(::sal_Int32 aElementToken,const Reference<XFastAttributeList> & xAttribs)62     Reference< XFastContextHandler > SAL_CALL BuildListContext::createFastChildContext( ::sal_Int32 aElementToken,
63                                                                                                                                                                          const Reference< XFastAttributeList >& xAttribs )
64         throw ( SAXException, RuntimeException )
65     {
66         Reference< XFastContextHandler > xRet;
67 
68         switch( aElementToken )
69         {
70         case PPT_TOKEN( bldAsOne ):
71             if( mbInBldGraphic )
72             {
73                 mbBuildAsOne = true;
74             }
75             break;
76         case PPT_TOKEN( bldSub ):
77             if( mbInBldGraphic )
78             {
79             }
80             break;
81         case PPT_TOKEN( bldGraphic ):
82         {
83             mbInBldGraphic = true;
84             AttributeList attribs( xAttribs );
85             OUString sShapeId = xAttribs->getOptionalValue( XML_spid );
86 // TODO
87 //      bool uiExpand = attribs.getBool( XML_uiExpand, true );
88                 /* this is unsigned */
89 //      sal_uInt32 nGroupId =  attribs.getUnsignedInteger( XML_grpId, 0 );
90             break;
91         }
92         case A_TOKEN( bldDgm ):
93         case A_TOKEN( bldOleChart ):
94         case A_TOKEN( bldP ):
95 
96             break;
97         default:
98             break;
99         }
100 
101         if( !xRet.is() )
102             xRet.set(this);
103 
104         return xRet;
105     }
106 
107 
108 } }
109