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 $
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
;
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
:
65 case C_TOKEN( chartSpace
):
70 case C_TOKEN( chartSpace
):
73 case C_TOKEN( chart
):
76 return new ShapePropertiesContext( *this, mrModel
.mxShapeProp
.create() );
77 case C_TOKEN( style
):
78 mrModel
.mnStyle
= rAttribs
.getInteger( XML_val
, 2 );
81 return new TextBodyContext( *this, mrModel
.mxTextProp
.create() );
85 case C_TOKEN( chart
):
88 case C_TOKEN( autoTitleDeleted
):
89 // default is 'false', not 'true' as specified
90 mrModel
.mbAutoTitleDel
= rAttribs
.getBool( XML_val
, false );
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
);
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 );
107 case C_TOKEN( showDLblsOverMax
):
108 // default is 'false', not 'true' as specified
109 mrModel
.mbShowLabelsOverMax
= rAttribs
.getBool( XML_val
, false );
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() );
123 // ============================================================================
126 } // namespace drawingml