Update ooo320-m1
[ooovba.git] / oox / source / drawingml / chart / chartspacefragment.cxx
blobc1d23d5d9dbd4c1f470aab41655eaf3f7d8a162c
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: chartspacefragment.cxx,v $
11 * $Revision: 1.4 $
13 * This file is part of OpenOffice.org.
15 * OpenOffice.org is free software: you can redistribute it and/or modify
16 * it under the terms of the GNU Lesser General Public License version 3
17 * only, as published by the Free Software Foundation.
19 * OpenOffice.org is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU Lesser General Public License version 3 for more details
23 * (a copy is included in the LICENSE file that accompanied this code).
25 * You should have received a copy of the GNU Lesser General Public License
26 * version 3 along with OpenOffice.org. If not, see
27 * <http://www.openoffice.org/license.html>
28 * for a copy of the LGPLv3 License.
30 ************************************************************************/
32 #include "oox/drawingml/chart/chartspacefragment.hxx"
33 #include "oox/drawingml/shapepropertiescontext.hxx"
34 #include "oox/drawingml/textbodycontext.hxx"
35 #include "oox/drawingml/chart/chartspacemodel.hxx"
36 #include "oox/drawingml/chart/plotareacontext.hxx"
37 #include "oox/drawingml/chart/titlecontext.hxx"
39 using ::rtl::OUString;
40 using ::oox::core::ContextHandlerRef;
41 using ::oox::core::XmlFilterBase;
43 namespace oox {
44 namespace drawingml {
45 namespace chart {
47 // ============================================================================
49 ChartSpaceFragment::ChartSpaceFragment( XmlFilterBase& rFilter, const OUString& rFragmentPath, ChartSpaceModel& rModel ) :
50 FragmentBase< ChartSpaceModel >( rFilter, rFragmentPath, rModel )
54 ChartSpaceFragment::~ChartSpaceFragment()
58 ContextHandlerRef ChartSpaceFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
60 switch( getCurrentElement() )
62 case XML_ROOT_CONTEXT:
63 switch( nElement )
65 case C_TOKEN( chartSpace ):
66 return this;
68 break;
70 case C_TOKEN( chartSpace ):
71 switch( nElement )
73 case C_TOKEN( chart ):
74 return this;
75 case C_TOKEN( spPr ):
76 return new ShapePropertiesContext( *this, mrModel.mxShapeProp.create() );
77 case C_TOKEN( style ):
78 mrModel.mnStyle = rAttribs.getInteger( XML_val, 2 );
79 return 0;
80 case C_TOKEN( txPr ):
81 return new TextBodyContext( *this, mrModel.mxTextProp.create() );
83 break;
85 case C_TOKEN( chart ):
86 switch( nElement )
88 case C_TOKEN( autoTitleDeleted ):
89 // default is 'false', not 'true' as specified
90 mrModel.mbAutoTitleDel = rAttribs.getBool( XML_val, false );
91 return 0;
92 case C_TOKEN( backWall ):
93 return new WallFloorContext( *this, mrModel.mxBackWall.create() );
94 case C_TOKEN( dispBlanksAs ):
95 mrModel.mnDispBlanksAs = rAttribs.getToken( XML_val, XML_zero );
96 return 0;
97 case C_TOKEN( floor ):
98 return new WallFloorContext( *this, mrModel.mxFloor.create() );
99 case C_TOKEN( legend ):
100 return new LegendContext( *this, mrModel.mxLegend.create() );
101 case C_TOKEN( plotArea ):
102 return new PlotAreaContext( *this, mrModel.mxPlotArea.create() );
103 case C_TOKEN( plotVisOnly ):
104 // default is 'false', not 'true' as specified
105 mrModel.mbPlotVisOnly = rAttribs.getBool( XML_val, false );
106 return 0;
107 case C_TOKEN( showDLblsOverMax ):
108 // default is 'false', not 'true' as specified
109 mrModel.mbShowLabelsOverMax = rAttribs.getBool( XML_val, false );
110 return 0;
111 case C_TOKEN( sideWall ):
112 return new WallFloorContext( *this, mrModel.mxSideWall.create() );
113 case C_TOKEN( title ):
114 return new TitleContext( *this, mrModel.mxTitle.create() );
115 case C_TOKEN( view3D ):
116 return new View3DContext( *this, mrModel.mxView3D.create() );
118 break;
120 return 0;
123 // ============================================================================
125 } // namespace chart
126 } // namespace drawingml
127 } // namespace oox