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 : // ============================================================================
37 :
38 0 : ChartSpaceFragment::ChartSpaceFragment( XmlFilterBase& rFilter, const OUString& rFragmentPath, ChartSpaceModel& rModel ) :
39 0 : FragmentBase< ChartSpaceModel >( rFilter, rFragmentPath, rModel )
40 : {
41 0 : }
42 :
43 0 : ChartSpaceFragment::~ChartSpaceFragment()
44 : {
45 0 : }
46 :
47 0 : ContextHandlerRef ChartSpaceFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
48 : {
49 0 : switch( getCurrentElement() )
50 : {
51 : case XML_ROOT_CONTEXT:
52 0 : switch( nElement )
53 : {
54 : case C_TOKEN( chartSpace ):
55 0 : return this;
56 : }
57 0 : break;
58 :
59 : case C_TOKEN( chartSpace ):
60 0 : switch( nElement )
61 : {
62 : case C_TOKEN( chart ):
63 0 : return this;
64 : case C_TOKEN( spPr ):
65 0 : return new ShapePropertiesContext( *this, mrModel.mxShapeProp.create() );
66 : case C_TOKEN( style ):
67 0 : mrModel.mnStyle = rAttribs.getInteger( XML_val, 2 );
68 0 : return 0;
69 : case C_TOKEN( txPr ):
70 0 : return new TextBodyContext( *this, mrModel.mxTextProp.create() );
71 : case C_TOKEN( userShapes ):
72 0 : mrModel.maDrawingPath = getFragmentPathFromRelId( rAttribs.getString( R_TOKEN( id ), OUString() ) );
73 0 : return 0;
74 : case C_TOKEN( pivotSource ):
75 0 : mrModel.mbPivotChart = true;
76 0 : return 0;
77 : }
78 0 : break;
79 :
80 : case C_TOKEN( chart ):
81 0 : switch( nElement )
82 : {
83 : case C_TOKEN( autoTitleDeleted ):
84 : // default is 'false', not 'true' as specified
85 0 : mrModel.mbAutoTitleDel = rAttribs.getBool( XML_val, false );
86 0 : return 0;
87 : case C_TOKEN( backWall ):
88 0 : return new WallFloorContext( *this, mrModel.mxBackWall.create() );
89 : case C_TOKEN( dispBlanksAs ):
90 0 : mrModel.mnDispBlanksAs = rAttribs.getToken( XML_val, XML_zero );
91 0 : return 0;
92 : case C_TOKEN( floor ):
93 0 : return new WallFloorContext( *this, mrModel.mxFloor.create() );
94 : case C_TOKEN( legend ):
95 0 : return new LegendContext( *this, mrModel.mxLegend.create() );
96 : case C_TOKEN( plotArea ):
97 0 : return new PlotAreaContext( *this, mrModel.mxPlotArea.create() );
98 : case C_TOKEN( plotVisOnly ):
99 : // default is 'false', not 'true' as specified
100 0 : mrModel.mbPlotVisOnly = rAttribs.getBool( XML_val, false );
101 0 : return 0;
102 : case C_TOKEN( showDLblsOverMax ):
103 : // default is 'false', not 'true' as specified
104 0 : mrModel.mbShowLabelsOverMax = rAttribs.getBool( XML_val, false );
105 0 : return 0;
106 : case C_TOKEN( sideWall ):
107 0 : return new WallFloorContext( *this, mrModel.mxSideWall.create() );
108 : case C_TOKEN( title ):
109 0 : return new TitleContext( *this, mrModel.mxTitle.create() );
110 : case C_TOKEN( view3D ):
111 0 : return new View3DContext( *this, mrModel.mxView3D.create() );
112 : }
113 0 : break;
114 : }
115 0 : return 0;
116 : }
117 :
118 : // ============================================================================
119 :
120 : } // namespace chart
121 : } // namespace drawingml
122 51 : } // namespace oox
123 :
124 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|