Update ooo320-m1
[ooovba.git] / oox / source / drawingml / chart / seriescontext.cxx
bloba52c5fb4182cfd627c8a7b428fee621e7a58363b
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: seriescontext.cxx,v $
10 * $Revision: 1.6 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #include "oox/drawingml/chart/seriescontext.hxx"
32 #include "oox/drawingml/shapepropertiescontext.hxx"
33 #include "oox/drawingml/textbodycontext.hxx"
34 #include "oox/drawingml/chart/datasourcecontext.hxx"
35 #include "oox/drawingml/chart/seriesmodel.hxx"
36 #include "oox/drawingml/chart/titlecontext.hxx"
38 using ::rtl::OUString;
39 using ::oox::core::ContextHandler2;
40 using ::oox::core::ContextHandler2Helper;
41 using ::oox::core::ContextHandlerRef;
43 namespace oox {
44 namespace drawingml {
45 namespace chart {
47 // ============================================================================
49 namespace {
51 ContextHandlerRef lclDataLabelSharedCreateContext(
52 ContextHandler2& rContext, sal_Int32 nElement, const AttributeList& rAttribs, DataLabelModelBase& orModel )
54 if( rContext.isRootElement() ) switch( nElement )
56 case C_TOKEN( delete ):
57 // default is 'false', not 'true' as specified
58 orModel.mbDeleted = rAttribs.getBool( XML_val, false );
59 return 0;
60 case C_TOKEN( dLblPos ):
61 orModel.monLabelPos = rAttribs.getToken( XML_val, XML_TOKEN_INVALID );
62 return 0;
63 case C_TOKEN( numFmt ):
64 orModel.maNumberFormat.setAttributes( rAttribs );
65 return 0;
66 case C_TOKEN( showBubbleSize ):
67 orModel.mobShowBubbleSize = rAttribs.getBool( XML_val );
68 return 0;
69 case C_TOKEN( showCatName ):
70 orModel.mobShowCatName = rAttribs.getBool( XML_val );
71 return 0;
72 case C_TOKEN( showLegendKey ):
73 orModel.mobShowLegendKey = rAttribs.getBool( XML_val );
74 return 0;
75 case C_TOKEN( showPercent ):
76 orModel.mobShowPercent = rAttribs.getBool( XML_val );
77 return 0;
78 case C_TOKEN( showSerName ):
79 orModel.mobShowSerName = rAttribs.getBool( XML_val );
80 return 0;
81 case C_TOKEN( showVal ):
82 orModel.mobShowVal = rAttribs.getBool( XML_val );
83 return 0;
84 case C_TOKEN( separator ):
85 // collect separator text in onEndElement()
86 return &rContext;
87 case C_TOKEN( spPr ):
88 return new ShapePropertiesContext( rContext, orModel.mxShapeProp.create() );
89 case C_TOKEN( txPr ):
90 return new TextBodyContext( rContext, orModel.mxTextProp.create() );
92 return 0;
95 void lclDataLabelSharedEndElement( ContextHandler2& rContext, const OUString& rChars, DataLabelModelBase& orModel )
97 switch( rContext.getCurrentElement() )
99 case C_TOKEN( separator ):
100 orModel.moaSeparator = rChars;
101 break;
105 } // namespace
107 // ============================================================================
109 DataLabelContext::DataLabelContext( ContextHandler2Helper& rParent, DataLabelModel& rModel ) :
110 ContextBase< DataLabelModel >( rParent, rModel )
114 DataLabelContext::~DataLabelContext()
118 ContextHandlerRef DataLabelContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
120 if( isRootElement() ) switch( nElement )
122 case C_TOKEN( idx ):
123 mrModel.mnIndex = rAttribs.getInteger( XML_val, -1 );
124 return 0;
125 case C_TOKEN( layout ):
126 return new LayoutContext( *this, mrModel.mxLayout.create() );
127 case C_TOKEN( tx ):
128 return new TextContext( *this, mrModel.mxText.create() );
130 return lclDataLabelSharedCreateContext( *this, nElement, rAttribs, mrModel );
133 void DataLabelContext::onEndElement( const OUString& rChars )
135 lclDataLabelSharedEndElement( *this, rChars, mrModel );
138 // ============================================================================
140 DataLabelsContext::DataLabelsContext( ContextHandler2Helper& rParent, DataLabelsModel& rModel ) :
141 ContextBase< DataLabelsModel >( rParent, rModel )
145 DataLabelsContext::~DataLabelsContext()
149 ContextHandlerRef DataLabelsContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
151 if( isRootElement() ) switch( nElement )
153 case C_TOKEN( dLbl ):
154 return new DataLabelContext( *this, mrModel.maPointLabels.create() );
155 case C_TOKEN( leaderLines ):
156 return new ShapePrWrapperContext( *this, mrModel.mxLeaderLines.create() );
157 case C_TOKEN( showLeaderLines ):
158 // default is 'false', not 'true' as specified
159 mrModel.mbShowLeaderLines = rAttribs.getBool( XML_val, false );
160 return 0;
162 return lclDataLabelSharedCreateContext( *this, nElement, rAttribs, mrModel );
165 void DataLabelsContext::onEndElement( const OUString& rChars )
167 lclDataLabelSharedEndElement( *this, rChars, mrModel );
170 // ============================================================================
172 PictureOptionsContext::PictureOptionsContext( ContextHandler2Helper& rParent, PictureOptionsModel& rModel ) :
173 ContextBase< PictureOptionsModel >( rParent, rModel )
177 PictureOptionsContext::~PictureOptionsContext()
181 ContextHandlerRef PictureOptionsContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
183 if( isRootElement() ) switch( nElement )
185 case C_TOKEN( applyToEnd ):
186 // default is 'false', not 'true' as specified
187 mrModel.mbApplyToEnd = rAttribs.getBool( XML_val, false );
188 return 0;
189 case C_TOKEN( applyToFront ):
190 // default is 'false', not 'true' as specified
191 mrModel.mbApplyToFront = rAttribs.getBool( XML_val, false );
192 return 0;
193 case C_TOKEN( applyToSides ):
194 // default is 'false', not 'true' as specified
195 mrModel.mbApplyToSides = rAttribs.getBool( XML_val, false );
196 return 0;
197 case C_TOKEN( pictureFormat ):
198 mrModel.mnPictureFormat = rAttribs.getToken( XML_val, XML_stretch );
199 return 0;
200 case C_TOKEN( pictureStackUnit ):
201 mrModel.mfStackUnit = rAttribs.getDouble( XML_val, 1.0 );
202 return 0;
204 return 0;
207 // ============================================================================
209 ErrorBarContext::ErrorBarContext( ContextHandler2Helper& rParent, ErrorBarModel& rModel ) :
210 ContextBase< ErrorBarModel >( rParent, rModel )
214 ErrorBarContext::~ErrorBarContext()
218 ContextHandlerRef ErrorBarContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
220 if( isRootElement() ) switch( nElement )
222 case C_TOKEN( errBarType ):
223 mrModel.mnTypeId = rAttribs.getToken( XML_val, XML_both );
224 return 0;
225 case C_TOKEN( errDir ):
226 mrModel.mnDirection = rAttribs.getToken( XML_val, XML_TOKEN_INVALID );
227 return 0;
228 case C_TOKEN( errValType ):
229 mrModel.mnValueType = rAttribs.getToken( XML_val, XML_fixedVal );
230 return 0;
231 case C_TOKEN( minus ):
232 return new DataSourceContext( *this, mrModel.maSources.create( ErrorBarModel::MINUS ) );
233 case C_TOKEN( noEndCap ):
234 // default is 'false', not 'true' as specified
235 mrModel.mbNoEndCap = rAttribs.getBool( XML_val, false );
236 return 0;
237 case C_TOKEN( plus ):
238 return new DataSourceContext( *this, mrModel.maSources.create( ErrorBarModel::PLUS ) );
239 case C_TOKEN( spPr ):
240 return new ShapePropertiesContext( *this, mrModel.mxShapeProp.create() );
241 case C_TOKEN( val ):
242 mrModel.mfValue = rAttribs.getDouble( XML_val, 0.0 );
243 return 0;
245 return 0;
248 // ============================================================================
250 TrendlineLabelContext::TrendlineLabelContext( ContextHandler2Helper& rParent, TrendlineLabelModel& rModel ) :
251 ContextBase< TrendlineLabelModel >( rParent, rModel )
255 TrendlineLabelContext::~TrendlineLabelContext()
259 ContextHandlerRef TrendlineLabelContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
261 if( isRootElement() ) switch( nElement )
263 case C_TOKEN( layout ):
264 return new LayoutContext( *this, mrModel.mxLayout.create() );
265 case C_TOKEN( numFmt ):
266 mrModel.maNumberFormat.setAttributes( rAttribs );
267 return 0;
268 case C_TOKEN( spPr ):
269 return new ShapePropertiesContext( *this, mrModel.mxShapeProp.create() );
270 case C_TOKEN( tx ):
271 return new TextContext( *this, mrModel.mxText.create() );
272 case C_TOKEN( txPr ):
273 return new TextBodyContext( *this, mrModel.mxTextProp.create() );
275 return 0;
278 // ============================================================================
280 TrendlineContext::TrendlineContext( ContextHandler2Helper& rParent, TrendlineModel& rModel ) :
281 ContextBase< TrendlineModel >( rParent, rModel )
285 TrendlineContext::~TrendlineContext()
289 ContextHandlerRef TrendlineContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
291 if( isRootElement() ) switch( nElement )
293 case C_TOKEN( backward ):
294 mrModel.mfBackward = rAttribs.getDouble( XML_val, 0.0 );
295 return 0;
296 case C_TOKEN( dispEq ):
297 // default is 'false', not 'true' as specified
298 mrModel.mbDispEquation = rAttribs.getBool( XML_val, false );
299 return 0;
300 case C_TOKEN( dispRSqr ):
301 // default is 'false', not 'true' as specified
302 mrModel.mbDispRSquared = rAttribs.getBool( XML_val, false );
303 return 0;
304 case C_TOKEN( forward ):
305 mrModel.mfForward = rAttribs.getDouble( XML_val, 0.0 );
306 return 0;
307 case C_TOKEN( intercept ):
308 mrModel.mfIntercept = rAttribs.getDouble( XML_val, 0.0 );
309 return 0;
310 case C_TOKEN( name ):
311 return this; // collect name in onEndElement()
312 case C_TOKEN( order ):
313 mrModel.mnOrder = rAttribs.getInteger( XML_val, 2 );
314 return 0;
315 case C_TOKEN( period ):
316 mrModel.mnPeriod = rAttribs.getInteger( XML_val, 2 );
317 return 0;
318 case C_TOKEN( spPr ):
319 return new ShapePropertiesContext( *this, mrModel.mxShapeProp.create() );
320 case C_TOKEN( trendlineLbl ):
321 return new TrendlineLabelContext( *this, mrModel.mxLabel.create() );
322 case C_TOKEN( trendlineType ):
323 mrModel.mnTypeId = rAttribs.getToken( XML_val, XML_linear );
324 return 0;
326 return 0;
329 void TrendlineContext::onEndElement( const ::rtl::OUString& rChars )
331 switch( getCurrentElement() )
333 case C_TOKEN( name ):
334 mrModel.maName = rChars;
335 break;
339 // ============================================================================
341 DataPointContext::DataPointContext( ContextHandler2Helper& rParent, DataPointModel& rModel ) :
342 ContextBase< DataPointModel >( rParent, rModel )
346 DataPointContext::~DataPointContext()
350 ContextHandlerRef DataPointContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
352 switch( getCurrentElement() )
354 case C_TOKEN( dPt ):
355 switch( nElement )
357 case C_TOKEN( bubble3D ):
358 mrModel.mobBubble3d = rAttribs.getBool( XML_val );
359 return 0;
360 case C_TOKEN( explosion ):
361 // if the 'val' attribute is missing, series explosion remains unchanged
362 mrModel.monExplosion = rAttribs.getInteger( XML_val );
363 return 0;
364 case C_TOKEN( idx ):
365 mrModel.mnIndex = rAttribs.getInteger( XML_val, -1 );
366 return 0;
367 case C_TOKEN( invertIfNegative ):
368 // default is 'false', not 'true' as specified (value not derived from series!)
369 mrModel.mbInvertNeg = rAttribs.getBool( XML_val, false );
370 return 0;
371 case C_TOKEN( marker ):
372 return this;
373 case C_TOKEN( pictureOptions ):
374 return new PictureOptionsContext( *this, mrModel.mxPicOptions.create() );
375 case C_TOKEN( spPr ):
376 return new ShapePropertiesContext( *this, mrModel.mxShapeProp.create() );
378 break;
380 case C_TOKEN( marker ):
381 switch( nElement )
383 case C_TOKEN( size ):
384 mrModel.monMarkerSize = rAttribs.getInteger( XML_val, 5 );
385 return 0;
386 case C_TOKEN( spPr ):
387 return new ShapePropertiesContext( *this, mrModel.mxMarkerProp.create() );
388 case C_TOKEN( symbol ):
389 mrModel.monMarkerSymbol = rAttribs.getToken( XML_val, XML_none );
390 return 0;
392 break;
394 return 0;
397 // ============================================================================
399 SeriesContextBase::SeriesContextBase( ContextHandler2Helper& rParent, SeriesModel& rModel ) :
400 ContextBase< SeriesModel >( rParent, rModel )
404 SeriesContextBase::~SeriesContextBase()
408 ContextHandlerRef SeriesContextBase::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
410 switch( getCurrentElement() )
412 case C_TOKEN( ser ):
413 switch( nElement )
415 case C_TOKEN( idx ):
416 mrModel.mnIndex = rAttribs.getInteger( XML_val, -1 );
417 return 0;
418 case C_TOKEN( order ):
419 mrModel.mnOrder = rAttribs.getInteger( XML_val, -1 );
420 return 0;
421 case C_TOKEN( spPr ):
422 return new ShapePropertiesContext( *this, mrModel.mxShapeProp.create() );
423 case C_TOKEN( tx ):
424 return new TextContext( *this, mrModel.mxText.create() );
426 break;
428 case C_TOKEN( marker ):
429 switch( nElement )
431 case C_TOKEN( size ):
432 mrModel.mnMarkerSize = rAttribs.getInteger( XML_val, 5 );
433 return 0;
434 case C_TOKEN( spPr ):
435 return new ShapePropertiesContext( *this, mrModel.mxMarkerProp.create() );
436 case C_TOKEN( symbol ):
437 mrModel.mnMarkerSymbol = rAttribs.getToken( XML_val, XML_none );
438 return 0;
440 break;
442 return 0;
445 // ============================================================================
447 AreaSeriesContext::AreaSeriesContext( ContextHandler2Helper& rParent, SeriesModel& rModel ) :
448 SeriesContextBase( rParent, rModel )
452 AreaSeriesContext::~AreaSeriesContext()
456 ContextHandlerRef AreaSeriesContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
458 switch( getCurrentElement() )
460 case C_TOKEN( ser ):
461 switch( nElement )
463 case C_TOKEN( cat ):
464 return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::CATEGORIES ) );
465 case C_TOKEN( errBars ):
466 return new ErrorBarContext( *this, mrModel.maErrorBars.create() );
467 case C_TOKEN( dLbls ):
468 return new DataLabelsContext( *this, mrModel.mxLabels.create() );
469 case C_TOKEN( dPt ):
470 return new DataPointContext( *this, mrModel.maPoints.create() );
471 case C_TOKEN( trendline ):
472 return new TrendlineContext( *this, mrModel.maTrendlines.create() );
473 case C_TOKEN( val ):
474 return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::VALUES ) );
476 break;
478 return SeriesContextBase::onCreateContext( nElement, rAttribs );
481 // ============================================================================
483 BarSeriesContext::BarSeriesContext( ContextHandler2Helper& rParent, SeriesModel& rModel ) :
484 SeriesContextBase( rParent, rModel )
488 BarSeriesContext::~BarSeriesContext()
492 ContextHandlerRef BarSeriesContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
494 switch( getCurrentElement() )
496 case C_TOKEN( ser ):
497 switch( nElement )
499 case C_TOKEN( cat ):
500 return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::CATEGORIES ) );
501 case C_TOKEN( dLbls ):
502 return new DataLabelsContext( *this, mrModel.mxLabels.create() );
503 case C_TOKEN( dPt ):
504 return new DataPointContext( *this, mrModel.maPoints.create() );
505 case C_TOKEN( errBars ):
506 return new ErrorBarContext( *this, mrModel.maErrorBars.create() );
507 case C_TOKEN( invertIfNegative ):
508 // default is 'false', not 'true' as specified
509 mrModel.mbInvertNeg = rAttribs.getBool( XML_val, false );
510 return 0;
511 case C_TOKEN( pictureOptions ):
512 return new PictureOptionsContext( *this, mrModel.mxPicOptions.create() );
513 case C_TOKEN( shape ):
514 // missing attribute does not change shape type to 'box' as specified
515 mrModel.monShape = rAttribs.getToken( XML_val );
516 return 0;
517 case C_TOKEN( trendline ):
518 return new TrendlineContext( *this, mrModel.maTrendlines.create() );
519 case C_TOKEN( val ):
520 return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::VALUES ) );
522 break;
524 return SeriesContextBase::onCreateContext( nElement, rAttribs );
527 // ============================================================================
529 BubbleSeriesContext::BubbleSeriesContext( ContextHandler2Helper& rParent, SeriesModel& rModel ) :
530 SeriesContextBase( rParent, rModel )
534 BubbleSeriesContext::~BubbleSeriesContext()
538 ContextHandlerRef BubbleSeriesContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
540 switch( getCurrentElement() )
542 case C_TOKEN( ser ):
543 switch( nElement )
545 case C_TOKEN( bubble3D ):
546 // default is 'false', not 'true' as specified
547 mrModel.mbBubble3d = rAttribs.getBool( XML_val, false );
548 return 0;
549 case C_TOKEN( bubbleSize ):
550 return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::POINTS ) );
551 case C_TOKEN( dLbls ):
552 return new DataLabelsContext( *this, mrModel.mxLabels.create() );
553 case C_TOKEN( dPt ):
554 return new DataPointContext( *this, mrModel.maPoints.create() );
555 case C_TOKEN( errBars ):
556 return new ErrorBarContext( *this, mrModel.maErrorBars.create() );
557 case C_TOKEN( invertIfNegative ):
558 // default is 'false', not 'true' as specified
559 mrModel.mbInvertNeg = rAttribs.getBool( XML_val, false );
560 return 0;
561 case C_TOKEN( trendline ):
562 return new TrendlineContext( *this, mrModel.maTrendlines.create() );
563 case C_TOKEN( xVal ):
564 return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::CATEGORIES ) );
565 case C_TOKEN( yVal ):
566 return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::VALUES ) );
568 break;
570 return SeriesContextBase::onCreateContext( nElement, rAttribs );
573 // ============================================================================
575 LineSeriesContext::LineSeriesContext( ContextHandler2Helper& rParent, SeriesModel& rModel ) :
576 SeriesContextBase( rParent, rModel )
580 LineSeriesContext::~LineSeriesContext()
584 ContextHandlerRef LineSeriesContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
586 switch( getCurrentElement() )
588 case C_TOKEN( ser ):
589 switch( nElement )
591 case C_TOKEN( cat ):
592 return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::CATEGORIES ) );
593 case C_TOKEN( dLbls ):
594 return new DataLabelsContext( *this, mrModel.mxLabels.create() );
595 case C_TOKEN( dPt ):
596 return new DataPointContext( *this, mrModel.maPoints.create() );
597 case C_TOKEN( errBars ):
598 return new ErrorBarContext( *this, mrModel.maErrorBars.create() );
599 case C_TOKEN( marker ):
600 return this;
601 case C_TOKEN( smooth ):
602 // default is 'false', not 'true' as specified
603 mrModel.mbSmooth = rAttribs.getBool( XML_val, false );
604 return 0;
605 case C_TOKEN( trendline ):
606 return new TrendlineContext( *this, mrModel.maTrendlines.create() );
607 case C_TOKEN( val ):
608 return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::VALUES ) );
610 break;
612 return SeriesContextBase::onCreateContext( nElement, rAttribs );
615 // ============================================================================
617 PieSeriesContext::PieSeriesContext( ContextHandler2Helper& rParent, SeriesModel& rModel ) :
618 SeriesContextBase( rParent, rModel )
622 PieSeriesContext::~PieSeriesContext()
626 ContextHandlerRef PieSeriesContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
628 switch( getCurrentElement() )
630 case C_TOKEN( ser ):
631 switch( nElement )
633 case C_TOKEN( cat ):
634 return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::CATEGORIES ) );
635 case C_TOKEN( dLbls ):
636 return new DataLabelsContext( *this, mrModel.mxLabels.create() );
637 case C_TOKEN( dPt ):
638 return new DataPointContext( *this, mrModel.maPoints.create() );
639 case C_TOKEN( explosion ):
640 mrModel.mnExplosion = rAttribs.getInteger( XML_val, 0 );
641 return 0;
642 case C_TOKEN( val ):
643 return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::VALUES ) );
645 break;
647 return SeriesContextBase::onCreateContext( nElement, rAttribs );
650 // ============================================================================
652 RadarSeriesContext::RadarSeriesContext( ContextHandler2Helper& rParent, SeriesModel& rModel ) :
653 SeriesContextBase( rParent, rModel )
657 RadarSeriesContext::~RadarSeriesContext()
661 ContextHandlerRef RadarSeriesContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
663 switch( getCurrentElement() )
665 case C_TOKEN( ser ):
666 switch( nElement )
668 case C_TOKEN( cat ):
669 return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::CATEGORIES ) );
670 case C_TOKEN( dLbls ):
671 return new DataLabelsContext( *this, mrModel.mxLabels.create() );
672 case C_TOKEN( dPt ):
673 return new DataPointContext( *this, mrModel.maPoints.create() );
674 case C_TOKEN( marker ):
675 return this;
676 case C_TOKEN( smooth ):
677 // default is 'false', not 'true' as specified
678 mrModel.mbSmooth = rAttribs.getBool( XML_val, false );
679 return 0;
680 case C_TOKEN( val ):
681 return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::VALUES ) );
683 break;
685 return SeriesContextBase::onCreateContext( nElement, rAttribs );
688 // ============================================================================
690 ScatterSeriesContext::ScatterSeriesContext( ContextHandler2Helper& rParent, SeriesModel& rModel ) :
691 SeriesContextBase( rParent, rModel )
695 ScatterSeriesContext::~ScatterSeriesContext()
699 ContextHandlerRef ScatterSeriesContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
701 switch( getCurrentElement() )
703 case C_TOKEN( ser ):
704 switch( nElement )
706 case C_TOKEN( dLbls ):
707 return new DataLabelsContext( *this, mrModel.mxLabels.create() );
708 case C_TOKEN( dPt ):
709 return new DataPointContext( *this, mrModel.maPoints.create() );
710 case C_TOKEN( errBars ):
711 return new ErrorBarContext( *this, mrModel.maErrorBars.create() );
712 case C_TOKEN( marker ):
713 return this;
714 case C_TOKEN( smooth ):
715 // default is 'false', not 'true' as specified
716 mrModel.mbSmooth = rAttribs.getBool( XML_val, false );
717 return 0;
718 case C_TOKEN( trendline ):
719 return new TrendlineContext( *this, mrModel.maTrendlines.create() );
720 case C_TOKEN( xVal ):
721 return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::CATEGORIES ) );
722 case C_TOKEN( yVal ):
723 return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::VALUES ) );
725 break;
727 return SeriesContextBase::onCreateContext( nElement, rAttribs );
730 // ============================================================================
732 SurfaceSeriesContext::SurfaceSeriesContext( ContextHandler2Helper& rParent, SeriesModel& rModel ) :
733 SeriesContextBase( rParent, rModel )
737 SurfaceSeriesContext::~SurfaceSeriesContext()
741 ContextHandlerRef SurfaceSeriesContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
743 switch( getCurrentElement() )
745 case C_TOKEN( ser ):
746 switch( nElement )
748 case C_TOKEN( cat ):
749 return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::CATEGORIES ) );
750 case C_TOKEN( val ):
751 return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::VALUES ) );
753 break;
755 return SeriesContextBase::onCreateContext( nElement, rAttribs );
758 // ============================================================================
760 } // namespace chart
761 } // namespace drawingml
762 } // namespace oox