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>
36 using ::oox::core::ContextHandler2
;
37 using ::oox::core::ContextHandler2Helper
;
38 using ::oox::core::ContextHandlerRef
;
42 ContextHandlerRef
lclDataLabelSharedCreateContext( ContextHandler2
& rContext
,
43 sal_Int32 nElement
, const AttributeList
& rAttribs
, DataLabelModelBase
& orModel
, bool bMSO2007
)
45 if( rContext
.isRootElement() ) switch( nElement
)
47 case C_TOKEN( delete ):
48 orModel
.mbDeleted
= rAttribs
.getBool( XML_val
, !bMSO2007
);
50 case C_TOKEN( dLblPos
):
51 orModel
.monLabelPos
= rAttribs
.getToken( XML_val
, XML_TOKEN_INVALID
);
53 case C_TOKEN( numFmt
):
54 orModel
.maNumberFormat
.setAttributes( rAttribs
);
56 case C_TOKEN( showBubbleSize
):
57 orModel
.mobShowBubbleSize
= rAttribs
.getBool( XML_val
);
59 case C_TOKEN( showCatName
):
60 orModel
.mobShowCatName
= rAttribs
.getBool( XML_val
);
62 case C_TOKEN( showLegendKey
):
63 orModel
.mobShowLegendKey
= rAttribs
.getBool( XML_val
);
65 case C_TOKEN( showPercent
):
66 orModel
.mobShowPercent
= rAttribs
.getBool( XML_val
);
68 case C_TOKEN( showSerName
):
69 orModel
.mobShowSerName
= rAttribs
.getBool( XML_val
);
71 case C_TOKEN( showVal
):
72 orModel
.mobShowVal
= rAttribs
.getBool( XML_val
);
74 case C_TOKEN( separator
):
75 // collect separator text in onCharacters()
78 return new ShapePropertiesContext( rContext
, orModel
.mxShapeProp
.create() );
80 return new TextBodyContext( rContext
, orModel
.mxTextProp
.create() );
85 void lclDataLabelSharedCharacters( ContextHandler2
const & rContext
, const OUString
& rChars
, DataLabelModelBase
& orModel
)
87 if( rContext
.isCurrentElement( C_TOKEN( separator
) ) )
88 orModel
.moaSeparator
= rChars
;
93 DataLabelContext::DataLabelContext( ContextHandler2Helper
& rParent
, DataLabelModel
& rModel
) :
94 ContextBase
< DataLabelModel
>( rParent
, rModel
)
96 mrModel
.mbDeleted
= false;
99 DataLabelContext::~DataLabelContext()
103 ContextHandlerRef
DataLabelContext::onCreateContext( sal_Int32 nElement
, const AttributeList
& rAttribs
)
105 if( isRootElement() ) switch( nElement
)
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() );
115 bool bMSO2007
= getFilter().isMSO2007Document();
116 return lclDataLabelSharedCreateContext( *this, nElement
, rAttribs
, mrModel
, bMSO2007
);
119 void DataLabelContext::onCharacters( const OUString
& rChars
)
121 lclDataLabelSharedCharacters( *this, rChars
, mrModel
);
124 DataLabelsContext::DataLabelsContext( ContextHandler2Helper
& rParent
, DataLabelsModel
& rModel
) :
125 ContextBase
< DataLabelsModel
>( rParent
, rModel
)
127 mrModel
.mbDeleted
= false;
130 DataLabelsContext::~DataLabelsContext()
134 ContextHandlerRef
DataLabelsContext::onCreateContext( sal_Int32 nElement
, const AttributeList
& rAttribs
)
136 bool bMSO2007Doc
= getFilter().isMSO2007Document();
137 if( isRootElement() ) switch( nElement
)
139 case C_TOKEN( dLbl
):
140 return new DataLabelContext( *this, mrModel
.maPointLabels
.create(bMSO2007Doc
) );
141 case C_TOKEN( leaderLines
):
142 return new ShapePrWrapperContext( *this, mrModel
.mxLeaderLines
.create() );
143 case C_TOKEN( showLeaderLines
):
144 mrModel
.mbShowLeaderLines
= rAttribs
.getBool( XML_val
, !bMSO2007Doc
);
147 return lclDataLabelSharedCreateContext( *this, nElement
, rAttribs
, mrModel
, bMSO2007Doc
);
150 void DataLabelsContext::onCharacters( const OUString
& rChars
)
152 lclDataLabelSharedCharacters( *this, rChars
, mrModel
);
155 PictureOptionsContext::PictureOptionsContext( ContextHandler2Helper
& rParent
, PictureOptionsModel
& rModel
) :
156 ContextBase
< PictureOptionsModel
>( rParent
, rModel
)
160 PictureOptionsContext::~PictureOptionsContext()
164 ContextHandlerRef
PictureOptionsContext::onCreateContext( sal_Int32 nElement
, const AttributeList
& rAttribs
)
166 bool bMSO2007Doc
= getFilter().isMSO2007Document();
167 if( isRootElement() ) switch( nElement
)
169 case C_TOKEN( applyToEnd
):
170 mrModel
.mbApplyToEnd
= rAttribs
.getBool( XML_val
, !bMSO2007Doc
);
172 case C_TOKEN( applyToFront
):
173 mrModel
.mbApplyToFront
= rAttribs
.getBool( XML_val
, !bMSO2007Doc
);
175 case C_TOKEN( applyToSides
):
176 mrModel
.mbApplyToSides
= rAttribs
.getBool( XML_val
, !bMSO2007Doc
);
178 case C_TOKEN( pictureFormat
):
179 mrModel
.mnPictureFormat
= rAttribs
.getToken( XML_val
, XML_stretch
);
181 case C_TOKEN( pictureStackUnit
):
182 mrModel
.mfStackUnit
= rAttribs
.getDouble( XML_val
, 1.0 );
188 ErrorBarContext::ErrorBarContext( ContextHandler2Helper
& rParent
, ErrorBarModel
& rModel
) :
189 ContextBase
< ErrorBarModel
>( rParent
, rModel
)
193 ErrorBarContext::~ErrorBarContext()
197 ContextHandlerRef
ErrorBarContext::onCreateContext( sal_Int32 nElement
, const AttributeList
& rAttribs
)
199 bool bMSO2007Doc
= getFilter().isMSO2007Document();
200 if( isRootElement() ) switch( nElement
)
202 case C_TOKEN( errBarType
):
203 mrModel
.mnTypeId
= rAttribs
.getToken( XML_val
, XML_both
);
205 case C_TOKEN( errDir
):
206 mrModel
.mnDirection
= rAttribs
.getToken( XML_val
, XML_TOKEN_INVALID
);
208 case C_TOKEN( errValType
):
209 mrModel
.mnValueType
= rAttribs
.getToken( XML_val
, XML_fixedVal
);
211 case C_TOKEN( minus
):
212 return new DataSourceContext( *this, mrModel
.maSources
.create( ErrorBarModel::MINUS
) );
213 case C_TOKEN( noEndCap
):
214 mrModel
.mbNoEndCap
= rAttribs
.getBool( XML_val
, !bMSO2007Doc
);
216 case C_TOKEN( plus
):
217 return new DataSourceContext( *this, mrModel
.maSources
.create( ErrorBarModel::PLUS
) );
218 case C_TOKEN( spPr
):
219 return new ShapePropertiesContext( *this, mrModel
.mxShapeProp
.create() );
221 mrModel
.mfValue
= rAttribs
.getDouble( XML_val
, 0.0 );
227 TrendlineLabelContext::TrendlineLabelContext( ContextHandler2Helper
& rParent
, TrendlineLabelModel
& rModel
) :
228 ContextBase
< TrendlineLabelModel
>( rParent
, rModel
)
232 TrendlineLabelContext::~TrendlineLabelContext()
236 ContextHandlerRef
TrendlineLabelContext::onCreateContext( sal_Int32 nElement
, const AttributeList
& rAttribs
)
238 if( isRootElement() ) switch( nElement
)
240 case C_TOKEN( layout
):
241 return new LayoutContext( *this, mrModel
.mxLayout
.create() );
242 case C_TOKEN( numFmt
):
243 mrModel
.maNumberFormat
.setAttributes( rAttribs
);
245 case C_TOKEN( spPr
):
246 return new ShapePropertiesContext( *this, mrModel
.mxShapeProp
.create() );
248 return new TextContext( *this, mrModel
.mxText
.create() );
249 case C_TOKEN( txPr
):
250 return new TextBodyContext( *this, mrModel
.mxTextProp
.create() );
255 TrendlineContext::TrendlineContext( ContextHandler2Helper
& rParent
, TrendlineModel
& rModel
) :
256 ContextBase
< TrendlineModel
>( rParent
, rModel
)
260 TrendlineContext::~TrendlineContext()
264 ContextHandlerRef
TrendlineContext::onCreateContext( sal_Int32 nElement
, const AttributeList
& rAttribs
)
266 bool bMSO2007Doc
= getFilter().isMSO2007Document();
267 if( isRootElement() ) switch( nElement
)
269 case C_TOKEN( backward
):
270 mrModel
.mfBackward
= rAttribs
.getDouble( XML_val
, 0.0 );
272 case C_TOKEN( dispEq
):
273 mrModel
.mbDispEquation
= rAttribs
.getBool( XML_val
, !bMSO2007Doc
);
275 case C_TOKEN( dispRSqr
):
276 mrModel
.mbDispRSquared
= rAttribs
.getBool( XML_val
, !bMSO2007Doc
);
278 case C_TOKEN( forward
):
279 mrModel
.mfForward
= rAttribs
.getDouble( XML_val
, 0.0 );
281 case C_TOKEN( intercept
):
282 mrModel
.mfIntercept
= rAttribs
.getDouble( XML_val
, 0.0 );
284 case C_TOKEN( name
):
285 return this; // collect name in onCharacters()
286 case C_TOKEN( order
):
287 mrModel
.mnOrder
= rAttribs
.getInteger( XML_val
, 2 );
289 case C_TOKEN( period
):
290 mrModel
.mnPeriod
= rAttribs
.getInteger( XML_val
, 2 );
292 case C_TOKEN( spPr
):
293 return new ShapePropertiesContext( *this, mrModel
.mxShapeProp
.create() );
294 case C_TOKEN( trendlineLbl
):
295 return new TrendlineLabelContext( *this, mrModel
.mxLabel
.create() );
296 case C_TOKEN( trendlineType
):
297 mrModel
.mnTypeId
= rAttribs
.getToken( XML_val
, XML_linear
);
303 void TrendlineContext::onCharacters( const OUString
& rChars
)
305 if( isCurrentElement( C_TOKEN( name
) ) )
306 mrModel
.maName
= rChars
;
309 DataPointContext::DataPointContext( ContextHandler2Helper
& rParent
, DataPointModel
& rModel
) :
310 ContextBase
< DataPointModel
>( rParent
, rModel
)
314 DataPointContext::~DataPointContext()
318 ContextHandlerRef
DataPointContext::onCreateContext( sal_Int32 nElement
, const AttributeList
& rAttribs
)
320 bool bMSO2007Doc
= getFilter().isMSO2007Document();
321 switch( getCurrentElement() )
326 case C_TOKEN( bubble3D
):
327 mrModel
.mobBubble3d
= rAttribs
.getBool( XML_val
);
329 case C_TOKEN( explosion
):
330 // if the 'val' attribute is missing, series explosion remains unchanged
331 mrModel
.monExplosion
= rAttribs
.getInteger( XML_val
);
334 mrModel
.mnIndex
= rAttribs
.getInteger( XML_val
, -1 );
336 case C_TOKEN( invertIfNegative
):
337 mrModel
.mbInvertNeg
= rAttribs
.getBool( XML_val
, !bMSO2007Doc
);
339 case C_TOKEN( marker
):
341 case C_TOKEN( pictureOptions
):
342 return new PictureOptionsContext( *this, mrModel
.mxPicOptions
.create(bMSO2007Doc
) );
343 case C_TOKEN( spPr
):
344 return new ShapePropertiesContext( *this, mrModel
.mxShapeProp
.create() );
348 case C_TOKEN( marker
):
351 case C_TOKEN( size
):
352 mrModel
.monMarkerSize
= rAttribs
.getInteger( XML_val
, 5 );
354 case C_TOKEN( spPr
):
355 return new ShapePropertiesContext( *this, mrModel
.mxMarkerProp
.create() );
356 case C_TOKEN( symbol
):
357 mrModel
.monMarkerSymbol
= rAttribs
.getToken( XML_val
, XML_none
);
365 SeriesContextBase::SeriesContextBase( ContextHandler2Helper
& rParent
, SeriesModel
& rModel
) :
366 ContextBase
< SeriesModel
>( rParent
, rModel
)
370 SeriesContextBase::~SeriesContextBase()
374 ContextHandlerRef
SeriesContextBase::onCreateContext( sal_Int32 nElement
, const AttributeList
& rAttribs
)
376 switch( getCurrentElement() )
382 mrModel
.mnIndex
= rAttribs
.getInteger( XML_val
, -1 );
384 case C_TOKEN( order
):
385 mrModel
.mnOrder
= rAttribs
.getInteger( XML_val
, -1 );
387 case C_TOKEN( spPr
):
388 return new ShapePropertiesContext( *this, mrModel
.mxShapeProp
.create() );
390 return new TextContext( *this, mrModel
.mxText
.create() );
394 case C_TOKEN( marker
):
397 case C_TOKEN( size
):
398 mrModel
.mnMarkerSize
= rAttribs
.getInteger( XML_val
, 5 );
400 case C_TOKEN( spPr
):
401 return new ShapePropertiesContext( *this, mrModel
.mxMarkerProp
.create() );
402 case C_TOKEN( symbol
):
403 mrModel
.mnMarkerSymbol
= rAttribs
.getToken( XML_val
, XML_none
);
411 AreaSeriesContext::AreaSeriesContext( ContextHandler2Helper
& rParent
, SeriesModel
& rModel
) :
412 SeriesContextBase( rParent
, rModel
)
416 AreaSeriesContext::~AreaSeriesContext()
420 ContextHandlerRef
AreaSeriesContext::onCreateContext( sal_Int32 nElement
, const AttributeList
& rAttribs
)
422 bool bMSO2007Doc
= getFilter().isMSO2007Document();
423 switch( getCurrentElement() )
429 return new DataSourceContext( *this, mrModel
.maSources
.create( SeriesModel::CATEGORIES
) );
430 case C_TOKEN( errBars
):
431 return new ErrorBarContext( *this, mrModel
.maErrorBars
.create(bMSO2007Doc
) );
432 case C_TOKEN( dLbls
):
433 return new DataLabelsContext( *this, mrModel
.mxLabels
.create(bMSO2007Doc
) );
435 return new DataPointContext( *this, mrModel
.maPoints
.create(bMSO2007Doc
) );
436 case C_TOKEN( trendline
):
437 return new TrendlineContext( *this, mrModel
.maTrendlines
.create(bMSO2007Doc
) );
439 return new DataSourceContext( *this, mrModel
.maSources
.create( SeriesModel::VALUES
) );
443 return SeriesContextBase::onCreateContext( nElement
, rAttribs
);
446 BarSeriesContext::BarSeriesContext( ContextHandler2Helper
& rParent
, SeriesModel
& rModel
) :
447 SeriesContextBase( rParent
, rModel
)
451 BarSeriesContext::~BarSeriesContext()
455 ContextHandlerRef
BarSeriesContext::onCreateContext( sal_Int32 nElement
, const AttributeList
& rAttribs
)
457 bool bMSO2007Doc
= getFilter().isMSO2007Document();
458 switch( getCurrentElement() )
464 return new DataSourceContext( *this, mrModel
.maSources
.create( SeriesModel::CATEGORIES
) );
465 case C_TOKEN( dLbls
):
466 return new DataLabelsContext( *this, mrModel
.mxLabels
.create(bMSO2007Doc
) );
468 return new DataPointContext( *this, mrModel
.maPoints
.create(bMSO2007Doc
) );
469 case C_TOKEN( errBars
):
470 return new ErrorBarContext( *this, mrModel
.maErrorBars
.create(bMSO2007Doc
) );
471 case C_TOKEN( invertIfNegative
):
472 mrModel
.mbInvertNeg
= rAttribs
.getBool( XML_val
, !bMSO2007Doc
);
474 case C_TOKEN( pictureOptions
):
475 return new PictureOptionsContext( *this, mrModel
.mxPicOptions
.create(bMSO2007Doc
) );
476 case C_TOKEN( shape
):
477 mrModel
.monShape
= rAttribs
.getToken(XML_val
);
479 case C_TOKEN( trendline
):
480 return new TrendlineContext( *this, mrModel
.maTrendlines
.create(bMSO2007Doc
) );
482 return new DataSourceContext( *this, mrModel
.maSources
.create( SeriesModel::VALUES
) );
486 return SeriesContextBase::onCreateContext( nElement
, rAttribs
);
489 BubbleSeriesContext::BubbleSeriesContext( ContextHandler2Helper
& rParent
, SeriesModel
& rModel
) :
490 SeriesContextBase( rParent
, rModel
)
494 BubbleSeriesContext::~BubbleSeriesContext()
498 ContextHandlerRef
BubbleSeriesContext::onCreateContext( sal_Int32 nElement
, const AttributeList
& rAttribs
)
500 bool bMSO2007Doc
= getFilter().isMSO2007Document();
501 switch( getCurrentElement() )
506 case C_TOKEN( bubble3D
):
507 mrModel
.mbBubble3d
= rAttribs
.getBool( XML_val
, !bMSO2007Doc
);
509 case C_TOKEN( bubbleSize
):
510 return new DataSourceContext( *this, mrModel
.maSources
.create( SeriesModel::POINTS
) );
511 case C_TOKEN( dLbls
):
512 return new DataLabelsContext( *this, mrModel
.mxLabels
.create(bMSO2007Doc
) );
514 return new DataPointContext( *this, mrModel
.maPoints
.create(bMSO2007Doc
) );
515 case C_TOKEN( errBars
):
516 return new ErrorBarContext( *this, mrModel
.maErrorBars
.create(bMSO2007Doc
) );
517 case C_TOKEN( invertIfNegative
):
518 mrModel
.mbInvertNeg
= rAttribs
.getBool( XML_val
, !bMSO2007Doc
);
520 case C_TOKEN( trendline
):
521 return new TrendlineContext( *this, mrModel
.maTrendlines
.create(bMSO2007Doc
) );
522 case C_TOKEN( xVal
):
523 return new DataSourceContext( *this, mrModel
.maSources
.create( SeriesModel::CATEGORIES
) );
524 case C_TOKEN( yVal
):
525 return new DataSourceContext( *this, mrModel
.maSources
.create( SeriesModel::VALUES
) );
529 return SeriesContextBase::onCreateContext( nElement
, rAttribs
);
532 LineSeriesContext::LineSeriesContext( ContextHandler2Helper
& rParent
, SeriesModel
& rModel
) :
533 SeriesContextBase( rParent
, rModel
)
537 LineSeriesContext::~LineSeriesContext()
541 ContextHandlerRef
LineSeriesContext::onCreateContext( sal_Int32 nElement
, const AttributeList
& rAttribs
)
543 bool bMSO2007Doc
= getFilter().isMSO2007Document();
544 switch( getCurrentElement() )
550 return new DataSourceContext( *this, mrModel
.maSources
.create( SeriesModel::CATEGORIES
) );
551 case C_TOKEN( dLbls
):
552 return new DataLabelsContext( *this, mrModel
.mxLabels
.create(bMSO2007Doc
) );
554 return new DataPointContext( *this, mrModel
.maPoints
.create(bMSO2007Doc
) );
555 case C_TOKEN( errBars
):
556 return new ErrorBarContext( *this, mrModel
.maErrorBars
.create(bMSO2007Doc
) );
557 case C_TOKEN( marker
):
559 case C_TOKEN( smooth
):
560 mrModel
.mbSmooth
= rAttribs
.getBool( XML_val
, !bMSO2007Doc
);
562 case C_TOKEN( trendline
):
563 return new TrendlineContext( *this, mrModel
.maTrendlines
.create(bMSO2007Doc
) );
565 return new DataSourceContext( *this, mrModel
.maSources
.create( SeriesModel::VALUES
) );
569 return SeriesContextBase::onCreateContext( nElement
, rAttribs
);
572 PieSeriesContext::PieSeriesContext( ContextHandler2Helper
& rParent
, SeriesModel
& rModel
) :
573 SeriesContextBase( rParent
, rModel
)
577 PieSeriesContext::~PieSeriesContext()
581 ContextHandlerRef
PieSeriesContext::onCreateContext( sal_Int32 nElement
, const AttributeList
& rAttribs
)
583 bool bMSO2007Doc
= getFilter().isMSO2007Document();
584 switch( getCurrentElement() )
590 return new DataSourceContext( *this, mrModel
.maSources
.create( SeriesModel::CATEGORIES
) );
591 case C_TOKEN( dLbls
):
592 return new DataLabelsContext( *this, mrModel
.mxLabels
.create(bMSO2007Doc
) );
594 return new DataPointContext( *this, mrModel
.maPoints
.create(bMSO2007Doc
) );
595 case C_TOKEN( explosion
):
596 mrModel
.mnExplosion
= rAttribs
.getInteger( XML_val
, 0 );
599 return new DataSourceContext( *this, mrModel
.maSources
.create( SeriesModel::VALUES
) );
603 return SeriesContextBase::onCreateContext( nElement
, rAttribs
);
606 RadarSeriesContext::RadarSeriesContext( ContextHandler2Helper
& rParent
, SeriesModel
& rModel
) :
607 SeriesContextBase( rParent
, rModel
)
611 RadarSeriesContext::~RadarSeriesContext()
615 ContextHandlerRef
RadarSeriesContext::onCreateContext( sal_Int32 nElement
, const AttributeList
& rAttribs
)
617 bool bMSO2007Doc
= getFilter().isMSO2007Document();
618 switch( getCurrentElement() )
624 return new DataSourceContext( *this, mrModel
.maSources
.create( SeriesModel::CATEGORIES
) );
625 case C_TOKEN( dLbls
):
626 return new DataLabelsContext( *this, mrModel
.mxLabels
.create(bMSO2007Doc
) );
628 return new DataPointContext( *this, mrModel
.maPoints
.create(bMSO2007Doc
) );
629 case C_TOKEN( marker
):
631 case C_TOKEN( smooth
):
632 mrModel
.mbSmooth
= rAttribs
.getBool( XML_val
, bMSO2007Doc
);
635 return new DataSourceContext( *this, mrModel
.maSources
.create( SeriesModel::VALUES
) );
639 return SeriesContextBase::onCreateContext( nElement
, rAttribs
);
642 ScatterSeriesContext::ScatterSeriesContext( ContextHandler2Helper
& rParent
, SeriesModel
& rModel
) :
643 SeriesContextBase( rParent
, rModel
)
647 ScatterSeriesContext::~ScatterSeriesContext()
651 ContextHandlerRef
ScatterSeriesContext::onCreateContext( sal_Int32 nElement
, const AttributeList
& rAttribs
)
653 bool bMSO2007Doc
= getFilter().isMSO2007Document();
654 switch( getCurrentElement() )
659 case C_TOKEN( dLbls
):
660 return new DataLabelsContext( *this, mrModel
.mxLabels
.create(bMSO2007Doc
) );
662 return new DataPointContext( *this, mrModel
.maPoints
.create(bMSO2007Doc
) );
663 case C_TOKEN( errBars
):
664 return new ErrorBarContext( *this, mrModel
.maErrorBars
.create(bMSO2007Doc
) );
665 case C_TOKEN( marker
):
667 case C_TOKEN( smooth
):
668 mrModel
.mbSmooth
= rAttribs
.getBool( XML_val
, !bMSO2007Doc
);
670 case C_TOKEN( trendline
):
671 return new TrendlineContext( *this, mrModel
.maTrendlines
.create(bMSO2007Doc
) );
672 case C_TOKEN( xVal
):
673 return new DataSourceContext( *this, mrModel
.maSources
.create( SeriesModel::CATEGORIES
) );
674 case C_TOKEN( yVal
):
675 return new DataSourceContext( *this, mrModel
.maSources
.create( SeriesModel::VALUES
) );
679 return SeriesContextBase::onCreateContext( nElement
, rAttribs
);
682 SurfaceSeriesContext::SurfaceSeriesContext( ContextHandler2Helper
& rParent
, SeriesModel
& rModel
) :
683 SeriesContextBase( rParent
, rModel
)
687 SurfaceSeriesContext::~SurfaceSeriesContext()
691 ContextHandlerRef
SurfaceSeriesContext::onCreateContext( sal_Int32 nElement
, const AttributeList
& rAttribs
)
693 switch( getCurrentElement() )
699 return new DataSourceContext( *this, mrModel
.maSources
.create( SeriesModel::CATEGORIES
) );
701 return new DataSourceContext( *this, mrModel
.maSources
.create( SeriesModel::VALUES
) );
705 return SeriesContextBase::onCreateContext( nElement
, rAttribs
);
709 } // namespace drawingml
712 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */