1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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>
27 #include <oox/core/xmlfilterbase.hxx>
28 #include <oox/helper/attributelist.hxx>
29 #include <oox/token/namespaces.hxx>
30 #include <oox/token/tokens.hxx>
32 namespace oox::drawingml::chart
{
34 using ::oox::core::ContextHandler2
;
35 using ::oox::core::ContextHandler2Helper
;
36 using ::oox::core::ContextHandlerRef
;
40 ContextHandlerRef
lclDataLabelSharedCreateContext( ContextHandler2
& rContext
,
41 sal_Int32 nElement
, const AttributeList
& rAttribs
, DataLabelModelBase
& orModel
, bool bMSO2007
)
43 if( rContext
.isRootElement() ) switch( nElement
)
45 case C_TOKEN( delete ):
46 orModel
.mbDeleted
= rAttribs
.getBool( XML_val
, !bMSO2007
);
48 case C_TOKEN( dLblPos
):
49 orModel
.monLabelPos
= rAttribs
.getToken( XML_val
, XML_TOKEN_INVALID
);
51 case C_TOKEN( numFmt
):
52 orModel
.maNumberFormat
.setAttributes( rAttribs
);
54 case C_TOKEN( showBubbleSize
):
55 orModel
.mobShowBubbleSize
= rAttribs
.getBool( XML_val
);
57 case C_TOKEN( showCatName
):
58 orModel
.mobShowCatName
= rAttribs
.getBool( XML_val
);
60 case C_TOKEN( showLegendKey
):
61 orModel
.mobShowLegendKey
= rAttribs
.getBool( XML_val
);
63 case C_TOKEN( showPercent
):
64 orModel
.mobShowPercent
= rAttribs
.getBool( XML_val
);
66 case C_TOKEN( showSerName
):
67 orModel
.mobShowSerName
= rAttribs
.getBool( XML_val
);
69 case C_TOKEN( showVal
):
70 orModel
.mobShowVal
= rAttribs
.getBool( XML_val
);
72 case C_TOKEN( separator
):
73 // collect separator text in onCharacters()
76 return new ShapePropertiesContext( rContext
, orModel
.mxShapeProp
.create() );
78 return new TextBodyContext( rContext
, orModel
.mxTextProp
.create() );
83 void lclDataLabelSharedCharacters( ContextHandler2
const & rContext
, const OUString
& rChars
, DataLabelModelBase
& orModel
)
85 if( rContext
.isCurrentElement( C_TOKEN( separator
) ) )
86 orModel
.moaSeparator
= rChars
;
91 DataLabelContext::DataLabelContext( ContextHandler2Helper
& rParent
, DataLabelModel
& rModel
) :
92 ContextBase
< DataLabelModel
>( rParent
, rModel
)
94 mrModel
.mbDeleted
= false;
97 DataLabelContext::~DataLabelContext()
101 ContextHandlerRef
DataLabelContext::onCreateContext( sal_Int32 nElement
, const AttributeList
& rAttribs
)
103 if( isRootElement() )
108 mrModel
.mnIndex
= rAttribs
.getInteger( XML_val
, -1 );
110 case C_TOKEN( layout
):
111 return new LayoutContext( *this, mrModel
.mxLayout
.create() );
113 return new TextContext( *this, mrModel
.mxText
.create() );
114 case C_TOKEN( extLst
):
120 switch( getCurrentElement() )
122 case C_TOKEN( extLst
):
123 if ( nElement
== C_TOKEN( ext
) )
127 if ( nElement
== C15_TOKEN( showDataLabelsRange
) )
129 mrModel
.mobShowDataLabelsRange
= rAttribs
.getBool( XML_val
);
132 else if (nElement
== C15_TOKEN(layout
))
133 return new LayoutContext(*this, mrModel
.mxLayout
.getOrCreate());
137 bool bMSO2007
= getFilter().isMSO2007Document();
138 return lclDataLabelSharedCreateContext( *this, nElement
, rAttribs
, mrModel
, bMSO2007
);
141 void DataLabelContext::onCharacters( const OUString
& rChars
)
143 lclDataLabelSharedCharacters( *this, rChars
, mrModel
);
146 DataLabelsContext::DataLabelsContext( ContextHandler2Helper
& rParent
, DataLabelsModel
& rModel
) :
147 ContextBase
< DataLabelsModel
>( rParent
, rModel
)
149 mrModel
.mbDeleted
= false;
152 DataLabelsContext::~DataLabelsContext()
156 ContextHandlerRef
DataLabelsContext::onCreateContext( sal_Int32 nElement
, const AttributeList
& rAttribs
)
158 bool bMSO2007Doc
= getFilter().isMSO2007Document();
159 if( isRootElement() ) switch( nElement
)
161 case C_TOKEN( dLbl
):
162 return new DataLabelContext( *this, mrModel
.maPointLabels
.create(mrModel
, bMSO2007Doc
) );
163 case C_TOKEN( leaderLines
):
164 return new ShapePrWrapperContext( *this, mrModel
.mxLeaderLines
.create() );
165 case C_TOKEN( showLeaderLines
):
166 case C15_TOKEN( showLeaderLines
):
167 mrModel
.mbShowLeaderLines
= rAttribs
.getBool( XML_val
, true );
169 case C_TOKEN( extLst
):
171 return new DataLabelsContext( *this, mrModel
);
173 return lclDataLabelSharedCreateContext( *this, nElement
, rAttribs
, mrModel
, bMSO2007Doc
);
176 void DataLabelsContext::onCharacters( const OUString
& rChars
)
178 lclDataLabelSharedCharacters( *this, rChars
, mrModel
);
181 PictureOptionsContext::PictureOptionsContext( ContextHandler2Helper
& rParent
, PictureOptionsModel
& rModel
) :
182 ContextBase
< PictureOptionsModel
>( rParent
, rModel
)
186 PictureOptionsContext::~PictureOptionsContext()
190 ContextHandlerRef
PictureOptionsContext::onCreateContext( sal_Int32 nElement
, const AttributeList
& rAttribs
)
192 bool bMSO2007Doc
= getFilter().isMSO2007Document();
193 if( isRootElement() ) switch( nElement
)
195 case C_TOKEN( applyToEnd
):
196 mrModel
.mbApplyToEnd
= rAttribs
.getBool( XML_val
, !bMSO2007Doc
);
198 case C_TOKEN( applyToFront
):
199 mrModel
.mbApplyToFront
= rAttribs
.getBool( XML_val
, !bMSO2007Doc
);
201 case C_TOKEN( applyToSides
):
202 mrModel
.mbApplyToSides
= rAttribs
.getBool( XML_val
, !bMSO2007Doc
);
204 case C_TOKEN( pictureFormat
):
205 mrModel
.mnPictureFormat
= rAttribs
.getToken( XML_val
, XML_stretch
);
207 case C_TOKEN( pictureStackUnit
):
208 mrModel
.mfStackUnit
= rAttribs
.getDouble( XML_val
, 1.0 );
214 ErrorBarContext::ErrorBarContext( ContextHandler2Helper
& rParent
, ErrorBarModel
& rModel
) :
215 ContextBase
< ErrorBarModel
>( rParent
, rModel
)
219 ErrorBarContext::~ErrorBarContext()
223 ContextHandlerRef
ErrorBarContext::onCreateContext( sal_Int32 nElement
, const AttributeList
& rAttribs
)
225 bool bMSO2007Doc
= getFilter().isMSO2007Document();
226 if( isRootElement() ) switch( nElement
)
228 case C_TOKEN( errBarType
):
229 mrModel
.mnTypeId
= rAttribs
.getToken( XML_val
, XML_both
);
231 case C_TOKEN( errDir
):
232 mrModel
.mnDirection
= rAttribs
.getToken( XML_val
, XML_TOKEN_INVALID
);
234 case C_TOKEN( errValType
):
235 mrModel
.mnValueType
= rAttribs
.getToken( XML_val
, XML_fixedVal
);
237 case C_TOKEN( minus
):
238 return new DataSourceContext( *this, mrModel
.maSources
.create( ErrorBarModel::MINUS
) );
239 case C_TOKEN( noEndCap
):
240 mrModel
.mbNoEndCap
= rAttribs
.getBool( XML_val
, !bMSO2007Doc
);
242 case C_TOKEN( plus
):
243 return new DataSourceContext( *this, mrModel
.maSources
.create( ErrorBarModel::PLUS
) );
244 case C_TOKEN( spPr
):
245 return new ShapePropertiesContext( *this, mrModel
.mxShapeProp
.create() );
247 mrModel
.mfValue
= rAttribs
.getDouble( XML_val
, 0.0 );
253 TrendlineLabelContext::TrendlineLabelContext( ContextHandler2Helper
& rParent
, TrendlineLabelModel
& rModel
) :
254 ContextBase
< TrendlineLabelModel
>( rParent
, rModel
)
258 TrendlineLabelContext::~TrendlineLabelContext()
262 ContextHandlerRef
TrendlineLabelContext::onCreateContext( sal_Int32 nElement
, const AttributeList
& rAttribs
)
264 if( isRootElement() ) switch( nElement
)
266 case C_TOKEN( layout
):
267 return new LayoutContext( *this, mrModel
.mxLayout
.create() );
268 case C_TOKEN( numFmt
):
269 mrModel
.maNumberFormat
.setAttributes( rAttribs
);
271 case C_TOKEN( spPr
):
272 return new ShapePropertiesContext( *this, mrModel
.mxShapeProp
.create() );
274 return new TextContext( *this, mrModel
.mxText
.create() );
275 case C_TOKEN( txPr
):
276 return new TextBodyContext( *this, mrModel
.mxTextProp
.create() );
281 TrendlineContext::TrendlineContext( ContextHandler2Helper
& rParent
, TrendlineModel
& rModel
) :
282 ContextBase
< TrendlineModel
>( rParent
, rModel
)
286 TrendlineContext::~TrendlineContext()
290 ContextHandlerRef
TrendlineContext::onCreateContext( sal_Int32 nElement
, const AttributeList
& rAttribs
)
292 bool bMSO2007Doc
= getFilter().isMSO2007Document();
293 if( isRootElement() ) switch( nElement
)
295 case C_TOKEN( backward
):
296 mrModel
.mfBackward
= rAttribs
.getDouble( XML_val
, 0.0 );
298 case C_TOKEN( dispEq
):
299 mrModel
.mbDispEquation
= rAttribs
.getBool( XML_val
, !bMSO2007Doc
);
301 case C_TOKEN( dispRSqr
):
302 mrModel
.mbDispRSquared
= rAttribs
.getBool( XML_val
, !bMSO2007Doc
);
304 case C_TOKEN( forward
):
305 mrModel
.mfForward
= rAttribs
.getDouble( XML_val
, 0.0 );
307 case C_TOKEN( intercept
):
308 mrModel
.mfIntercept
= rAttribs
.getDouble( XML_val
, 0.0 );
310 case C_TOKEN( name
):
311 return this; // collect name in onCharacters()
312 case C_TOKEN( order
):
313 mrModel
.mnOrder
= rAttribs
.getInteger( XML_val
, 2 );
315 case C_TOKEN( period
):
316 mrModel
.mnPeriod
= rAttribs
.getInteger( XML_val
, 2 );
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
);
329 void TrendlineContext::onCharacters( const OUString
& rChars
)
331 if( isCurrentElement( C_TOKEN( name
) ) )
332 mrModel
.maName
= rChars
;
335 DataPointContext::DataPointContext( ContextHandler2Helper
& rParent
, DataPointModel
& rModel
) :
336 ContextBase
< DataPointModel
>( rParent
, rModel
)
340 DataPointContext::~DataPointContext()
344 ContextHandlerRef
DataPointContext::onCreateContext( sal_Int32 nElement
, const AttributeList
& rAttribs
)
346 bool bMSO2007Doc
= getFilter().isMSO2007Document();
347 switch( getCurrentElement() )
352 case C_TOKEN( bubble3D
):
353 mrModel
.mobBubble3d
= rAttribs
.getBool( XML_val
);
355 case C_TOKEN( explosion
):
356 // if the 'val' attribute is missing, series explosion remains unchanged
357 mrModel
.monExplosion
= rAttribs
.getInteger( XML_val
);
360 mrModel
.mnIndex
= rAttribs
.getInteger( XML_val
, -1 );
362 case C_TOKEN( invertIfNegative
):
363 mrModel
.mbInvertNeg
= rAttribs
.getBool( XML_val
, !bMSO2007Doc
);
365 case C_TOKEN( marker
):
367 case C_TOKEN( pictureOptions
):
368 return new PictureOptionsContext( *this, mrModel
.mxPicOptions
.create(bMSO2007Doc
) );
369 case C_TOKEN( spPr
):
370 return new ShapePropertiesContext( *this, mrModel
.mxShapeProp
.create() );
374 case C_TOKEN( marker
):
377 case C_TOKEN( size
):
378 mrModel
.monMarkerSize
= rAttribs
.getInteger( XML_val
, 5 );
380 case C_TOKEN( spPr
):
381 return new ShapePropertiesContext( *this, mrModel
.mxMarkerProp
.create() );
382 case C_TOKEN( symbol
):
383 mrModel
.monMarkerSymbol
= rAttribs
.getToken( XML_val
, XML_none
);
391 SeriesContextBase::SeriesContextBase( ContextHandler2Helper
& rParent
, SeriesModel
& rModel
) :
392 ContextBase
< SeriesModel
>( rParent
, rModel
)
396 SeriesContextBase::~SeriesContextBase()
400 ContextHandlerRef
SeriesContextBase::onCreateContext( sal_Int32 nElement
, const AttributeList
& rAttribs
)
402 switch( getCurrentElement() )
408 mrModel
.mnIndex
= rAttribs
.getInteger( XML_val
, -1 );
410 case C_TOKEN( order
):
411 mrModel
.mnOrder
= rAttribs
.getInteger( XML_val
, -1 );
413 case C_TOKEN( spPr
):
414 return new ShapePropertiesContext( *this, mrModel
.mxShapeProp
.create() );
416 return new TextContext( *this, mrModel
.mxText
.create() );
417 case C_TOKEN( extLst
):
422 case C_TOKEN( marker
):
425 case C_TOKEN( size
):
426 mrModel
.mnMarkerSize
= rAttribs
.getInteger( XML_val
, 5 );
428 case C_TOKEN( spPr
):
429 return new ShapePropertiesContext( *this, mrModel
.mxMarkerProp
.create() );
430 case C_TOKEN( symbol
):
431 mrModel
.mnMarkerSymbol
= rAttribs
.getToken( XML_val
, XML_none
);
436 case C_TOKEN( extLst
):
440 if (mrModel
.maSources
.has( SeriesModel::DATALABELS
))
443 DataSourceModel
& rLabelsSource
= mrModel
.maSources
.create( SeriesModel::DATALABELS
);
444 if (mrModel
.mxLabels
.is())
445 mrModel
.mxLabels
->mpLabelsSource
= &rLabelsSource
;
446 return new DataSourceContext( *this, rLabelsSource
);
452 AreaSeriesContext::AreaSeriesContext( ContextHandler2Helper
& rParent
, SeriesModel
& rModel
) :
453 SeriesContextBase( rParent
, rModel
)
457 AreaSeriesContext::~AreaSeriesContext()
461 ContextHandlerRef
AreaSeriesContext::onCreateContext( sal_Int32 nElement
, const AttributeList
& rAttribs
)
463 bool bMSO2007Doc
= getFilter().isMSO2007Document();
464 switch( getCurrentElement() )
470 return new DataSourceContext( *this, mrModel
.maSources
.create( SeriesModel::CATEGORIES
) );
471 case C_TOKEN( errBars
):
472 return new ErrorBarContext( *this, mrModel
.maErrorBars
.create(bMSO2007Doc
) );
473 case C_TOKEN( dLbls
):
474 return new DataLabelsContext( *this, mrModel
.mxLabels
.create(bMSO2007Doc
) );
476 return new DataPointContext( *this, mrModel
.maPoints
.create(bMSO2007Doc
) );
477 case C_TOKEN( trendline
):
478 return new TrendlineContext( *this, mrModel
.maTrendlines
.create(bMSO2007Doc
) );
480 return new DataSourceContext( *this, mrModel
.maSources
.create( SeriesModel::VALUES
) );
484 return SeriesContextBase::onCreateContext( nElement
, rAttribs
);
487 BarSeriesContext::BarSeriesContext( ContextHandler2Helper
& rParent
, SeriesModel
& rModel
) :
488 SeriesContextBase( rParent
, rModel
)
492 BarSeriesContext::~BarSeriesContext()
496 ContextHandlerRef
BarSeriesContext::onCreateContext( sal_Int32 nElement
, const AttributeList
& rAttribs
)
498 bool bMSO2007Doc
= getFilter().isMSO2007Document();
499 switch( getCurrentElement() )
505 return new DataSourceContext( *this, mrModel
.maSources
.create( SeriesModel::CATEGORIES
) );
506 case C_TOKEN( dLbls
):
507 return new DataLabelsContext( *this, mrModel
.mxLabels
.create(bMSO2007Doc
) );
509 return new DataPointContext( *this, mrModel
.maPoints
.create(bMSO2007Doc
) );
510 case C_TOKEN( errBars
):
511 return new ErrorBarContext( *this, mrModel
.maErrorBars
.create(bMSO2007Doc
) );
512 case C_TOKEN( invertIfNegative
):
513 mrModel
.mbInvertNeg
= rAttribs
.getBool( XML_val
, !bMSO2007Doc
);
515 case C_TOKEN( pictureOptions
):
516 return new PictureOptionsContext( *this, mrModel
.mxPicOptions
.create(bMSO2007Doc
) );
517 case C_TOKEN( shape
):
518 mrModel
.monShape
= rAttribs
.getToken(XML_val
);
520 case C_TOKEN( trendline
):
521 return new TrendlineContext( *this, mrModel
.maTrendlines
.create(bMSO2007Doc
) );
523 return new DataSourceContext( *this, mrModel
.maSources
.create( SeriesModel::VALUES
) );
527 return SeriesContextBase::onCreateContext( nElement
, rAttribs
);
530 BubbleSeriesContext::BubbleSeriesContext( ContextHandler2Helper
& rParent
, SeriesModel
& rModel
) :
531 SeriesContextBase( rParent
, rModel
)
535 BubbleSeriesContext::~BubbleSeriesContext()
539 ContextHandlerRef
BubbleSeriesContext::onCreateContext( sal_Int32 nElement
, const AttributeList
& rAttribs
)
541 bool bMSO2007Doc
= getFilter().isMSO2007Document();
542 switch( getCurrentElement() )
547 case C_TOKEN( bubble3D
):
548 mrModel
.mbBubble3d
= rAttribs
.getBool( XML_val
, !bMSO2007Doc
);
550 case C_TOKEN( bubbleSize
):
551 return new DataSourceContext( *this, mrModel
.maSources
.create( SeriesModel::POINTS
) );
552 case C_TOKEN( dLbls
):
553 return new DataLabelsContext( *this, mrModel
.mxLabels
.create(bMSO2007Doc
) );
555 return new DataPointContext( *this, mrModel
.maPoints
.create(bMSO2007Doc
) );
556 case C_TOKEN( errBars
):
557 return new ErrorBarContext( *this, mrModel
.maErrorBars
.create(bMSO2007Doc
) );
558 case C_TOKEN( invertIfNegative
):
559 mrModel
.mbInvertNeg
= rAttribs
.getBool( XML_val
, !bMSO2007Doc
);
561 case C_TOKEN( trendline
):
562 return new TrendlineContext( *this, mrModel
.maTrendlines
.create(bMSO2007Doc
) );
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
) );
570 return SeriesContextBase::onCreateContext( nElement
, rAttribs
);
573 LineSeriesContext::LineSeriesContext( ContextHandler2Helper
& rParent
, SeriesModel
& rModel
) :
574 SeriesContextBase( rParent
, rModel
)
578 LineSeriesContext::~LineSeriesContext()
582 ContextHandlerRef
LineSeriesContext::onCreateContext( sal_Int32 nElement
, const AttributeList
& rAttribs
)
584 bool bMSO2007Doc
= getFilter().isMSO2007Document();
585 switch( getCurrentElement() )
591 return new DataSourceContext( *this, mrModel
.maSources
.create( SeriesModel::CATEGORIES
) );
592 case C_TOKEN( dLbls
):
593 return new DataLabelsContext( *this, mrModel
.mxLabels
.create(bMSO2007Doc
) );
595 return new DataPointContext( *this, mrModel
.maPoints
.create(bMSO2007Doc
) );
596 case C_TOKEN( errBars
):
597 return new ErrorBarContext( *this, mrModel
.maErrorBars
.create(bMSO2007Doc
) );
598 case C_TOKEN( marker
):
600 case C_TOKEN( smooth
):
601 mrModel
.mbSmooth
= rAttribs
.getBool( XML_val
, !bMSO2007Doc
);
603 case C_TOKEN( trendline
):
604 return new TrendlineContext( *this, mrModel
.maTrendlines
.create(bMSO2007Doc
) );
606 return new DataSourceContext( *this, mrModel
.maSources
.create( SeriesModel::VALUES
) );
610 return SeriesContextBase::onCreateContext( nElement
, rAttribs
);
613 PieSeriesContext::PieSeriesContext( ContextHandler2Helper
& rParent
, SeriesModel
& rModel
) :
614 SeriesContextBase( rParent
, rModel
)
618 PieSeriesContext::~PieSeriesContext()
622 ContextHandlerRef
PieSeriesContext::onCreateContext( sal_Int32 nElement
, const AttributeList
& rAttribs
)
624 bool bMSO2007Doc
= getFilter().isMSO2007Document();
625 switch( getCurrentElement() )
631 return new DataSourceContext( *this, mrModel
.maSources
.create( SeriesModel::CATEGORIES
) );
632 case C_TOKEN( dLbls
):
633 return new DataLabelsContext( *this, mrModel
.mxLabels
.create(bMSO2007Doc
) );
635 return new DataPointContext( *this, mrModel
.maPoints
.create(bMSO2007Doc
) );
636 case C_TOKEN( explosion
):
637 mrModel
.mnExplosion
= rAttribs
.getInteger( XML_val
, 0 );
640 return new DataSourceContext( *this, mrModel
.maSources
.create( SeriesModel::VALUES
) );
644 return SeriesContextBase::onCreateContext( nElement
, rAttribs
);
647 RadarSeriesContext::RadarSeriesContext( ContextHandler2Helper
& rParent
, SeriesModel
& rModel
) :
648 SeriesContextBase( rParent
, rModel
)
652 RadarSeriesContext::~RadarSeriesContext()
656 ContextHandlerRef
RadarSeriesContext::onCreateContext( sal_Int32 nElement
, const AttributeList
& rAttribs
)
658 bool bMSO2007Doc
= getFilter().isMSO2007Document();
659 switch( getCurrentElement() )
665 return new DataSourceContext( *this, mrModel
.maSources
.create( SeriesModel::CATEGORIES
) );
666 case C_TOKEN( dLbls
):
667 return new DataLabelsContext( *this, mrModel
.mxLabels
.create(bMSO2007Doc
) );
669 return new DataPointContext( *this, mrModel
.maPoints
.create(bMSO2007Doc
) );
670 case C_TOKEN( marker
):
672 case C_TOKEN( smooth
):
673 mrModel
.mbSmooth
= rAttribs
.getBool( XML_val
, bMSO2007Doc
);
676 return new DataSourceContext( *this, mrModel
.maSources
.create( SeriesModel::VALUES
) );
680 return SeriesContextBase::onCreateContext( nElement
, rAttribs
);
683 ScatterSeriesContext::ScatterSeriesContext( ContextHandler2Helper
& rParent
, SeriesModel
& rModel
) :
684 SeriesContextBase( rParent
, rModel
)
688 ScatterSeriesContext::~ScatterSeriesContext()
692 ContextHandlerRef
ScatterSeriesContext::onCreateContext( sal_Int32 nElement
, const AttributeList
& rAttribs
)
694 bool bMSO2007Doc
= getFilter().isMSO2007Document();
695 switch( getCurrentElement() )
700 case C_TOKEN( dLbls
):
701 return new DataLabelsContext( *this, mrModel
.mxLabels
.create(bMSO2007Doc
) );
703 return new DataPointContext( *this, mrModel
.maPoints
.create(bMSO2007Doc
) );
704 case C_TOKEN( errBars
):
705 return new ErrorBarContext( *this, mrModel
.maErrorBars
.create(bMSO2007Doc
) );
706 case C_TOKEN( marker
):
708 case C_TOKEN( smooth
):
709 mrModel
.mbSmooth
= rAttribs
.getBool( XML_val
, !bMSO2007Doc
);
711 case C_TOKEN( trendline
):
712 return new TrendlineContext( *this, mrModel
.maTrendlines
.create(bMSO2007Doc
) );
713 case C_TOKEN( xVal
):
714 return new DataSourceContext( *this, mrModel
.maSources
.create( SeriesModel::CATEGORIES
) );
715 case C_TOKEN( yVal
):
716 return new DataSourceContext( *this, mrModel
.maSources
.create( SeriesModel::VALUES
) );
720 return SeriesContextBase::onCreateContext( nElement
, rAttribs
);
723 SurfaceSeriesContext::SurfaceSeriesContext( ContextHandler2Helper
& rParent
, SeriesModel
& rModel
) :
724 SeriesContextBase( rParent
, rModel
)
728 SurfaceSeriesContext::~SurfaceSeriesContext()
732 ContextHandlerRef
SurfaceSeriesContext::onCreateContext( sal_Int32 nElement
, const AttributeList
& rAttribs
)
734 switch( getCurrentElement() )
740 return new DataSourceContext( *this, mrModel
.maSources
.create( SeriesModel::CATEGORIES
) );
742 return new DataSourceContext( *this, mrModel
.maSources
.create( SeriesModel::VALUES
) );
746 return SeriesContextBase::onCreateContext( nElement
, rAttribs
);
751 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */