xref: /trunk/main/oox/source/ppt/buildlistcontext.cxx (revision 91144cd0085a7583d2099b982122deb2184ab956)
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 )
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     {
65         Reference< XFastContextHandler > xRet;
66 
67         switch( aElementToken )
68         {
69         case PPT_TOKEN( bldAsOne ):
70             if( mbInBldGraphic )
71             {
72                 mbBuildAsOne = true;
73             }
74             break;
75         case PPT_TOKEN( bldSub ):
76             if( mbInBldGraphic )
77             {
78             }
79             break;
80         case PPT_TOKEN( bldGraphic ):
81         {
82             mbInBldGraphic = true;
83             AttributeList attribs( xAttribs );
84             OUString sShapeId = xAttribs->getOptionalValue( XML_spid );
85 // TODO
86 //      bool uiExpand = attribs.getBool( XML_uiExpand, true );
87                 /* this is unsigned */
88 //      sal_uInt32 nGroupId =  attribs.getUnsignedInteger( XML_grpId, 0 );
89             break;
90         }
91         case A_TOKEN( bldDgm ):
92         case A_TOKEN( bldOleChart ):
93         case A_TOKEN( bldP ):
94 
95             break;
96         default:
97             break;
98         }
99 
100         if( !xRet.is() )
101             xRet.set(this);
102 
103         return xRet;
104     }
105 
106 
107 } }
108