fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / oox / source / drawingml / chart / seriescontext.cxx
blob9306e6371089c5ffb88058b94b9f695b515806db
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #include "drawingml/chart/seriescontext.hxx"
22 #include "drawingml/shapepropertiescontext.hxx"
23 #include "drawingml/textbodycontext.hxx"
24 #include "drawingml/chart/datasourcecontext.hxx"
25 #include "drawingml/chart/seriesmodel.hxx"
26 #include "drawingml/chart/titlecontext.hxx"
28 namespace oox {
29 namespace drawingml {
30 namespace chart {
32 using ::oox::core::ContextHandler2;
33 using ::oox::core::ContextHandler2Helper;
34 using ::oox::core::ContextHandlerRef;
36 namespace {
38 ContextHandlerRef lclDataLabelSharedCreateContext( ContextHandler2& rContext,
39 sal_Int32 nElement, const AttributeList& rAttribs, DataLabelModelBase& orModel, bool bMSO2007 )
41 if( rContext.isRootElement() ) switch( nElement )
43 case C_TOKEN( delete ):
44 orModel.mbDeleted = rAttribs.getBool( XML_val, !bMSO2007 );
45 return 0;
46 case C_TOKEN( dLblPos ):
47 orModel.monLabelPos = rAttribs.getToken( XML_val, XML_TOKEN_INVALID );
48 return 0;
49 case C_TOKEN( numFmt ):
50 orModel.maNumberFormat.setAttributes( rAttribs );
51 return 0;
52 case C_TOKEN( showBubbleSize ):
53 orModel.mobShowBubbleSize = rAttribs.getBool( XML_val );
54 return 0;
55 case C_TOKEN( showCatName ):
56 orModel.mobShowCatName = rAttribs.getBool( XML_val );
57 return 0;
58 case C_TOKEN( showLegendKey ):
59 orModel.mobShowLegendKey = rAttribs.getBool( XML_val );
60 return 0;
61 case C_TOKEN( showPercent ):
62 orModel.mobShowPercent = rAttribs.getBool( XML_val );
63 return 0;
64 case C_TOKEN( showSerName ):
65 orModel.mobShowSerName = rAttribs.getBool( XML_val );
66 return 0;
67 case C_TOKEN( showVal ):
68 orModel.mobShowVal = rAttribs.getBool( XML_val );
69 return 0;
70 case C_TOKEN( separator ):
71 // collect separator text in onCharacters()
72 return &rContext;
73 case C_TOKEN( spPr ):
74 return new ShapePropertiesContext( rContext, orModel.mxShapeProp.create() );
75 case C_TOKEN( txPr ):
76 return new TextBodyContext( rContext, orModel.mxTextProp.create() );
78 return 0;
81 void lclDataLabelSharedCharacters( ContextHandler2& rContext, const OUString& rChars, DataLabelModelBase& orModel )
83 if( rContext.isCurrentElement( C_TOKEN( separator ) ) )
84 orModel.moaSeparator = rChars;
87 } // namespace
89 DataLabelContext::DataLabelContext( ContextHandler2Helper& rParent, DataLabelModel& rModel ) :
90 ContextBase< DataLabelModel >( rParent, rModel )
94 DataLabelContext::~DataLabelContext()
98 ContextHandlerRef DataLabelContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
100 mrModel.mbDeleted = false;
101 if( isRootElement() ) switch( nElement )
103 case C_TOKEN( idx ):
104 mrModel.mnIndex = rAttribs.getInteger( XML_val, -1 );
105 return 0;
106 case C_TOKEN( layout ):
107 return new LayoutContext( *this, mrModel.mxLayout.create() );
108 case C_TOKEN( tx ):
109 return new TextContext( *this, mrModel.mxText.create() );
111 bool bMSO2007 = getFilter().isMSO2007Document();
112 return lclDataLabelSharedCreateContext( *this, nElement, rAttribs, mrModel, bMSO2007 );
115 void DataLabelContext::onCharacters( const OUString& rChars )
117 lclDataLabelSharedCharacters( *this, rChars, mrModel );
120 DataLabelsContext::DataLabelsContext( ContextHandler2Helper& rParent, DataLabelsModel& rModel ) :
121 ContextBase< DataLabelsModel >( rParent, rModel )
125 DataLabelsContext::~DataLabelsContext()
129 ContextHandlerRef DataLabelsContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
131 mrModel.mbDeleted = false;
132 bool bMSO2007Doc = getFilter().isMSO2007Document();
133 if( isRootElement() ) switch( nElement )
135 case C_TOKEN( dLbl ):
136 return new DataLabelContext( *this, mrModel.maPointLabels.create(bMSO2007Doc) );
137 case C_TOKEN( leaderLines ):
138 return new ShapePrWrapperContext( *this, mrModel.mxLeaderLines.create() );
139 case C_TOKEN( showLeaderLines ):
140 mrModel.mbShowLeaderLines = rAttribs.getBool( XML_val, !bMSO2007Doc );
141 return 0;
143 return lclDataLabelSharedCreateContext( *this, nElement, rAttribs, mrModel, bMSO2007Doc );
146 void DataLabelsContext::onCharacters( const OUString& rChars )
148 lclDataLabelSharedCharacters( *this, rChars, mrModel );
151 PictureOptionsContext::PictureOptionsContext( ContextHandler2Helper& rParent, PictureOptionsModel& rModel ) :
152 ContextBase< PictureOptionsModel >( rParent, rModel )
156 PictureOptionsContext::~PictureOptionsContext()
160 ContextHandlerRef PictureOptionsContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
162 bool bMSO2007Doc = getFilter().isMSO2007Document();
163 if( isRootElement() ) switch( nElement )
165 case C_TOKEN( applyToEnd ):
166 mrModel.mbApplyToEnd = rAttribs.getBool( XML_val, !bMSO2007Doc );
167 return 0;
168 case C_TOKEN( applyToFront ):
169 mrModel.mbApplyToFront = rAttribs.getBool( XML_val, !bMSO2007Doc );
170 return 0;
171 case C_TOKEN( applyToSides ):
172 mrModel.mbApplyToSides = rAttribs.getBool( XML_val, !bMSO2007Doc );
173 return 0;
174 case C_TOKEN( pictureFormat ):
175 mrModel.mnPictureFormat = rAttribs.getToken( XML_val, XML_stretch );
176 return 0;
177 case C_TOKEN( pictureStackUnit ):
178 mrModel.mfStackUnit = rAttribs.getDouble( XML_val, 1.0 );
179 return 0;
181 return 0;
184 ErrorBarContext::ErrorBarContext( ContextHandler2Helper& rParent, ErrorBarModel& rModel ) :
185 ContextBase< ErrorBarModel >( rParent, rModel )
189 ErrorBarContext::~ErrorBarContext()
193 ContextHandlerRef ErrorBarContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
195 bool bMSO2007Doc = getFilter().isMSO2007Document();
196 if( isRootElement() ) switch( nElement )
198 case C_TOKEN( errBarType ):
199 mrModel.mnTypeId = rAttribs.getToken( XML_val, XML_both );
200 return 0;
201 case C_TOKEN( errDir ):
202 mrModel.mnDirection = rAttribs.getToken( XML_val, XML_TOKEN_INVALID );
203 return 0;
204 case C_TOKEN( errValType ):
205 mrModel.mnValueType = rAttribs.getToken( XML_val, XML_fixedVal );
206 return 0;
207 case C_TOKEN( minus ):
208 return new DataSourceContext( *this, mrModel.maSources.create( ErrorBarModel::MINUS ) );
209 case C_TOKEN( noEndCap ):
210 mrModel.mbNoEndCap = rAttribs.getBool( XML_val, !bMSO2007Doc );
211 return 0;
212 case C_TOKEN( plus ):
213 return new DataSourceContext( *this, mrModel.maSources.create( ErrorBarModel::PLUS ) );
214 case C_TOKEN( spPr ):
215 return new ShapePropertiesContext( *this, mrModel.mxShapeProp.create() );
216 case C_TOKEN( val ):
217 mrModel.mfValue = rAttribs.getDouble( XML_val, 0.0 );
218 return 0;
220 return 0;
223 TrendlineLabelContext::TrendlineLabelContext( ContextHandler2Helper& rParent, TrendlineLabelModel& rModel ) :
224 ContextBase< TrendlineLabelModel >( rParent, rModel )
228 TrendlineLabelContext::~TrendlineLabelContext()
232 ContextHandlerRef TrendlineLabelContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
234 if( isRootElement() ) switch( nElement )
236 case C_TOKEN( layout ):
237 return new LayoutContext( *this, mrModel.mxLayout.create() );
238 case C_TOKEN( numFmt ):
239 mrModel.maNumberFormat.setAttributes( rAttribs );
240 return 0;
241 case C_TOKEN( spPr ):
242 return new ShapePropertiesContext( *this, mrModel.mxShapeProp.create() );
243 case C_TOKEN( tx ):
244 return new TextContext( *this, mrModel.mxText.create() );
245 case C_TOKEN( txPr ):
246 return new TextBodyContext( *this, mrModel.mxTextProp.create() );
248 return 0;
251 TrendlineContext::TrendlineContext( ContextHandler2Helper& rParent, TrendlineModel& rModel ) :
252 ContextBase< TrendlineModel >( rParent, rModel )
256 TrendlineContext::~TrendlineContext()
260 ContextHandlerRef TrendlineContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
262 bool bMSO2007Doc = getFilter().isMSO2007Document();
263 if( isRootElement() ) switch( nElement )
265 case C_TOKEN( backward ):
266 mrModel.mfBackward = rAttribs.getDouble( XML_val, 0.0 );
267 return 0;
268 case C_TOKEN( dispEq ):
269 mrModel.mbDispEquation = rAttribs.getBool( XML_val, !bMSO2007Doc );
270 return 0;
271 case C_TOKEN( dispRSqr ):
272 mrModel.mbDispRSquared = rAttribs.getBool( XML_val, !bMSO2007Doc );
273 return 0;
274 case C_TOKEN( forward ):
275 mrModel.mfForward = rAttribs.getDouble( XML_val, 0.0 );
276 return 0;
277 case C_TOKEN( intercept ):
278 mrModel.mfIntercept = rAttribs.getDouble( XML_val, 0.0 );
279 return 0;
280 case C_TOKEN( name ):
281 return this; // collect name in onCharacters()
282 case C_TOKEN( order ):
283 mrModel.mnOrder = rAttribs.getInteger( XML_val, 2 );
284 return 0;
285 case C_TOKEN( period ):
286 mrModel.mnPeriod = rAttribs.getInteger( XML_val, 2 );
287 return 0;
288 case C_TOKEN( spPr ):
289 return new ShapePropertiesContext( *this, mrModel.mxShapeProp.create() );
290 case C_TOKEN( trendlineLbl ):
291 return new TrendlineLabelContext( *this, mrModel.mxLabel.create() );
292 case C_TOKEN( trendlineType ):
293 mrModel.mnTypeId = rAttribs.getToken( XML_val, XML_linear );
294 return 0;
296 return 0;
299 void TrendlineContext::onCharacters( const OUString& rChars )
301 if( isCurrentElement( C_TOKEN( name ) ) )
302 mrModel.maName = rChars;
305 DataPointContext::DataPointContext( ContextHandler2Helper& rParent, DataPointModel& rModel ) :
306 ContextBase< DataPointModel >( rParent, rModel )
310 DataPointContext::~DataPointContext()
314 ContextHandlerRef DataPointContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
316 bool bMSO2007Doc = getFilter().isMSO2007Document();
317 switch( getCurrentElement() )
319 case C_TOKEN( dPt ):
320 switch( nElement )
322 case C_TOKEN( bubble3D ):
323 mrModel.mobBubble3d = rAttribs.getBool( XML_val );
324 return 0;
325 case C_TOKEN( explosion ):
326 // if the 'val' attribute is missing, series explosion remains unchanged
327 mrModel.monExplosion = rAttribs.getInteger( XML_val );
328 return 0;
329 case C_TOKEN( idx ):
330 mrModel.mnIndex = rAttribs.getInteger( XML_val, -1 );
331 return 0;
332 case C_TOKEN( invertIfNegative ):
333 mrModel.mbInvertNeg = rAttribs.getBool( XML_val, !bMSO2007Doc );
334 return 0;
335 case C_TOKEN( marker ):
336 return this;
337 case C_TOKEN( pictureOptions ):
338 return new PictureOptionsContext( *this, mrModel.mxPicOptions.create(bMSO2007Doc) );
339 case C_TOKEN( spPr ):
340 return new ShapePropertiesContext( *this, mrModel.mxShapeProp.create() );
342 break;
344 case C_TOKEN( marker ):
345 switch( nElement )
347 case C_TOKEN( size ):
348 mrModel.monMarkerSize = rAttribs.getInteger( XML_val, 5 );
349 return 0;
350 case C_TOKEN( spPr ):
351 return new ShapePropertiesContext( *this, mrModel.mxMarkerProp.create() );
352 case C_TOKEN( symbol ):
353 mrModel.monMarkerSymbol = rAttribs.getToken( XML_val, XML_none );
354 return 0;
356 break;
358 return 0;
361 SeriesContextBase::SeriesContextBase( ContextHandler2Helper& rParent, SeriesModel& rModel ) :
362 ContextBase< SeriesModel >( rParent, rModel )
366 SeriesContextBase::~SeriesContextBase()
370 ContextHandlerRef SeriesContextBase::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
372 switch( getCurrentElement() )
374 case C_TOKEN( ser ):
375 switch( nElement )
377 case C_TOKEN( idx ):
378 mrModel.mnIndex = rAttribs.getInteger( XML_val, -1 );
379 return 0;
380 case C_TOKEN( order ):
381 mrModel.mnOrder = rAttribs.getInteger( XML_val, -1 );
382 return 0;
383 case C_TOKEN( spPr ):
384 return new ShapePropertiesContext( *this, mrModel.mxShapeProp.create() );
385 case C_TOKEN( tx ):
386 return new TextContext( *this, mrModel.mxText.create() );
388 break;
390 case C_TOKEN( marker ):
391 switch( nElement )
393 case C_TOKEN( size ):
394 mrModel.mnMarkerSize = rAttribs.getInteger( XML_val, 5 );
395 return 0;
396 case C_TOKEN( spPr ):
397 return new ShapePropertiesContext( *this, mrModel.mxMarkerProp.create() );
398 case C_TOKEN( symbol ):
399 mrModel.mnMarkerSymbol = rAttribs.getToken( XML_val, XML_none );
400 return 0;
402 break;
404 return 0;
407 AreaSeriesContext::AreaSeriesContext( ContextHandler2Helper& rParent, SeriesModel& rModel ) :
408 SeriesContextBase( rParent, rModel )
412 AreaSeriesContext::~AreaSeriesContext()
416 ContextHandlerRef AreaSeriesContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
418 bool bMSO2007Doc = getFilter().isMSO2007Document();
419 switch( getCurrentElement() )
421 case C_TOKEN( ser ):
422 switch( nElement )
424 case C_TOKEN( cat ):
425 return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::CATEGORIES ) );
426 case C_TOKEN( errBars ):
427 return new ErrorBarContext( *this, mrModel.maErrorBars.create(bMSO2007Doc) );
428 case C_TOKEN( dLbls ):
429 return new DataLabelsContext( *this, mrModel.mxLabels.create(bMSO2007Doc) );
430 case C_TOKEN( dPt ):
431 return new DataPointContext( *this, mrModel.maPoints.create(bMSO2007Doc) );
432 case C_TOKEN( trendline ):
433 return new TrendlineContext( *this, mrModel.maTrendlines.create(bMSO2007Doc) );
434 case C_TOKEN( val ):
435 return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::VALUES ) );
437 break;
439 return SeriesContextBase::onCreateContext( nElement, rAttribs );
442 BarSeriesContext::BarSeriesContext( ContextHandler2Helper& rParent, SeriesModel& rModel ) :
443 SeriesContextBase( rParent, rModel )
447 BarSeriesContext::~BarSeriesContext()
451 ContextHandlerRef BarSeriesContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
453 bool bMSO2007Doc = getFilter().isMSO2007Document();
454 switch( getCurrentElement() )
456 case C_TOKEN( ser ):
457 switch( nElement )
459 case C_TOKEN( cat ):
460 return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::CATEGORIES ) );
461 case C_TOKEN( dLbls ):
462 return new DataLabelsContext( *this, mrModel.mxLabels.create(bMSO2007Doc) );
463 case C_TOKEN( dPt ):
464 return new DataPointContext( *this, mrModel.maPoints.create(bMSO2007Doc) );
465 case C_TOKEN( errBars ):
466 return new ErrorBarContext( *this, mrModel.maErrorBars.create(bMSO2007Doc) );
467 case C_TOKEN( invertIfNegative ):
468 mrModel.mbInvertNeg = rAttribs.getBool( XML_val, !bMSO2007Doc );
469 return 0;
470 case C_TOKEN( pictureOptions ):
471 return new PictureOptionsContext( *this, mrModel.mxPicOptions.create(bMSO2007Doc) );
472 case C_TOKEN( shape ):
473 mrModel.monShape = rAttribs.getToken( bMSO2007Doc ? XML_val : XML_box );
474 return 0;
475 case C_TOKEN( trendline ):
476 return new TrendlineContext( *this, mrModel.maTrendlines.create(bMSO2007Doc) );
477 case C_TOKEN( val ):
478 return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::VALUES ) );
480 break;
482 return SeriesContextBase::onCreateContext( nElement, rAttribs );
485 BubbleSeriesContext::BubbleSeriesContext( ContextHandler2Helper& rParent, SeriesModel& rModel ) :
486 SeriesContextBase( rParent, rModel )
490 BubbleSeriesContext::~BubbleSeriesContext()
494 ContextHandlerRef BubbleSeriesContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
496 bool bMSO2007Doc = getFilter().isMSO2007Document();
497 switch( getCurrentElement() )
499 case C_TOKEN( ser ):
500 switch( nElement )
502 case C_TOKEN( bubble3D ):
503 mrModel.mbBubble3d = rAttribs.getBool( XML_val, !bMSO2007Doc );
504 return 0;
505 case C_TOKEN( bubbleSize ):
506 return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::POINTS ) );
507 case C_TOKEN( dLbls ):
508 return new DataLabelsContext( *this, mrModel.mxLabels.create(bMSO2007Doc) );
509 case C_TOKEN( dPt ):
510 return new DataPointContext( *this, mrModel.maPoints.create(bMSO2007Doc) );
511 case C_TOKEN( errBars ):
512 return new ErrorBarContext( *this, mrModel.maErrorBars.create(bMSO2007Doc) );
513 case C_TOKEN( invertIfNegative ):
514 mrModel.mbInvertNeg = rAttribs.getBool( XML_val, !bMSO2007Doc );
515 return 0;
516 case C_TOKEN( trendline ):
517 return new TrendlineContext( *this, mrModel.maTrendlines.create(bMSO2007Doc) );
518 case C_TOKEN( xVal ):
519 return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::CATEGORIES ) );
520 case C_TOKEN( yVal ):
521 return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::VALUES ) );
523 break;
525 return SeriesContextBase::onCreateContext( nElement, rAttribs );
528 LineSeriesContext::LineSeriesContext( ContextHandler2Helper& rParent, SeriesModel& rModel ) :
529 SeriesContextBase( rParent, rModel )
533 LineSeriesContext::~LineSeriesContext()
537 ContextHandlerRef LineSeriesContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
539 bool bMSO2007Doc = getFilter().isMSO2007Document();
540 switch( getCurrentElement() )
542 case C_TOKEN( ser ):
543 switch( nElement )
545 case C_TOKEN( cat ):
546 return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::CATEGORIES ) );
547 case C_TOKEN( dLbls ):
548 return new DataLabelsContext( *this, mrModel.mxLabels.create(bMSO2007Doc) );
549 case C_TOKEN( dPt ):
550 return new DataPointContext( *this, mrModel.maPoints.create(bMSO2007Doc) );
551 case C_TOKEN( errBars ):
552 return new ErrorBarContext( *this, mrModel.maErrorBars.create(bMSO2007Doc) );
553 case C_TOKEN( marker ):
554 return this;
555 case C_TOKEN( smooth ):
556 mrModel.mbSmooth = rAttribs.getBool( XML_val, !bMSO2007Doc );
557 return 0;
558 case C_TOKEN( trendline ):
559 return new TrendlineContext( *this, mrModel.maTrendlines.create(bMSO2007Doc) );
560 case C_TOKEN( val ):
561 return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::VALUES ) );
563 break;
565 return SeriesContextBase::onCreateContext( nElement, rAttribs );
568 PieSeriesContext::PieSeriesContext( ContextHandler2Helper& rParent, SeriesModel& rModel ) :
569 SeriesContextBase( rParent, rModel )
573 PieSeriesContext::~PieSeriesContext()
577 ContextHandlerRef PieSeriesContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
579 bool bMSO2007Doc = getFilter().isMSO2007Document();
580 switch( getCurrentElement() )
582 case C_TOKEN( ser ):
583 switch( nElement )
585 case C_TOKEN( cat ):
586 return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::CATEGORIES ) );
587 case C_TOKEN( dLbls ):
588 return new DataLabelsContext( *this, mrModel.mxLabels.create(bMSO2007Doc) );
589 case C_TOKEN( dPt ):
590 return new DataPointContext( *this, mrModel.maPoints.create(bMSO2007Doc) );
591 case C_TOKEN( explosion ):
592 mrModel.mnExplosion = rAttribs.getInteger( XML_val, 0 );
593 return 0;
594 case C_TOKEN( val ):
595 return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::VALUES ) );
597 break;
599 return SeriesContextBase::onCreateContext( nElement, rAttribs );
602 RadarSeriesContext::RadarSeriesContext( ContextHandler2Helper& rParent, SeriesModel& rModel ) :
603 SeriesContextBase( rParent, rModel )
607 RadarSeriesContext::~RadarSeriesContext()
611 ContextHandlerRef RadarSeriesContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
613 bool bMSO2007Doc = getFilter().isMSO2007Document();
614 switch( getCurrentElement() )
616 case C_TOKEN( ser ):
617 switch( nElement )
619 case C_TOKEN( cat ):
620 return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::CATEGORIES ) );
621 case C_TOKEN( dLbls ):
622 return new DataLabelsContext( *this, mrModel.mxLabels.create(bMSO2007Doc) );
623 case C_TOKEN( dPt ):
624 return new DataPointContext( *this, mrModel.maPoints.create(bMSO2007Doc) );
625 case C_TOKEN( marker ):
626 return this;
627 case C_TOKEN( smooth ):
628 mrModel.mbSmooth = rAttribs.getBool( XML_val, bMSO2007Doc );
629 return 0;
630 case C_TOKEN( val ):
631 return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::VALUES ) );
633 break;
635 return SeriesContextBase::onCreateContext( nElement, rAttribs );
638 ScatterSeriesContext::ScatterSeriesContext( ContextHandler2Helper& rParent, SeriesModel& rModel ) :
639 SeriesContextBase( rParent, rModel )
643 ScatterSeriesContext::~ScatterSeriesContext()
647 ContextHandlerRef ScatterSeriesContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
649 bool bMSO2007Doc = getFilter().isMSO2007Document();
650 switch( getCurrentElement() )
652 case C_TOKEN( ser ):
653 switch( nElement )
655 case C_TOKEN( dLbls ):
656 return new DataLabelsContext( *this, mrModel.mxLabels.create(bMSO2007Doc) );
657 case C_TOKEN( dPt ):
658 return new DataPointContext( *this, mrModel.maPoints.create(bMSO2007Doc) );
659 case C_TOKEN( errBars ):
660 return new ErrorBarContext( *this, mrModel.maErrorBars.create(bMSO2007Doc) );
661 case C_TOKEN( marker ):
662 return this;
663 case C_TOKEN( smooth ):
664 mrModel.mbSmooth = rAttribs.getBool( XML_val, !bMSO2007Doc );
665 return 0;
666 case C_TOKEN( trendline ):
667 return new TrendlineContext( *this, mrModel.maTrendlines.create(bMSO2007Doc) );
668 case C_TOKEN( xVal ):
669 return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::CATEGORIES ) );
670 case C_TOKEN( yVal ):
671 return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::VALUES ) );
673 break;
675 return SeriesContextBase::onCreateContext( nElement, rAttribs );
678 SurfaceSeriesContext::SurfaceSeriesContext( ContextHandler2Helper& rParent, SeriesModel& rModel ) :
679 SeriesContextBase( rParent, rModel )
683 SurfaceSeriesContext::~SurfaceSeriesContext()
687 ContextHandlerRef SurfaceSeriesContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
689 switch( getCurrentElement() )
691 case C_TOKEN( ser ):
692 switch( nElement )
694 case C_TOKEN( cat ):
695 return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::CATEGORIES ) );
696 case C_TOKEN( val ):
697 return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::VALUES ) );
699 break;
701 return SeriesContextBase::onCreateContext( nElement, rAttribs );
704 } // namespace chart
705 } // namespace drawingml
706 } // namespace oox
708 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */