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