1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #include "buildlistcontext.hxx"
29 #include <rtl/ustring.hxx>
30 #include "oox/helper/attributelist.hxx"
31 
32 
33 using namespace ::oox::core;
34 using namespace ::com::sun::star::uno;
35 using namespace ::com::sun::star::xml::sax;
36 using ::rtl::OUString;
37 
38 namespace oox { namespace ppt {
39 
40     BuildListContext::BuildListContext( ContextHandler& rParent,
41                 const Reference< XFastAttributeList >& /*xAttribs*/,
42                 TimeNodePtrList & aTimeNodeList)
43         : ContextHandler( rParent )
44 		, maTimeNodeList( aTimeNodeList )
45 		, mbInBldGraphic( false )
46 		,	mbBuildAsOne( false )
47 	{
48 	}
49 
50 	BuildListContext::~BuildListContext( )
51 	{
52 	}
53 
54 	void SAL_CALL BuildListContext::endFastElement( sal_Int32 aElement ) throw ( SAXException, RuntimeException)
55 	{
56 		switch( aElement )
57 		{
58 		case PPT_TOKEN( bldGraphic ):
59 			mbInBldGraphic = false;
60 			break;
61 		default:
62 			break;
63 		}
64 	}
65 
66 	Reference< XFastContextHandler > SAL_CALL BuildListContext::createFastChildContext( ::sal_Int32 aElementToken,
67 																																										 const Reference< XFastAttributeList >& xAttribs )
68 		throw ( SAXException, RuntimeException )
69 	{
70 		Reference< XFastContextHandler > xRet;
71 
72 		switch( aElementToken )
73 		{
74 		case PPT_TOKEN( bldAsOne ):
75 			if( mbInBldGraphic )
76 			{
77 				mbBuildAsOne = true;
78 			}
79 			break;
80 		case PPT_TOKEN( bldSub ):
81 			if( mbInBldGraphic )
82 			{
83 			}
84 			break;
85 		case PPT_TOKEN( bldGraphic ):
86 		{
87 			mbInBldGraphic = true;
88 			AttributeList attribs( xAttribs );
89 			OUString sShapeId = xAttribs->getOptionalValue( XML_spid );
90 // TODO
91 //		bool uiExpand = attribs.getBool( XML_uiExpand, true );
92 				/* this is unsigned */
93 //		sal_uInt32 nGroupId =  attribs.getUnsignedInteger( XML_grpId, 0 );
94 			break;
95 		}
96 		case A_TOKEN( bldDgm ):
97 		case A_TOKEN( bldOleChart ):
98 		case A_TOKEN( bldP ):
99 
100 			break;
101 		default:
102 			break;
103 		}
104 
105 		if( !xRet.is() )
106 			xRet.set(this);
107 
108 		return xRet;
109 	}
110 
111 
112 } }
113