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