Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*
3 : : * This file is part of the LibreOffice project.
4 : : *
5 : : * This Source Code Form is subject to the terms of the Mozilla Public
6 : : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : : *
9 : : * This file incorporates work covered by the following license notice:
10 : : *
11 : : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : : * contributor license agreements. See the NOTICE file distributed
13 : : * with this work for additional information regarding copyright
14 : : * ownership. The ASF licenses this file to you under the Apache
15 : : * License, Version 2.0 (the "License"); you may not use this file
16 : : * except in compliance with the License. You may obtain a copy of
17 : : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : : */
19 : :
20 : : #include "oox/drawingml/chart/chartspacefragment.hxx"
21 : :
22 : : #include "oox/drawingml/shapepropertiescontext.hxx"
23 : : #include "oox/drawingml/textbodycontext.hxx"
24 : : #include "oox/drawingml/chart/chartspacemodel.hxx"
25 : : #include "oox/drawingml/chart/plotareacontext.hxx"
26 : : #include "oox/drawingml/chart/titlecontext.hxx"
27 : :
28 : : namespace oox {
29 : : namespace drawingml {
30 : : namespace chart {
31 : :
32 : : // ============================================================================
33 : :
34 : : using namespace ::oox::core;
35 : :
36 : : using ::rtl::OUString;
37 : :
38 : : // ============================================================================
39 : :
40 : 0 : ChartSpaceFragment::ChartSpaceFragment( XmlFilterBase& rFilter, const OUString& rFragmentPath, ChartSpaceModel& rModel ) :
41 : 0 : FragmentBase< ChartSpaceModel >( rFilter, rFragmentPath, rModel )
42 : : {
43 : 0 : }
44 : :
45 : 0 : ChartSpaceFragment::~ChartSpaceFragment()
46 : : {
47 [ # # ]: 0 : }
48 : :
49 : 0 : ContextHandlerRef ChartSpaceFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
50 : : {
51 [ # # # # ]: 0 : switch( getCurrentElement() )
52 : : {
53 : : case XML_ROOT_CONTEXT:
54 [ # # ]: 0 : switch( nElement )
55 : : {
56 : : case C_TOKEN( chartSpace ):
57 : 0 : return this;
58 : : }
59 : 0 : break;
60 : :
61 : : case C_TOKEN( chartSpace ):
62 [ # # # # : 0 : switch( nElement )
# # # ]
63 : : {
64 : : case C_TOKEN( chart ):
65 : 0 : return this;
66 : : case C_TOKEN( spPr ):
67 [ # # ]: 0 : return new ShapePropertiesContext( *this, mrModel.mxShapeProp.create() );
68 : : case C_TOKEN( style ):
69 : 0 : mrModel.mnStyle = rAttribs.getInteger( XML_val, 2 );
70 : 0 : return 0;
71 : : case C_TOKEN( txPr ):
72 [ # # ]: 0 : return new TextBodyContext( *this, mrModel.mxTextProp.create() );
73 : : case C_TOKEN( userShapes ):
74 [ # # ][ # # ]: 0 : mrModel.maDrawingPath = getFragmentPathFromRelId( rAttribs.getString( R_TOKEN( id ), OUString() ) );
75 : 0 : return 0;
76 : : case C_TOKEN( pivotSource ):
77 : 0 : mrModel.mbPivotChart = true;
78 : 0 : return 0;
79 : : }
80 : 0 : break;
81 : :
82 : : case C_TOKEN( chart ):
83 [ # # # # : 0 : switch( nElement )
# # # # #
# # # ]
84 : : {
85 : : case C_TOKEN( autoTitleDeleted ):
86 : : // default is 'false', not 'true' as specified
87 : 0 : mrModel.mbAutoTitleDel = rAttribs.getBool( XML_val, false );
88 : 0 : return 0;
89 : : case C_TOKEN( backWall ):
90 [ # # ]: 0 : return new WallFloorContext( *this, mrModel.mxBackWall.create() );
91 : : case C_TOKEN( dispBlanksAs ):
92 : 0 : mrModel.mnDispBlanksAs = rAttribs.getToken( XML_val, XML_zero );
93 : 0 : return 0;
94 : : case C_TOKEN( floor ):
95 [ # # ]: 0 : return new WallFloorContext( *this, mrModel.mxFloor.create() );
96 : : case C_TOKEN( legend ):
97 [ # # ]: 0 : return new LegendContext( *this, mrModel.mxLegend.create() );
98 : : case C_TOKEN( plotArea ):
99 [ # # ]: 0 : return new PlotAreaContext( *this, mrModel.mxPlotArea.create() );
100 : : case C_TOKEN( plotVisOnly ):
101 : : // default is 'false', not 'true' as specified
102 : 0 : mrModel.mbPlotVisOnly = rAttribs.getBool( XML_val, false );
103 : 0 : return 0;
104 : : case C_TOKEN( showDLblsOverMax ):
105 : : // default is 'false', not 'true' as specified
106 : 0 : mrModel.mbShowLabelsOverMax = rAttribs.getBool( XML_val, false );
107 : 0 : return 0;
108 : : case C_TOKEN( sideWall ):
109 [ # # ]: 0 : return new WallFloorContext( *this, mrModel.mxSideWall.create() );
110 : : case C_TOKEN( title ):
111 [ # # ]: 0 : return new TitleContext( *this, mrModel.mxTitle.create() );
112 : : case C_TOKEN( view3D ):
113 [ # # ]: 0 : return new View3DContext( *this, mrModel.mxView3D.create() );
114 : : }
115 : 0 : break;
116 : : }
117 : 0 : return 0;
118 : : }
119 : :
120 : : // ============================================================================
121 : :
122 : : } // namespace chart
123 : : } // namespace drawingml
124 [ + - ][ + - ]: 285 : } // namespace oox
125 : :
126 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|