1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir 
28*cdf0e10cSrcweir #include "oox/drawingml/chart/seriescontext.hxx"
29*cdf0e10cSrcweir 
30*cdf0e10cSrcweir #include "oox/drawingml/shapepropertiescontext.hxx"
31*cdf0e10cSrcweir #include "oox/drawingml/textbodycontext.hxx"
32*cdf0e10cSrcweir #include "oox/drawingml/chart/datasourcecontext.hxx"
33*cdf0e10cSrcweir #include "oox/drawingml/chart/seriesmodel.hxx"
34*cdf0e10cSrcweir #include "oox/drawingml/chart/titlecontext.hxx"
35*cdf0e10cSrcweir 
36*cdf0e10cSrcweir namespace oox {
37*cdf0e10cSrcweir namespace drawingml {
38*cdf0e10cSrcweir namespace chart {
39*cdf0e10cSrcweir 
40*cdf0e10cSrcweir // ============================================================================
41*cdf0e10cSrcweir 
42*cdf0e10cSrcweir using ::oox::core::ContextHandler2;
43*cdf0e10cSrcweir using ::oox::core::ContextHandler2Helper;
44*cdf0e10cSrcweir using ::oox::core::ContextHandlerRef;
45*cdf0e10cSrcweir using ::rtl::OUString;
46*cdf0e10cSrcweir 
47*cdf0e10cSrcweir // ============================================================================
48*cdf0e10cSrcweir 
49*cdf0e10cSrcweir namespace {
50*cdf0e10cSrcweir 
51*cdf0e10cSrcweir ContextHandlerRef lclDataLabelSharedCreateContext( ContextHandler2& rContext,
52*cdf0e10cSrcweir         sal_Int32 nElement, const AttributeList& rAttribs, DataLabelModelBase& orModel )
53*cdf0e10cSrcweir {
54*cdf0e10cSrcweir     if( rContext.isRootElement() ) switch( nElement )
55*cdf0e10cSrcweir     {
56*cdf0e10cSrcweir         case C_TOKEN( delete ):
57*cdf0e10cSrcweir             // default is 'false', not 'true' as specified
58*cdf0e10cSrcweir             orModel.mbDeleted = rAttribs.getBool( XML_val, false );
59*cdf0e10cSrcweir             return 0;
60*cdf0e10cSrcweir         case C_TOKEN( dLblPos ):
61*cdf0e10cSrcweir             orModel.monLabelPos = rAttribs.getToken( XML_val, XML_TOKEN_INVALID );
62*cdf0e10cSrcweir             return 0;
63*cdf0e10cSrcweir         case C_TOKEN( numFmt ):
64*cdf0e10cSrcweir             orModel.maNumberFormat.setAttributes( rAttribs );
65*cdf0e10cSrcweir             return 0;
66*cdf0e10cSrcweir         case C_TOKEN( showBubbleSize ):
67*cdf0e10cSrcweir             orModel.mobShowBubbleSize = rAttribs.getBool( XML_val );
68*cdf0e10cSrcweir             return 0;
69*cdf0e10cSrcweir         case C_TOKEN( showCatName ):
70*cdf0e10cSrcweir             orModel.mobShowCatName = rAttribs.getBool( XML_val );
71*cdf0e10cSrcweir             return 0;
72*cdf0e10cSrcweir         case C_TOKEN( showLegendKey ):
73*cdf0e10cSrcweir             orModel.mobShowLegendKey = rAttribs.getBool( XML_val );
74*cdf0e10cSrcweir             return 0;
75*cdf0e10cSrcweir         case C_TOKEN( showPercent ):
76*cdf0e10cSrcweir             orModel.mobShowPercent = rAttribs.getBool( XML_val );
77*cdf0e10cSrcweir             return 0;
78*cdf0e10cSrcweir         case C_TOKEN( showSerName ):
79*cdf0e10cSrcweir             orModel.mobShowSerName = rAttribs.getBool( XML_val );
80*cdf0e10cSrcweir             return 0;
81*cdf0e10cSrcweir         case C_TOKEN( showVal ):
82*cdf0e10cSrcweir             orModel.mobShowVal = rAttribs.getBool( XML_val );
83*cdf0e10cSrcweir             return 0;
84*cdf0e10cSrcweir         case C_TOKEN( separator ):
85*cdf0e10cSrcweir             // collect separator text in onCharacters()
86*cdf0e10cSrcweir             return &rContext;
87*cdf0e10cSrcweir         case C_TOKEN( spPr ):
88*cdf0e10cSrcweir             return new ShapePropertiesContext( rContext, orModel.mxShapeProp.create() );
89*cdf0e10cSrcweir         case C_TOKEN( txPr ):
90*cdf0e10cSrcweir             return new TextBodyContext( rContext, orModel.mxTextProp.create() );
91*cdf0e10cSrcweir     }
92*cdf0e10cSrcweir     return 0;
93*cdf0e10cSrcweir }
94*cdf0e10cSrcweir 
95*cdf0e10cSrcweir void lclDataLabelSharedCharacters( ContextHandler2& rContext, const OUString& rChars, DataLabelModelBase& orModel )
96*cdf0e10cSrcweir {
97*cdf0e10cSrcweir     if( rContext.isCurrentElement( C_TOKEN( separator ) ) )
98*cdf0e10cSrcweir         orModel.moaSeparator = rChars;
99*cdf0e10cSrcweir }
100*cdf0e10cSrcweir 
101*cdf0e10cSrcweir } // namespace
102*cdf0e10cSrcweir 
103*cdf0e10cSrcweir // ============================================================================
104*cdf0e10cSrcweir 
105*cdf0e10cSrcweir DataLabelContext::DataLabelContext( ContextHandler2Helper& rParent, DataLabelModel& rModel ) :
106*cdf0e10cSrcweir     ContextBase< DataLabelModel >( rParent, rModel )
107*cdf0e10cSrcweir {
108*cdf0e10cSrcweir }
109*cdf0e10cSrcweir 
110*cdf0e10cSrcweir DataLabelContext::~DataLabelContext()
111*cdf0e10cSrcweir {
112*cdf0e10cSrcweir }
113*cdf0e10cSrcweir 
114*cdf0e10cSrcweir ContextHandlerRef DataLabelContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
115*cdf0e10cSrcweir {
116*cdf0e10cSrcweir     if( isRootElement() ) switch( nElement )
117*cdf0e10cSrcweir     {
118*cdf0e10cSrcweir         case C_TOKEN( idx ):
119*cdf0e10cSrcweir             mrModel.mnIndex = rAttribs.getInteger( XML_val, -1 );
120*cdf0e10cSrcweir             return 0;
121*cdf0e10cSrcweir         case C_TOKEN( layout ):
122*cdf0e10cSrcweir             return new LayoutContext( *this, mrModel.mxLayout.create() );
123*cdf0e10cSrcweir         case C_TOKEN( tx ):
124*cdf0e10cSrcweir             return new TextContext( *this, mrModel.mxText.create() );
125*cdf0e10cSrcweir     }
126*cdf0e10cSrcweir     return lclDataLabelSharedCreateContext( *this, nElement, rAttribs, mrModel );
127*cdf0e10cSrcweir }
128*cdf0e10cSrcweir 
129*cdf0e10cSrcweir void DataLabelContext::onCharacters( const OUString& rChars )
130*cdf0e10cSrcweir {
131*cdf0e10cSrcweir     lclDataLabelSharedCharacters( *this, rChars, mrModel );
132*cdf0e10cSrcweir }
133*cdf0e10cSrcweir 
134*cdf0e10cSrcweir // ============================================================================
135*cdf0e10cSrcweir 
136*cdf0e10cSrcweir DataLabelsContext::DataLabelsContext( ContextHandler2Helper& rParent, DataLabelsModel& rModel ) :
137*cdf0e10cSrcweir     ContextBase< DataLabelsModel >( rParent, rModel )
138*cdf0e10cSrcweir {
139*cdf0e10cSrcweir }
140*cdf0e10cSrcweir 
141*cdf0e10cSrcweir DataLabelsContext::~DataLabelsContext()
142*cdf0e10cSrcweir {
143*cdf0e10cSrcweir }
144*cdf0e10cSrcweir 
145*cdf0e10cSrcweir ContextHandlerRef DataLabelsContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
146*cdf0e10cSrcweir {
147*cdf0e10cSrcweir     if( isRootElement() ) switch( nElement )
148*cdf0e10cSrcweir     {
149*cdf0e10cSrcweir         case C_TOKEN( dLbl ):
150*cdf0e10cSrcweir             return new DataLabelContext( *this, mrModel.maPointLabels.create() );
151*cdf0e10cSrcweir         case C_TOKEN( leaderLines ):
152*cdf0e10cSrcweir             return new ShapePrWrapperContext( *this, mrModel.mxLeaderLines.create() );
153*cdf0e10cSrcweir         case C_TOKEN( showLeaderLines ):
154*cdf0e10cSrcweir             // default is 'false', not 'true' as specified
155*cdf0e10cSrcweir             mrModel.mbShowLeaderLines = rAttribs.getBool( XML_val, false );
156*cdf0e10cSrcweir             return 0;
157*cdf0e10cSrcweir     }
158*cdf0e10cSrcweir     return lclDataLabelSharedCreateContext( *this, nElement, rAttribs, mrModel );
159*cdf0e10cSrcweir }
160*cdf0e10cSrcweir 
161*cdf0e10cSrcweir void DataLabelsContext::onCharacters( const OUString& rChars )
162*cdf0e10cSrcweir {
163*cdf0e10cSrcweir     lclDataLabelSharedCharacters( *this, rChars, mrModel );
164*cdf0e10cSrcweir }
165*cdf0e10cSrcweir 
166*cdf0e10cSrcweir // ============================================================================
167*cdf0e10cSrcweir 
168*cdf0e10cSrcweir PictureOptionsContext::PictureOptionsContext( ContextHandler2Helper& rParent, PictureOptionsModel& rModel ) :
169*cdf0e10cSrcweir     ContextBase< PictureOptionsModel >( rParent, rModel )
170*cdf0e10cSrcweir {
171*cdf0e10cSrcweir }
172*cdf0e10cSrcweir 
173*cdf0e10cSrcweir PictureOptionsContext::~PictureOptionsContext()
174*cdf0e10cSrcweir {
175*cdf0e10cSrcweir }
176*cdf0e10cSrcweir 
177*cdf0e10cSrcweir ContextHandlerRef PictureOptionsContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
178*cdf0e10cSrcweir {
179*cdf0e10cSrcweir     if( isRootElement() ) switch( nElement )
180*cdf0e10cSrcweir     {
181*cdf0e10cSrcweir         case C_TOKEN( applyToEnd ):
182*cdf0e10cSrcweir             // default is 'false', not 'true' as specified
183*cdf0e10cSrcweir             mrModel.mbApplyToEnd = rAttribs.getBool( XML_val, false );
184*cdf0e10cSrcweir             return 0;
185*cdf0e10cSrcweir         case C_TOKEN( applyToFront ):
186*cdf0e10cSrcweir             // default is 'false', not 'true' as specified
187*cdf0e10cSrcweir             mrModel.mbApplyToFront = rAttribs.getBool( XML_val, false );
188*cdf0e10cSrcweir             return 0;
189*cdf0e10cSrcweir         case C_TOKEN( applyToSides ):
190*cdf0e10cSrcweir             // default is 'false', not 'true' as specified
191*cdf0e10cSrcweir             mrModel.mbApplyToSides = rAttribs.getBool( XML_val, false );
192*cdf0e10cSrcweir             return 0;
193*cdf0e10cSrcweir         case C_TOKEN( pictureFormat ):
194*cdf0e10cSrcweir             mrModel.mnPictureFormat = rAttribs.getToken( XML_val, XML_stretch );
195*cdf0e10cSrcweir             return 0;
196*cdf0e10cSrcweir         case C_TOKEN( pictureStackUnit ):
197*cdf0e10cSrcweir             mrModel.mfStackUnit = rAttribs.getDouble( XML_val, 1.0 );
198*cdf0e10cSrcweir             return 0;
199*cdf0e10cSrcweir     }
200*cdf0e10cSrcweir     return 0;
201*cdf0e10cSrcweir }
202*cdf0e10cSrcweir 
203*cdf0e10cSrcweir // ============================================================================
204*cdf0e10cSrcweir 
205*cdf0e10cSrcweir ErrorBarContext::ErrorBarContext( ContextHandler2Helper& rParent, ErrorBarModel& rModel ) :
206*cdf0e10cSrcweir     ContextBase< ErrorBarModel >( rParent, rModel )
207*cdf0e10cSrcweir {
208*cdf0e10cSrcweir }
209*cdf0e10cSrcweir 
210*cdf0e10cSrcweir ErrorBarContext::~ErrorBarContext()
211*cdf0e10cSrcweir {
212*cdf0e10cSrcweir }
213*cdf0e10cSrcweir 
214*cdf0e10cSrcweir ContextHandlerRef ErrorBarContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
215*cdf0e10cSrcweir {
216*cdf0e10cSrcweir     if( isRootElement() ) switch( nElement )
217*cdf0e10cSrcweir     {
218*cdf0e10cSrcweir         case C_TOKEN( errBarType ):
219*cdf0e10cSrcweir             mrModel.mnTypeId = rAttribs.getToken( XML_val, XML_both );
220*cdf0e10cSrcweir             return 0;
221*cdf0e10cSrcweir         case C_TOKEN( errDir ):
222*cdf0e10cSrcweir             mrModel.mnDirection = rAttribs.getToken( XML_val, XML_TOKEN_INVALID );
223*cdf0e10cSrcweir             return 0;
224*cdf0e10cSrcweir         case C_TOKEN( errValType ):
225*cdf0e10cSrcweir             mrModel.mnValueType = rAttribs.getToken( XML_val, XML_fixedVal );
226*cdf0e10cSrcweir             return 0;
227*cdf0e10cSrcweir         case C_TOKEN( minus ):
228*cdf0e10cSrcweir             return new DataSourceContext( *this, mrModel.maSources.create( ErrorBarModel::MINUS ) );
229*cdf0e10cSrcweir         case C_TOKEN( noEndCap ):
230*cdf0e10cSrcweir             // default is 'false', not 'true' as specified
231*cdf0e10cSrcweir             mrModel.mbNoEndCap = rAttribs.getBool( XML_val, false );
232*cdf0e10cSrcweir             return 0;
233*cdf0e10cSrcweir         case C_TOKEN( plus ):
234*cdf0e10cSrcweir             return new DataSourceContext( *this, mrModel.maSources.create( ErrorBarModel::PLUS ) );
235*cdf0e10cSrcweir         case C_TOKEN( spPr ):
236*cdf0e10cSrcweir             return new ShapePropertiesContext( *this, mrModel.mxShapeProp.create() );
237*cdf0e10cSrcweir         case C_TOKEN( val ):
238*cdf0e10cSrcweir             mrModel.mfValue = rAttribs.getDouble( XML_val, 0.0 );
239*cdf0e10cSrcweir             return 0;
240*cdf0e10cSrcweir     }
241*cdf0e10cSrcweir     return 0;
242*cdf0e10cSrcweir }
243*cdf0e10cSrcweir 
244*cdf0e10cSrcweir // ============================================================================
245*cdf0e10cSrcweir 
246*cdf0e10cSrcweir TrendlineLabelContext::TrendlineLabelContext( ContextHandler2Helper& rParent, TrendlineLabelModel& rModel ) :
247*cdf0e10cSrcweir     ContextBase< TrendlineLabelModel >( rParent, rModel )
248*cdf0e10cSrcweir {
249*cdf0e10cSrcweir }
250*cdf0e10cSrcweir 
251*cdf0e10cSrcweir TrendlineLabelContext::~TrendlineLabelContext()
252*cdf0e10cSrcweir {
253*cdf0e10cSrcweir }
254*cdf0e10cSrcweir 
255*cdf0e10cSrcweir ContextHandlerRef TrendlineLabelContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
256*cdf0e10cSrcweir {
257*cdf0e10cSrcweir     if( isRootElement() ) switch( nElement )
258*cdf0e10cSrcweir     {
259*cdf0e10cSrcweir         case C_TOKEN( layout ):
260*cdf0e10cSrcweir             return new LayoutContext( *this, mrModel.mxLayout.create() );
261*cdf0e10cSrcweir         case C_TOKEN( numFmt ):
262*cdf0e10cSrcweir             mrModel.maNumberFormat.setAttributes( rAttribs );
263*cdf0e10cSrcweir             return 0;
264*cdf0e10cSrcweir         case C_TOKEN( spPr ):
265*cdf0e10cSrcweir             return new ShapePropertiesContext( *this, mrModel.mxShapeProp.create() );
266*cdf0e10cSrcweir         case C_TOKEN( tx ):
267*cdf0e10cSrcweir             return new TextContext( *this, mrModel.mxText.create() );
268*cdf0e10cSrcweir         case C_TOKEN( txPr ):
269*cdf0e10cSrcweir             return new TextBodyContext( *this, mrModel.mxTextProp.create() );
270*cdf0e10cSrcweir     }
271*cdf0e10cSrcweir     return 0;
272*cdf0e10cSrcweir }
273*cdf0e10cSrcweir 
274*cdf0e10cSrcweir // ============================================================================
275*cdf0e10cSrcweir 
276*cdf0e10cSrcweir TrendlineContext::TrendlineContext( ContextHandler2Helper& rParent, TrendlineModel& rModel ) :
277*cdf0e10cSrcweir     ContextBase< TrendlineModel >( rParent, rModel )
278*cdf0e10cSrcweir {
279*cdf0e10cSrcweir }
280*cdf0e10cSrcweir 
281*cdf0e10cSrcweir TrendlineContext::~TrendlineContext()
282*cdf0e10cSrcweir {
283*cdf0e10cSrcweir }
284*cdf0e10cSrcweir 
285*cdf0e10cSrcweir ContextHandlerRef TrendlineContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
286*cdf0e10cSrcweir {
287*cdf0e10cSrcweir     if( isRootElement() ) switch( nElement )
288*cdf0e10cSrcweir     {
289*cdf0e10cSrcweir         case C_TOKEN( backward ):
290*cdf0e10cSrcweir             mrModel.mfBackward = rAttribs.getDouble( XML_val, 0.0 );
291*cdf0e10cSrcweir             return 0;
292*cdf0e10cSrcweir         case C_TOKEN( dispEq ):
293*cdf0e10cSrcweir             // default is 'false', not 'true' as specified
294*cdf0e10cSrcweir             mrModel.mbDispEquation = rAttribs.getBool( XML_val, false );
295*cdf0e10cSrcweir             return 0;
296*cdf0e10cSrcweir         case C_TOKEN( dispRSqr ):
297*cdf0e10cSrcweir             // default is 'false', not 'true' as specified
298*cdf0e10cSrcweir             mrModel.mbDispRSquared = rAttribs.getBool( XML_val, false );
299*cdf0e10cSrcweir             return 0;
300*cdf0e10cSrcweir         case C_TOKEN( forward ):
301*cdf0e10cSrcweir             mrModel.mfForward = rAttribs.getDouble( XML_val, 0.0 );
302*cdf0e10cSrcweir             return 0;
303*cdf0e10cSrcweir         case C_TOKEN( intercept ):
304*cdf0e10cSrcweir             mrModel.mfIntercept = rAttribs.getDouble( XML_val, 0.0 );
305*cdf0e10cSrcweir             return 0;
306*cdf0e10cSrcweir         case C_TOKEN( name ):
307*cdf0e10cSrcweir             return this;    // collect name in onCharacters()
308*cdf0e10cSrcweir         case C_TOKEN( order ):
309*cdf0e10cSrcweir             mrModel.mnOrder = rAttribs.getInteger( XML_val, 2 );
310*cdf0e10cSrcweir             return 0;
311*cdf0e10cSrcweir         case C_TOKEN( period ):
312*cdf0e10cSrcweir             mrModel.mnPeriod = rAttribs.getInteger( XML_val, 2 );
313*cdf0e10cSrcweir             return 0;
314*cdf0e10cSrcweir         case C_TOKEN( spPr ):
315*cdf0e10cSrcweir             return new ShapePropertiesContext( *this, mrModel.mxShapeProp.create() );
316*cdf0e10cSrcweir         case C_TOKEN( trendlineLbl ):
317*cdf0e10cSrcweir             return new TrendlineLabelContext( *this, mrModel.mxLabel.create() );
318*cdf0e10cSrcweir         case C_TOKEN( trendlineType ):
319*cdf0e10cSrcweir             mrModel.mnTypeId = rAttribs.getToken( XML_val, XML_linear );
320*cdf0e10cSrcweir             return 0;
321*cdf0e10cSrcweir     }
322*cdf0e10cSrcweir     return 0;
323*cdf0e10cSrcweir }
324*cdf0e10cSrcweir 
325*cdf0e10cSrcweir void TrendlineContext::onCharacters( const OUString& rChars )
326*cdf0e10cSrcweir {
327*cdf0e10cSrcweir     if( isCurrentElement( C_TOKEN( name ) ) )
328*cdf0e10cSrcweir         mrModel.maName = rChars;
329*cdf0e10cSrcweir }
330*cdf0e10cSrcweir 
331*cdf0e10cSrcweir // ============================================================================
332*cdf0e10cSrcweir 
333*cdf0e10cSrcweir DataPointContext::DataPointContext( ContextHandler2Helper& rParent, DataPointModel& rModel ) :
334*cdf0e10cSrcweir     ContextBase< DataPointModel >( rParent, rModel )
335*cdf0e10cSrcweir {
336*cdf0e10cSrcweir }
337*cdf0e10cSrcweir 
338*cdf0e10cSrcweir DataPointContext::~DataPointContext()
339*cdf0e10cSrcweir {
340*cdf0e10cSrcweir }
341*cdf0e10cSrcweir 
342*cdf0e10cSrcweir ContextHandlerRef DataPointContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
343*cdf0e10cSrcweir {
344*cdf0e10cSrcweir     switch( getCurrentElement() )
345*cdf0e10cSrcweir     {
346*cdf0e10cSrcweir         case C_TOKEN( dPt ):
347*cdf0e10cSrcweir             switch( nElement )
348*cdf0e10cSrcweir             {
349*cdf0e10cSrcweir                 case C_TOKEN( bubble3D ):
350*cdf0e10cSrcweir                     mrModel.mobBubble3d = rAttribs.getBool( XML_val );
351*cdf0e10cSrcweir                     return 0;
352*cdf0e10cSrcweir                 case C_TOKEN( explosion ):
353*cdf0e10cSrcweir                     // if the 'val' attribute is missing, series explosion remains unchanged
354*cdf0e10cSrcweir                     mrModel.monExplosion = rAttribs.getInteger( XML_val );
355*cdf0e10cSrcweir                     return 0;
356*cdf0e10cSrcweir                 case C_TOKEN( idx ):
357*cdf0e10cSrcweir                     mrModel.mnIndex = rAttribs.getInteger( XML_val, -1 );
358*cdf0e10cSrcweir                     return 0;
359*cdf0e10cSrcweir                 case C_TOKEN( invertIfNegative ):
360*cdf0e10cSrcweir                     // default is 'false', not 'true' as specified (value not derived from series!)
361*cdf0e10cSrcweir                     mrModel.mbInvertNeg = rAttribs.getBool( XML_val, false );
362*cdf0e10cSrcweir                     return 0;
363*cdf0e10cSrcweir                 case C_TOKEN( marker ):
364*cdf0e10cSrcweir                     return this;
365*cdf0e10cSrcweir                 case C_TOKEN( pictureOptions ):
366*cdf0e10cSrcweir                     return new PictureOptionsContext( *this, mrModel.mxPicOptions.create() );
367*cdf0e10cSrcweir                 case C_TOKEN( spPr ):
368*cdf0e10cSrcweir                     return new ShapePropertiesContext( *this, mrModel.mxShapeProp.create() );
369*cdf0e10cSrcweir             }
370*cdf0e10cSrcweir         break;
371*cdf0e10cSrcweir 
372*cdf0e10cSrcweir         case C_TOKEN( marker ):
373*cdf0e10cSrcweir             switch( nElement )
374*cdf0e10cSrcweir             {
375*cdf0e10cSrcweir                 case C_TOKEN( size ):
376*cdf0e10cSrcweir                     mrModel.monMarkerSize = rAttribs.getInteger( XML_val, 5 );
377*cdf0e10cSrcweir                     return 0;
378*cdf0e10cSrcweir                 case C_TOKEN( spPr ):
379*cdf0e10cSrcweir                     return new ShapePropertiesContext( *this, mrModel.mxMarkerProp.create() );
380*cdf0e10cSrcweir                 case C_TOKEN( symbol ):
381*cdf0e10cSrcweir                     mrModel.monMarkerSymbol = rAttribs.getToken( XML_val, XML_none );
382*cdf0e10cSrcweir                     return 0;
383*cdf0e10cSrcweir             }
384*cdf0e10cSrcweir         break;
385*cdf0e10cSrcweir     }
386*cdf0e10cSrcweir     return 0;
387*cdf0e10cSrcweir }
388*cdf0e10cSrcweir 
389*cdf0e10cSrcweir // ============================================================================
390*cdf0e10cSrcweir 
391*cdf0e10cSrcweir SeriesContextBase::SeriesContextBase( ContextHandler2Helper& rParent, SeriesModel& rModel ) :
392*cdf0e10cSrcweir     ContextBase< SeriesModel >( rParent, rModel )
393*cdf0e10cSrcweir {
394*cdf0e10cSrcweir }
395*cdf0e10cSrcweir 
396*cdf0e10cSrcweir SeriesContextBase::~SeriesContextBase()
397*cdf0e10cSrcweir {
398*cdf0e10cSrcweir }
399*cdf0e10cSrcweir 
400*cdf0e10cSrcweir ContextHandlerRef SeriesContextBase::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
401*cdf0e10cSrcweir {
402*cdf0e10cSrcweir     switch( getCurrentElement() )
403*cdf0e10cSrcweir     {
404*cdf0e10cSrcweir         case C_TOKEN( ser ):
405*cdf0e10cSrcweir             switch( nElement )
406*cdf0e10cSrcweir             {
407*cdf0e10cSrcweir                 case C_TOKEN( idx ):
408*cdf0e10cSrcweir                     mrModel.mnIndex = rAttribs.getInteger( XML_val, -1 );
409*cdf0e10cSrcweir                     return 0;
410*cdf0e10cSrcweir                 case C_TOKEN( order ):
411*cdf0e10cSrcweir                     mrModel.mnOrder = rAttribs.getInteger( XML_val, -1 );
412*cdf0e10cSrcweir                     return 0;
413*cdf0e10cSrcweir                 case C_TOKEN( spPr ):
414*cdf0e10cSrcweir                     return new ShapePropertiesContext( *this, mrModel.mxShapeProp.create() );
415*cdf0e10cSrcweir                 case C_TOKEN( tx ):
416*cdf0e10cSrcweir                     return new TextContext( *this, mrModel.mxText.create() );
417*cdf0e10cSrcweir             }
418*cdf0e10cSrcweir         break;
419*cdf0e10cSrcweir 
420*cdf0e10cSrcweir         case C_TOKEN( marker ):
421*cdf0e10cSrcweir             switch( nElement )
422*cdf0e10cSrcweir             {
423*cdf0e10cSrcweir                 case C_TOKEN( size ):
424*cdf0e10cSrcweir                     mrModel.mnMarkerSize = rAttribs.getInteger( XML_val, 5 );
425*cdf0e10cSrcweir                     return 0;
426*cdf0e10cSrcweir                 case C_TOKEN( spPr ):
427*cdf0e10cSrcweir                     return new ShapePropertiesContext( *this, mrModel.mxMarkerProp.create() );
428*cdf0e10cSrcweir                 case C_TOKEN( symbol ):
429*cdf0e10cSrcweir                     mrModel.mnMarkerSymbol = rAttribs.getToken( XML_val, XML_none );
430*cdf0e10cSrcweir                     return 0;
431*cdf0e10cSrcweir             }
432*cdf0e10cSrcweir         break;
433*cdf0e10cSrcweir     }
434*cdf0e10cSrcweir     return 0;
435*cdf0e10cSrcweir }
436*cdf0e10cSrcweir 
437*cdf0e10cSrcweir // ============================================================================
438*cdf0e10cSrcweir 
439*cdf0e10cSrcweir AreaSeriesContext::AreaSeriesContext( ContextHandler2Helper& rParent, SeriesModel& rModel ) :
440*cdf0e10cSrcweir     SeriesContextBase( rParent, rModel )
441*cdf0e10cSrcweir {
442*cdf0e10cSrcweir }
443*cdf0e10cSrcweir 
444*cdf0e10cSrcweir AreaSeriesContext::~AreaSeriesContext()
445*cdf0e10cSrcweir {
446*cdf0e10cSrcweir }
447*cdf0e10cSrcweir 
448*cdf0e10cSrcweir ContextHandlerRef AreaSeriesContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
449*cdf0e10cSrcweir {
450*cdf0e10cSrcweir     switch( getCurrentElement() )
451*cdf0e10cSrcweir     {
452*cdf0e10cSrcweir         case C_TOKEN( ser ):
453*cdf0e10cSrcweir             switch( nElement )
454*cdf0e10cSrcweir             {
455*cdf0e10cSrcweir                 case C_TOKEN( cat ):
456*cdf0e10cSrcweir                     return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::CATEGORIES ) );
457*cdf0e10cSrcweir                 case C_TOKEN( errBars ):
458*cdf0e10cSrcweir                     return new ErrorBarContext( *this, mrModel.maErrorBars.create() );
459*cdf0e10cSrcweir                 case C_TOKEN( dLbls ):
460*cdf0e10cSrcweir                     return new DataLabelsContext( *this, mrModel.mxLabels.create() );
461*cdf0e10cSrcweir                 case C_TOKEN( dPt ):
462*cdf0e10cSrcweir                     return new DataPointContext( *this, mrModel.maPoints.create() );
463*cdf0e10cSrcweir                 case C_TOKEN( trendline ):
464*cdf0e10cSrcweir                     return new TrendlineContext( *this, mrModel.maTrendlines.create() );
465*cdf0e10cSrcweir                 case C_TOKEN( val ):
466*cdf0e10cSrcweir                     return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::VALUES ) );
467*cdf0e10cSrcweir             }
468*cdf0e10cSrcweir         break;
469*cdf0e10cSrcweir     }
470*cdf0e10cSrcweir     return SeriesContextBase::onCreateContext( nElement, rAttribs );
471*cdf0e10cSrcweir }
472*cdf0e10cSrcweir 
473*cdf0e10cSrcweir // ============================================================================
474*cdf0e10cSrcweir 
475*cdf0e10cSrcweir BarSeriesContext::BarSeriesContext( ContextHandler2Helper& rParent, SeriesModel& rModel ) :
476*cdf0e10cSrcweir     SeriesContextBase( rParent, rModel )
477*cdf0e10cSrcweir {
478*cdf0e10cSrcweir }
479*cdf0e10cSrcweir 
480*cdf0e10cSrcweir BarSeriesContext::~BarSeriesContext()
481*cdf0e10cSrcweir {
482*cdf0e10cSrcweir }
483*cdf0e10cSrcweir 
484*cdf0e10cSrcweir ContextHandlerRef BarSeriesContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
485*cdf0e10cSrcweir {
486*cdf0e10cSrcweir     switch( getCurrentElement() )
487*cdf0e10cSrcweir     {
488*cdf0e10cSrcweir         case C_TOKEN( ser ):
489*cdf0e10cSrcweir             switch( nElement )
490*cdf0e10cSrcweir             {
491*cdf0e10cSrcweir                 case C_TOKEN( cat ):
492*cdf0e10cSrcweir                     return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::CATEGORIES ) );
493*cdf0e10cSrcweir                 case C_TOKEN( dLbls ):
494*cdf0e10cSrcweir                     return new DataLabelsContext( *this, mrModel.mxLabels.create() );
495*cdf0e10cSrcweir                 case C_TOKEN( dPt ):
496*cdf0e10cSrcweir                     return new DataPointContext( *this, mrModel.maPoints.create() );
497*cdf0e10cSrcweir                 case C_TOKEN( errBars ):
498*cdf0e10cSrcweir                     return new ErrorBarContext( *this, mrModel.maErrorBars.create() );
499*cdf0e10cSrcweir                 case C_TOKEN( invertIfNegative ):
500*cdf0e10cSrcweir                     // default is 'false', not 'true' as specified
501*cdf0e10cSrcweir                     mrModel.mbInvertNeg = rAttribs.getBool( XML_val, false );
502*cdf0e10cSrcweir                     return 0;
503*cdf0e10cSrcweir                 case C_TOKEN( pictureOptions ):
504*cdf0e10cSrcweir                     return new PictureOptionsContext( *this, mrModel.mxPicOptions.create() );
505*cdf0e10cSrcweir                 case C_TOKEN( shape ):
506*cdf0e10cSrcweir                     // missing attribute does not change shape type to 'box' as specified
507*cdf0e10cSrcweir                     mrModel.monShape = rAttribs.getToken( XML_val );
508*cdf0e10cSrcweir                     return 0;
509*cdf0e10cSrcweir                 case C_TOKEN( trendline ):
510*cdf0e10cSrcweir                     return new TrendlineContext( *this, mrModel.maTrendlines.create() );
511*cdf0e10cSrcweir                 case C_TOKEN( val ):
512*cdf0e10cSrcweir                     return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::VALUES ) );
513*cdf0e10cSrcweir             }
514*cdf0e10cSrcweir         break;
515*cdf0e10cSrcweir     }
516*cdf0e10cSrcweir     return SeriesContextBase::onCreateContext( nElement, rAttribs );
517*cdf0e10cSrcweir }
518*cdf0e10cSrcweir 
519*cdf0e10cSrcweir // ============================================================================
520*cdf0e10cSrcweir 
521*cdf0e10cSrcweir BubbleSeriesContext::BubbleSeriesContext( ContextHandler2Helper& rParent, SeriesModel& rModel ) :
522*cdf0e10cSrcweir     SeriesContextBase( rParent, rModel )
523*cdf0e10cSrcweir {
524*cdf0e10cSrcweir }
525*cdf0e10cSrcweir 
526*cdf0e10cSrcweir BubbleSeriesContext::~BubbleSeriesContext()
527*cdf0e10cSrcweir {
528*cdf0e10cSrcweir }
529*cdf0e10cSrcweir 
530*cdf0e10cSrcweir ContextHandlerRef BubbleSeriesContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
531*cdf0e10cSrcweir {
532*cdf0e10cSrcweir     switch( getCurrentElement() )
533*cdf0e10cSrcweir     {
534*cdf0e10cSrcweir         case C_TOKEN( ser ):
535*cdf0e10cSrcweir             switch( nElement )
536*cdf0e10cSrcweir             {
537*cdf0e10cSrcweir                 case C_TOKEN( bubble3D ):
538*cdf0e10cSrcweir                     // default is 'false', not 'true' as specified
539*cdf0e10cSrcweir                     mrModel.mbBubble3d = rAttribs.getBool( XML_val, false );
540*cdf0e10cSrcweir                     return 0;
541*cdf0e10cSrcweir                 case C_TOKEN( bubbleSize ):
542*cdf0e10cSrcweir                     return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::POINTS ) );
543*cdf0e10cSrcweir                 case C_TOKEN( dLbls ):
544*cdf0e10cSrcweir                     return new DataLabelsContext( *this, mrModel.mxLabels.create() );
545*cdf0e10cSrcweir                 case C_TOKEN( dPt ):
546*cdf0e10cSrcweir                     return new DataPointContext( *this, mrModel.maPoints.create() );
547*cdf0e10cSrcweir                 case C_TOKEN( errBars ):
548*cdf0e10cSrcweir                     return new ErrorBarContext( *this, mrModel.maErrorBars.create() );
549*cdf0e10cSrcweir                 case C_TOKEN( invertIfNegative ):
550*cdf0e10cSrcweir                     // default is 'false', not 'true' as specified
551*cdf0e10cSrcweir                     mrModel.mbInvertNeg = rAttribs.getBool( XML_val, false );
552*cdf0e10cSrcweir                     return 0;
553*cdf0e10cSrcweir                 case C_TOKEN( trendline ):
554*cdf0e10cSrcweir                     return new TrendlineContext( *this, mrModel.maTrendlines.create() );
555*cdf0e10cSrcweir                 case C_TOKEN( xVal ):
556*cdf0e10cSrcweir                     return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::CATEGORIES ) );
557*cdf0e10cSrcweir                 case C_TOKEN( yVal ):
558*cdf0e10cSrcweir                     return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::VALUES ) );
559*cdf0e10cSrcweir             }
560*cdf0e10cSrcweir         break;
561*cdf0e10cSrcweir     }
562*cdf0e10cSrcweir     return SeriesContextBase::onCreateContext( nElement, rAttribs );
563*cdf0e10cSrcweir }
564*cdf0e10cSrcweir 
565*cdf0e10cSrcweir // ============================================================================
566*cdf0e10cSrcweir 
567*cdf0e10cSrcweir LineSeriesContext::LineSeriesContext( ContextHandler2Helper& rParent, SeriesModel& rModel ) :
568*cdf0e10cSrcweir     SeriesContextBase( rParent, rModel )
569*cdf0e10cSrcweir {
570*cdf0e10cSrcweir }
571*cdf0e10cSrcweir 
572*cdf0e10cSrcweir LineSeriesContext::~LineSeriesContext()
573*cdf0e10cSrcweir {
574*cdf0e10cSrcweir }
575*cdf0e10cSrcweir 
576*cdf0e10cSrcweir ContextHandlerRef LineSeriesContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
577*cdf0e10cSrcweir {
578*cdf0e10cSrcweir     switch( getCurrentElement() )
579*cdf0e10cSrcweir     {
580*cdf0e10cSrcweir         case C_TOKEN( ser ):
581*cdf0e10cSrcweir             switch( nElement )
582*cdf0e10cSrcweir             {
583*cdf0e10cSrcweir                 case C_TOKEN( cat ):
584*cdf0e10cSrcweir                     return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::CATEGORIES ) );
585*cdf0e10cSrcweir                 case C_TOKEN( dLbls ):
586*cdf0e10cSrcweir                     return new DataLabelsContext( *this, mrModel.mxLabels.create() );
587*cdf0e10cSrcweir                 case C_TOKEN( dPt ):
588*cdf0e10cSrcweir                     return new DataPointContext( *this, mrModel.maPoints.create() );
589*cdf0e10cSrcweir                 case C_TOKEN( errBars ):
590*cdf0e10cSrcweir                     return new ErrorBarContext( *this, mrModel.maErrorBars.create() );
591*cdf0e10cSrcweir                 case C_TOKEN( marker ):
592*cdf0e10cSrcweir                     return this;
593*cdf0e10cSrcweir                 case C_TOKEN( smooth ):
594*cdf0e10cSrcweir                     // default is 'false', not 'true' as specified
595*cdf0e10cSrcweir                     mrModel.mbSmooth = rAttribs.getBool( XML_val, false );
596*cdf0e10cSrcweir                     return 0;
597*cdf0e10cSrcweir                 case C_TOKEN( trendline ):
598*cdf0e10cSrcweir                     return new TrendlineContext( *this, mrModel.maTrendlines.create() );
599*cdf0e10cSrcweir                 case C_TOKEN( val ):
600*cdf0e10cSrcweir                     return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::VALUES ) );
601*cdf0e10cSrcweir             }
602*cdf0e10cSrcweir         break;
603*cdf0e10cSrcweir     }
604*cdf0e10cSrcweir     return SeriesContextBase::onCreateContext( nElement, rAttribs );
605*cdf0e10cSrcweir }
606*cdf0e10cSrcweir 
607*cdf0e10cSrcweir // ============================================================================
608*cdf0e10cSrcweir 
609*cdf0e10cSrcweir PieSeriesContext::PieSeriesContext( ContextHandler2Helper& rParent, SeriesModel& rModel ) :
610*cdf0e10cSrcweir     SeriesContextBase( rParent, rModel )
611*cdf0e10cSrcweir {
612*cdf0e10cSrcweir }
613*cdf0e10cSrcweir 
614*cdf0e10cSrcweir PieSeriesContext::~PieSeriesContext()
615*cdf0e10cSrcweir {
616*cdf0e10cSrcweir }
617*cdf0e10cSrcweir 
618*cdf0e10cSrcweir ContextHandlerRef PieSeriesContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
619*cdf0e10cSrcweir {
620*cdf0e10cSrcweir     switch( getCurrentElement() )
621*cdf0e10cSrcweir     {
622*cdf0e10cSrcweir         case C_TOKEN( ser ):
623*cdf0e10cSrcweir             switch( nElement )
624*cdf0e10cSrcweir             {
625*cdf0e10cSrcweir                 case C_TOKEN( cat ):
626*cdf0e10cSrcweir                     return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::CATEGORIES ) );
627*cdf0e10cSrcweir                 case C_TOKEN( dLbls ):
628*cdf0e10cSrcweir                     return new DataLabelsContext( *this, mrModel.mxLabels.create() );
629*cdf0e10cSrcweir                 case C_TOKEN( dPt ):
630*cdf0e10cSrcweir                     return new DataPointContext( *this, mrModel.maPoints.create() );
631*cdf0e10cSrcweir                 case C_TOKEN( explosion ):
632*cdf0e10cSrcweir                     mrModel.mnExplosion = rAttribs.getInteger( XML_val, 0 );
633*cdf0e10cSrcweir                     return 0;
634*cdf0e10cSrcweir                 case C_TOKEN( val ):
635*cdf0e10cSrcweir                     return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::VALUES ) );
636*cdf0e10cSrcweir             }
637*cdf0e10cSrcweir         break;
638*cdf0e10cSrcweir     }
639*cdf0e10cSrcweir     return SeriesContextBase::onCreateContext( nElement, rAttribs );
640*cdf0e10cSrcweir }
641*cdf0e10cSrcweir 
642*cdf0e10cSrcweir // ============================================================================
643*cdf0e10cSrcweir 
644*cdf0e10cSrcweir RadarSeriesContext::RadarSeriesContext( ContextHandler2Helper& rParent, SeriesModel& rModel ) :
645*cdf0e10cSrcweir     SeriesContextBase( rParent, rModel )
646*cdf0e10cSrcweir {
647*cdf0e10cSrcweir }
648*cdf0e10cSrcweir 
649*cdf0e10cSrcweir RadarSeriesContext::~RadarSeriesContext()
650*cdf0e10cSrcweir {
651*cdf0e10cSrcweir }
652*cdf0e10cSrcweir 
653*cdf0e10cSrcweir ContextHandlerRef RadarSeriesContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
654*cdf0e10cSrcweir {
655*cdf0e10cSrcweir     switch( getCurrentElement() )
656*cdf0e10cSrcweir     {
657*cdf0e10cSrcweir         case C_TOKEN( ser ):
658*cdf0e10cSrcweir             switch( nElement )
659*cdf0e10cSrcweir             {
660*cdf0e10cSrcweir                 case C_TOKEN( cat ):
661*cdf0e10cSrcweir                     return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::CATEGORIES ) );
662*cdf0e10cSrcweir                 case C_TOKEN( dLbls ):
663*cdf0e10cSrcweir                     return new DataLabelsContext( *this, mrModel.mxLabels.create() );
664*cdf0e10cSrcweir                 case C_TOKEN( dPt ):
665*cdf0e10cSrcweir                     return new DataPointContext( *this, mrModel.maPoints.create() );
666*cdf0e10cSrcweir                 case C_TOKEN( marker ):
667*cdf0e10cSrcweir                     return this;
668*cdf0e10cSrcweir                 case C_TOKEN( smooth ):
669*cdf0e10cSrcweir                     // default is 'false', not 'true' as specified
670*cdf0e10cSrcweir                     mrModel.mbSmooth = rAttribs.getBool( XML_val, false );
671*cdf0e10cSrcweir                     return 0;
672*cdf0e10cSrcweir                 case C_TOKEN( val ):
673*cdf0e10cSrcweir                     return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::VALUES ) );
674*cdf0e10cSrcweir             }
675*cdf0e10cSrcweir         break;
676*cdf0e10cSrcweir     }
677*cdf0e10cSrcweir     return SeriesContextBase::onCreateContext( nElement, rAttribs );
678*cdf0e10cSrcweir }
679*cdf0e10cSrcweir 
680*cdf0e10cSrcweir // ============================================================================
681*cdf0e10cSrcweir 
682*cdf0e10cSrcweir ScatterSeriesContext::ScatterSeriesContext( ContextHandler2Helper& rParent, SeriesModel& rModel ) :
683*cdf0e10cSrcweir     SeriesContextBase( rParent, rModel )
684*cdf0e10cSrcweir {
685*cdf0e10cSrcweir }
686*cdf0e10cSrcweir 
687*cdf0e10cSrcweir ScatterSeriesContext::~ScatterSeriesContext()
688*cdf0e10cSrcweir {
689*cdf0e10cSrcweir }
690*cdf0e10cSrcweir 
691*cdf0e10cSrcweir ContextHandlerRef ScatterSeriesContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
692*cdf0e10cSrcweir {
693*cdf0e10cSrcweir     switch( getCurrentElement() )
694*cdf0e10cSrcweir     {
695*cdf0e10cSrcweir         case C_TOKEN( ser ):
696*cdf0e10cSrcweir             switch( nElement )
697*cdf0e10cSrcweir             {
698*cdf0e10cSrcweir                 case C_TOKEN( dLbls ):
699*cdf0e10cSrcweir                     return new DataLabelsContext( *this, mrModel.mxLabels.create() );
700*cdf0e10cSrcweir                 case C_TOKEN( dPt ):
701*cdf0e10cSrcweir                     return new DataPointContext( *this, mrModel.maPoints.create() );
702*cdf0e10cSrcweir                 case C_TOKEN( errBars ):
703*cdf0e10cSrcweir                     return new ErrorBarContext( *this, mrModel.maErrorBars.create() );
704*cdf0e10cSrcweir                 case C_TOKEN( marker ):
705*cdf0e10cSrcweir                     return this;
706*cdf0e10cSrcweir                 case C_TOKEN( smooth ):
707*cdf0e10cSrcweir                     // default is 'false', not 'true' as specified
708*cdf0e10cSrcweir                     mrModel.mbSmooth = rAttribs.getBool( XML_val, false );
709*cdf0e10cSrcweir                     return 0;
710*cdf0e10cSrcweir                 case C_TOKEN( trendline ):
711*cdf0e10cSrcweir                     return new TrendlineContext( *this, mrModel.maTrendlines.create() );
712*cdf0e10cSrcweir                 case C_TOKEN( xVal ):
713*cdf0e10cSrcweir                     return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::CATEGORIES ) );
714*cdf0e10cSrcweir                 case C_TOKEN( yVal ):
715*cdf0e10cSrcweir                     return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::VALUES ) );
716*cdf0e10cSrcweir             }
717*cdf0e10cSrcweir         break;
718*cdf0e10cSrcweir     }
719*cdf0e10cSrcweir     return SeriesContextBase::onCreateContext( nElement, rAttribs );
720*cdf0e10cSrcweir }
721*cdf0e10cSrcweir 
722*cdf0e10cSrcweir // ============================================================================
723*cdf0e10cSrcweir 
724*cdf0e10cSrcweir SurfaceSeriesContext::SurfaceSeriesContext( ContextHandler2Helper& rParent, SeriesModel& rModel ) :
725*cdf0e10cSrcweir     SeriesContextBase( rParent, rModel )
726*cdf0e10cSrcweir {
727*cdf0e10cSrcweir }
728*cdf0e10cSrcweir 
729*cdf0e10cSrcweir SurfaceSeriesContext::~SurfaceSeriesContext()
730*cdf0e10cSrcweir {
731*cdf0e10cSrcweir }
732*cdf0e10cSrcweir 
733*cdf0e10cSrcweir ContextHandlerRef SurfaceSeriesContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
734*cdf0e10cSrcweir {
735*cdf0e10cSrcweir     switch( getCurrentElement() )
736*cdf0e10cSrcweir     {
737*cdf0e10cSrcweir         case C_TOKEN( ser ):
738*cdf0e10cSrcweir             switch( nElement )
739*cdf0e10cSrcweir             {
740*cdf0e10cSrcweir                 case C_TOKEN( cat ):
741*cdf0e10cSrcweir                     return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::CATEGORIES ) );
742*cdf0e10cSrcweir                 case C_TOKEN( val ):
743*cdf0e10cSrcweir                     return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::VALUES ) );
744*cdf0e10cSrcweir             }
745*cdf0e10cSrcweir         break;
746*cdf0e10cSrcweir     }
747*cdf0e10cSrcweir     return SeriesContextBase::onCreateContext( nElement, rAttribs );
748*cdf0e10cSrcweir }
749*cdf0e10cSrcweir 
750*cdf0e10cSrcweir // ============================================================================
751*cdf0e10cSrcweir 
752*cdf0e10cSrcweir } // namespace chart
753*cdf0e10cSrcweir } // namespace drawingml
754*cdf0e10cSrcweir } // namespace oox
755