LibreOffice Module oox (master) 1
seriescontext.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
21
29#include <oox/token/namespaces.hxx>
30#include <oox/token/tokens.hxx>
31
32namespace oox::drawingml::chart {
33
34using ::oox::core::ContextHandler2;
35using ::oox::core::ContextHandler2Helper;
37
38namespace {
39
40ContextHandlerRef lclDataLabelSharedCreateContext( ContextHandler2& rContext,
41 sal_Int32 nElement, const AttributeList& rAttribs, DataLabelModelBase& orModel, bool bMSO2007 )
42{
43 if( rContext.isRootElement() ) switch( nElement )
44 {
45 case C_TOKEN( delete ):
46 orModel.mbDeleted = rAttribs.getBool( XML_val, !bMSO2007 );
47 return nullptr;
48 case C_TOKEN( dLblPos ):
49 orModel.monLabelPos = rAttribs.getToken( XML_val, XML_TOKEN_INVALID );
50 return nullptr;
51 case C_TOKEN( numFmt ):
52 orModel.maNumberFormat.setAttributes( rAttribs );
53 return nullptr;
54 case C_TOKEN( showBubbleSize ):
55 orModel.mobShowBubbleSize = rAttribs.getBool( XML_val );
56 return nullptr;
57 case C_TOKEN( showCatName ):
58 orModel.mobShowCatName = rAttribs.getBool( XML_val );
59 return nullptr;
60 case C_TOKEN( showLegendKey ):
61 orModel.mobShowLegendKey = rAttribs.getBool( XML_val );
62 return nullptr;
63 case C_TOKEN( showPercent ):
64 orModel.mobShowPercent = rAttribs.getBool( XML_val );
65 return nullptr;
66 case C_TOKEN( showSerName ):
67 orModel.mobShowSerName = rAttribs.getBool( XML_val );
68 return nullptr;
69 case C_TOKEN( showVal ):
70 orModel.mobShowVal = rAttribs.getBool( XML_val );
71 return nullptr;
72 case C_TOKEN( separator ):
73 // collect separator text in onCharacters()
74 return &rContext;
75 case C_TOKEN( spPr ):
76 return new ShapePropertiesContext( rContext, orModel.mxShapeProp.create() );
77 case C_TOKEN( txPr ):
78 return new TextBodyContext( rContext, orModel.mxTextProp.create() );
79 }
80 return nullptr;
81}
82
83void lclDataLabelSharedCharacters( ContextHandler2 const & rContext, const OUString& rChars, DataLabelModelBase& orModel )
84{
85 if( rContext.isCurrentElement( C_TOKEN( separator ) ) )
86 orModel.moaSeparator = rChars;
87}
88
89} // namespace
90
91DataLabelContext::DataLabelContext( ContextHandler2Helper& rParent, DataLabelModel& rModel ) :
92 ContextBase< DataLabelModel >( rParent, rModel )
93{
94 mrModel.mbDeleted = false;
95}
96
98{
99}
100
102{
103 if( isRootElement() )
104 {
105 switch( nElement )
106 {
107 case C_TOKEN( idx ):
108 mrModel.mnIndex = rAttribs.getInteger( XML_val, -1 );
109 return nullptr;
110 case C_TOKEN( layout ):
111 return new LayoutContext( *this, mrModel.mxLayout.create() );
112 case C_TOKEN( tx ):
113 return new TextContext( *this, mrModel.mxText.create() );
114 case C_TOKEN( extLst ):
115 return this;
116 }
117 }
118 else
119 {
120 switch( getCurrentElement() )
121 {
122 case C_TOKEN( extLst ):
123 if ( nElement == C_TOKEN( ext ) )
124 return this;
125 break;
126 case C_TOKEN( ext ):
127 if ( nElement == C15_TOKEN( showDataLabelsRange ) )
128 {
129 mrModel.mobShowDataLabelsRange = rAttribs.getBool( XML_val );
130 return nullptr;
131 }
132 break;
133 }
134 }
135 bool bMSO2007 = getFilter().isMSO2007Document();
136 return lclDataLabelSharedCreateContext( *this, nElement, rAttribs, mrModel, bMSO2007 );
137}
138
139void DataLabelContext::onCharacters( const OUString& rChars )
140{
141 lclDataLabelSharedCharacters( *this, rChars, mrModel );
142}
143
144DataLabelsContext::DataLabelsContext( ContextHandler2Helper& rParent, DataLabelsModel& rModel ) :
145 ContextBase< DataLabelsModel >( rParent, rModel )
146{
147 mrModel.mbDeleted = false;
148}
149
151{
152}
153
155{
156 bool bMSO2007Doc = getFilter().isMSO2007Document();
157 if( isRootElement() ) switch( nElement )
158 {
159 case C_TOKEN( dLbl ):
160 return new DataLabelContext( *this, mrModel.maPointLabels.create(mrModel, bMSO2007Doc) );
161 case C_TOKEN( leaderLines ):
162 return new ShapePrWrapperContext( *this, mrModel.mxLeaderLines.create() );
163 case C_TOKEN( showLeaderLines ):
164 case C15_TOKEN( showLeaderLines ):
165 mrModel.mbShowLeaderLines = rAttribs.getBool( XML_val, true );
166 return nullptr;
167 case C_TOKEN( extLst ):
168 case C_TOKEN( ext ):
169 return new DataLabelsContext( *this, mrModel );
170 }
171 return lclDataLabelSharedCreateContext( *this, nElement, rAttribs, mrModel, bMSO2007Doc );
172}
173
174void DataLabelsContext::onCharacters( const OUString& rChars )
175{
176 lclDataLabelSharedCharacters( *this, rChars, mrModel );
177}
178
179PictureOptionsContext::PictureOptionsContext( ContextHandler2Helper& rParent, PictureOptionsModel& rModel ) :
180 ContextBase< PictureOptionsModel >( rParent, rModel )
181{
182}
183
185{
186}
187
189{
190 bool bMSO2007Doc = getFilter().isMSO2007Document();
191 if( isRootElement() ) switch( nElement )
192 {
193 case C_TOKEN( applyToEnd ):
194 mrModel.mbApplyToEnd = rAttribs.getBool( XML_val, !bMSO2007Doc );
195 return nullptr;
196 case C_TOKEN( applyToFront ):
197 mrModel.mbApplyToFront = rAttribs.getBool( XML_val, !bMSO2007Doc );
198 return nullptr;
199 case C_TOKEN( applyToSides ):
200 mrModel.mbApplyToSides = rAttribs.getBool( XML_val, !bMSO2007Doc );
201 return nullptr;
202 case C_TOKEN( pictureFormat ):
203 mrModel.mnPictureFormat = rAttribs.getToken( XML_val, XML_stretch );
204 return nullptr;
205 case C_TOKEN( pictureStackUnit ):
206 mrModel.mfStackUnit = rAttribs.getDouble( XML_val, 1.0 );
207 return nullptr;
208 }
209 return nullptr;
210}
211
212ErrorBarContext::ErrorBarContext( ContextHandler2Helper& rParent, ErrorBarModel& rModel ) :
213 ContextBase< ErrorBarModel >( rParent, rModel )
214{
215}
216
218{
219}
220
222{
223 bool bMSO2007Doc = getFilter().isMSO2007Document();
224 if( isRootElement() ) switch( nElement )
225 {
226 case C_TOKEN( errBarType ):
227 mrModel.mnTypeId = rAttribs.getToken( XML_val, XML_both );
228 return nullptr;
229 case C_TOKEN( errDir ):
230 mrModel.mnDirection = rAttribs.getToken( XML_val, XML_TOKEN_INVALID );
231 return nullptr;
232 case C_TOKEN( errValType ):
233 mrModel.mnValueType = rAttribs.getToken( XML_val, XML_fixedVal );
234 return nullptr;
235 case C_TOKEN( minus ):
237 case C_TOKEN( noEndCap ):
238 mrModel.mbNoEndCap = rAttribs.getBool( XML_val, !bMSO2007Doc );
239 return nullptr;
240 case C_TOKEN( plus ):
242 case C_TOKEN( spPr ):
243 return new ShapePropertiesContext( *this, mrModel.mxShapeProp.create() );
244 case C_TOKEN( val ):
245 mrModel.mfValue = rAttribs.getDouble( XML_val, 0.0 );
246 return nullptr;
247 }
248 return nullptr;
249}
250
251TrendlineLabelContext::TrendlineLabelContext( ContextHandler2Helper& rParent, TrendlineLabelModel& rModel ) :
252 ContextBase< TrendlineLabelModel >( rParent, rModel )
253{
254}
255
257{
258}
259
261{
262 if( isRootElement() ) switch( nElement )
263 {
264 case C_TOKEN( layout ):
265 return new LayoutContext( *this, mrModel.mxLayout.create() );
266 case C_TOKEN( numFmt ):
268 return nullptr;
269 case C_TOKEN( spPr ):
270 return new ShapePropertiesContext( *this, mrModel.mxShapeProp.create() );
271 case C_TOKEN( tx ):
272 return new TextContext( *this, mrModel.mxText.create() );
273 case C_TOKEN( txPr ):
274 return new TextBodyContext( *this, mrModel.mxTextProp.create() );
275 }
276 return nullptr;
277}
278
279TrendlineContext::TrendlineContext( ContextHandler2Helper& rParent, TrendlineModel& rModel ) :
280 ContextBase< TrendlineModel >( rParent, rModel )
281{
282}
283
285{
286}
287
289{
290 bool bMSO2007Doc = getFilter().isMSO2007Document();
291 if( isRootElement() ) switch( nElement )
292 {
293 case C_TOKEN( backward ):
294 mrModel.mfBackward = rAttribs.getDouble( XML_val, 0.0 );
295 return nullptr;
296 case C_TOKEN( dispEq ):
297 mrModel.mbDispEquation = rAttribs.getBool( XML_val, !bMSO2007Doc );
298 return nullptr;
299 case C_TOKEN( dispRSqr ):
300 mrModel.mbDispRSquared = rAttribs.getBool( XML_val, !bMSO2007Doc );
301 return nullptr;
302 case C_TOKEN( forward ):
303 mrModel.mfForward = rAttribs.getDouble( XML_val, 0.0 );
304 return nullptr;
305 case C_TOKEN( intercept ):
306 mrModel.mfIntercept = rAttribs.getDouble( XML_val, 0.0 );
307 return nullptr;
308 case C_TOKEN( name ):
309 return this; // collect name in onCharacters()
310 case C_TOKEN( order ):
311 mrModel.mnOrder = rAttribs.getInteger( XML_val, 2 );
312 return nullptr;
313 case C_TOKEN( period ):
314 mrModel.mnPeriod = rAttribs.getInteger( XML_val, 2 );
315 return nullptr;
316 case C_TOKEN( spPr ):
317 return new ShapePropertiesContext( *this, mrModel.mxShapeProp.create() );
318 case C_TOKEN( trendlineLbl ):
319 return new TrendlineLabelContext( *this, mrModel.mxLabel.create() );
320 case C_TOKEN( trendlineType ):
321 mrModel.mnTypeId = rAttribs.getToken( XML_val, XML_linear );
322 return nullptr;
323 }
324 return nullptr;
325}
326
327void TrendlineContext::onCharacters( const OUString& rChars )
328{
329 if( isCurrentElement( C_TOKEN( name ) ) )
330 mrModel.maName = rChars;
331}
332
333DataPointContext::DataPointContext( ContextHandler2Helper& rParent, DataPointModel& rModel ) :
334 ContextBase< DataPointModel >( rParent, rModel )
335{
336}
337
339{
340}
341
343{
344 bool bMSO2007Doc = getFilter().isMSO2007Document();
345 switch( getCurrentElement() )
346 {
347 case C_TOKEN( dPt ):
348 switch( nElement )
349 {
350 case C_TOKEN( bubble3D ):
351 mrModel.mobBubble3d = rAttribs.getBool( XML_val );
352 return nullptr;
353 case C_TOKEN( explosion ):
354 // if the 'val' attribute is missing, series explosion remains unchanged
355 mrModel.monExplosion = rAttribs.getInteger( XML_val );
356 return nullptr;
357 case C_TOKEN( idx ):
358 mrModel.mnIndex = rAttribs.getInteger( XML_val, -1 );
359 return nullptr;
360 case C_TOKEN( invertIfNegative ):
361 mrModel.mbInvertNeg = rAttribs.getBool( XML_val, !bMSO2007Doc );
362 return nullptr;
363 case C_TOKEN( marker ):
364 return this;
365 case C_TOKEN( pictureOptions ):
366 return new PictureOptionsContext( *this, mrModel.mxPicOptions.create(bMSO2007Doc) );
367 case C_TOKEN( spPr ):
368 return new ShapePropertiesContext( *this, mrModel.mxShapeProp.create() );
369 }
370 break;
371
372 case C_TOKEN( marker ):
373 switch( nElement )
374 {
375 case C_TOKEN( size ):
376 mrModel.monMarkerSize = rAttribs.getInteger( XML_val, 5 );
377 return nullptr;
378 case C_TOKEN( spPr ):
379 return new ShapePropertiesContext( *this, mrModel.mxMarkerProp.create() );
380 case C_TOKEN( symbol ):
381 mrModel.monMarkerSymbol = rAttribs.getToken( XML_val, XML_none );
382 return nullptr;
383 }
384 break;
385 }
386 return nullptr;
387}
388
389SeriesContextBase::SeriesContextBase( ContextHandler2Helper& rParent, SeriesModel& rModel ) :
390 ContextBase< SeriesModel >( rParent, rModel )
391{
392}
393
395{
396}
397
399{
400 switch( getCurrentElement() )
401 {
402 case C_TOKEN( ser ):
403 switch( nElement )
404 {
405 case C_TOKEN( idx ):
406 mrModel.mnIndex = rAttribs.getInteger( XML_val, -1 );
407 return nullptr;
408 case C_TOKEN( order ):
409 mrModel.mnOrder = rAttribs.getInteger( XML_val, -1 );
410 return nullptr;
411 case C_TOKEN( spPr ):
412 return new ShapePropertiesContext( *this, mrModel.mxShapeProp.create() );
413 case C_TOKEN( tx ):
414 return new TextContext( *this, mrModel.mxText.create() );
415 case C_TOKEN( extLst ):
416 return this;
417 }
418 break;
419
420 case C_TOKEN( marker ):
421 switch( nElement )
422 {
423 case C_TOKEN( size ):
424 mrModel.mnMarkerSize = rAttribs.getInteger( XML_val, 5 );
425 return nullptr;
426 case C_TOKEN( spPr ):
427 return new ShapePropertiesContext( *this, mrModel.mxMarkerProp.create() );
428 case C_TOKEN( symbol ):
429 mrModel.mnMarkerSymbol = rAttribs.getToken( XML_val, XML_none );
430 return nullptr;
431 }
432 break;
433
434 case C_TOKEN( extLst ):
435 switch( nElement )
436 {
437 case C_TOKEN( ext ):
439 break;
440
442 if (mrModel.mxLabels.is())
443 mrModel.mxLabels->mpLabelsSource = &rLabelsSource;
444 return new DataSourceContext( *this, rLabelsSource );
445 }
446 }
447 return nullptr;
448}
449
450AreaSeriesContext::AreaSeriesContext( ContextHandler2Helper& rParent, SeriesModel& rModel ) :
451 SeriesContextBase( rParent, rModel )
452{
453}
454
456{
457}
458
460{
461 bool bMSO2007Doc = getFilter().isMSO2007Document();
462 switch( getCurrentElement() )
463 {
464 case C_TOKEN( ser ):
465 switch( nElement )
466 {
467 case C_TOKEN( cat ):
469 case C_TOKEN( errBars ):
470 return new ErrorBarContext( *this, mrModel.maErrorBars.create(bMSO2007Doc) );
471 case C_TOKEN( dLbls ):
472 return new DataLabelsContext( *this, mrModel.mxLabels.create(bMSO2007Doc) );
473 case C_TOKEN( dPt ):
474 return new DataPointContext( *this, mrModel.maPoints.create(bMSO2007Doc) );
475 case C_TOKEN( trendline ):
476 return new TrendlineContext( *this, mrModel.maTrendlines.create(bMSO2007Doc) );
477 case C_TOKEN( val ):
479 }
480 break;
481 }
482 return SeriesContextBase::onCreateContext( nElement, rAttribs );
483}
484
485BarSeriesContext::BarSeriesContext( ContextHandler2Helper& rParent, SeriesModel& rModel ) :
486 SeriesContextBase( rParent, rModel )
487{
488}
489
491{
492}
493
495{
496 bool bMSO2007Doc = getFilter().isMSO2007Document();
497 switch( getCurrentElement() )
498 {
499 case C_TOKEN( ser ):
500 switch( nElement )
501 {
502 case C_TOKEN( cat ):
504 case C_TOKEN( dLbls ):
505 return new DataLabelsContext( *this, mrModel.mxLabels.create(bMSO2007Doc) );
506 case C_TOKEN( dPt ):
507 return new DataPointContext( *this, mrModel.maPoints.create(bMSO2007Doc) );
508 case C_TOKEN( errBars ):
509 return new ErrorBarContext( *this, mrModel.maErrorBars.create(bMSO2007Doc) );
510 case C_TOKEN( invertIfNegative ):
511 mrModel.mbInvertNeg = rAttribs.getBool( XML_val, !bMSO2007Doc );
512 return nullptr;
513 case C_TOKEN( pictureOptions ):
514 return new PictureOptionsContext( *this, mrModel.mxPicOptions.create(bMSO2007Doc) );
515 case C_TOKEN( shape ):
516 mrModel.monShape = rAttribs.getToken(XML_val);
517 return nullptr;
518 case C_TOKEN( trendline ):
519 return new TrendlineContext( *this, mrModel.maTrendlines.create(bMSO2007Doc) );
520 case C_TOKEN( val ):
522 }
523 break;
524 }
525 return SeriesContextBase::onCreateContext( nElement, rAttribs );
526}
527
528BubbleSeriesContext::BubbleSeriesContext( ContextHandler2Helper& rParent, SeriesModel& rModel ) :
529 SeriesContextBase( rParent, rModel )
530{
531}
532
534{
535}
536
538{
539 bool bMSO2007Doc = getFilter().isMSO2007Document();
540 switch( getCurrentElement() )
541 {
542 case C_TOKEN( ser ):
543 switch( nElement )
544 {
545 case C_TOKEN( bubble3D ):
546 mrModel.mbBubble3d = rAttribs.getBool( XML_val, !bMSO2007Doc );
547 return nullptr;
548 case C_TOKEN( bubbleSize ):
550 case C_TOKEN( dLbls ):
551 return new DataLabelsContext( *this, mrModel.mxLabels.create(bMSO2007Doc) );
552 case C_TOKEN( dPt ):
553 return new DataPointContext( *this, mrModel.maPoints.create(bMSO2007Doc) );
554 case C_TOKEN( errBars ):
555 return new ErrorBarContext( *this, mrModel.maErrorBars.create(bMSO2007Doc) );
556 case C_TOKEN( invertIfNegative ):
557 mrModel.mbInvertNeg = rAttribs.getBool( XML_val, !bMSO2007Doc );
558 return nullptr;
559 case C_TOKEN( trendline ):
560 return new TrendlineContext( *this, mrModel.maTrendlines.create(bMSO2007Doc) );
561 case C_TOKEN( xVal ):
563 case C_TOKEN( yVal ):
565 }
566 break;
567 }
568 return SeriesContextBase::onCreateContext( nElement, rAttribs );
569}
570
571LineSeriesContext::LineSeriesContext( ContextHandler2Helper& rParent, SeriesModel& rModel ) :
572 SeriesContextBase( rParent, rModel )
573{
574}
575
577{
578}
579
581{
582 bool bMSO2007Doc = getFilter().isMSO2007Document();
583 switch( getCurrentElement() )
584 {
585 case C_TOKEN( ser ):
586 switch( nElement )
587 {
588 case C_TOKEN( cat ):
590 case C_TOKEN( dLbls ):
591 return new DataLabelsContext( *this, mrModel.mxLabels.create(bMSO2007Doc) );
592 case C_TOKEN( dPt ):
593 return new DataPointContext( *this, mrModel.maPoints.create(bMSO2007Doc) );
594 case C_TOKEN( errBars ):
595 return new ErrorBarContext( *this, mrModel.maErrorBars.create(bMSO2007Doc) );
596 case C_TOKEN( marker ):
597 return this;
598 case C_TOKEN( smooth ):
599 mrModel.mbSmooth = rAttribs.getBool( XML_val, !bMSO2007Doc );
600 return nullptr;
601 case C_TOKEN( trendline ):
602 return new TrendlineContext( *this, mrModel.maTrendlines.create(bMSO2007Doc) );
603 case C_TOKEN( val ):
605 }
606 break;
607 }
608 return SeriesContextBase::onCreateContext( nElement, rAttribs );
609}
610
611PieSeriesContext::PieSeriesContext( ContextHandler2Helper& rParent, SeriesModel& rModel ) :
612 SeriesContextBase( rParent, rModel )
613{
614}
615
617{
618}
619
621{
622 bool bMSO2007Doc = getFilter().isMSO2007Document();
623 switch( getCurrentElement() )
624 {
625 case C_TOKEN( ser ):
626 switch( nElement )
627 {
628 case C_TOKEN( cat ):
630 case C_TOKEN( dLbls ):
631 return new DataLabelsContext( *this, mrModel.mxLabels.create(bMSO2007Doc) );
632 case C_TOKEN( dPt ):
633 return new DataPointContext( *this, mrModel.maPoints.create(bMSO2007Doc) );
634 case C_TOKEN( explosion ):
635 mrModel.mnExplosion = rAttribs.getInteger( XML_val, 0 );
636 return nullptr;
637 case C_TOKEN( val ):
639 }
640 break;
641 }
642 return SeriesContextBase::onCreateContext( nElement, rAttribs );
643}
644
645RadarSeriesContext::RadarSeriesContext( ContextHandler2Helper& rParent, SeriesModel& rModel ) :
646 SeriesContextBase( rParent, rModel )
647{
648}
649
651{
652}
653
655{
656 bool bMSO2007Doc = getFilter().isMSO2007Document();
657 switch( getCurrentElement() )
658 {
659 case C_TOKEN( ser ):
660 switch( nElement )
661 {
662 case C_TOKEN( cat ):
664 case C_TOKEN( dLbls ):
665 return new DataLabelsContext( *this, mrModel.mxLabels.create(bMSO2007Doc) );
666 case C_TOKEN( dPt ):
667 return new DataPointContext( *this, mrModel.maPoints.create(bMSO2007Doc) );
668 case C_TOKEN( marker ):
669 return this;
670 case C_TOKEN( smooth ):
671 mrModel.mbSmooth = rAttribs.getBool( XML_val, bMSO2007Doc );
672 return nullptr;
673 case C_TOKEN( val ):
675 }
676 break;
677 }
678 return SeriesContextBase::onCreateContext( nElement, rAttribs );
679}
680
681ScatterSeriesContext::ScatterSeriesContext( ContextHandler2Helper& rParent, SeriesModel& rModel ) :
682 SeriesContextBase( rParent, rModel )
683{
684}
685
687{
688}
689
691{
692 bool bMSO2007Doc = getFilter().isMSO2007Document();
693 switch( getCurrentElement() )
694 {
695 case C_TOKEN( ser ):
696 switch( nElement )
697 {
698 case C_TOKEN( dLbls ):
699 return new DataLabelsContext( *this, mrModel.mxLabels.create(bMSO2007Doc) );
700 case C_TOKEN( dPt ):
701 return new DataPointContext( *this, mrModel.maPoints.create(bMSO2007Doc) );
702 case C_TOKEN( errBars ):
703 return new ErrorBarContext( *this, mrModel.maErrorBars.create(bMSO2007Doc) );
704 case C_TOKEN( marker ):
705 return this;
706 case C_TOKEN( smooth ):
707 mrModel.mbSmooth = rAttribs.getBool( XML_val, !bMSO2007Doc );
708 return nullptr;
709 case C_TOKEN( trendline ):
710 return new TrendlineContext( *this, mrModel.maTrendlines.create(bMSO2007Doc) );
711 case C_TOKEN( xVal ):
713 case C_TOKEN( yVal ):
715 }
716 break;
717 }
718 return SeriesContextBase::onCreateContext( nElement, rAttribs );
719}
720
721SurfaceSeriesContext::SurfaceSeriesContext( ContextHandler2Helper& rParent, SeriesModel& rModel ) :
722 SeriesContextBase( rParent, rModel )
723{
724}
725
727{
728}
729
731{
732 switch( getCurrentElement() )
733 {
734 case C_TOKEN( ser ):
735 switch( nElement )
736 {
737 case C_TOKEN( cat ):
739 case C_TOKEN( val ):
741 }
742 break;
743 }
744 return SeriesContextBase::onCreateContext( nElement, rAttribs );
745}
746
747} // namespace oox
748
749/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Provides access to attribute values of an element.
std::optional< sal_Int32 > getInteger(sal_Int32 nAttrToken) const
Returns the 32-bit signed integer value of the specified attribute (decimal).
std::optional< bool > getBool(sal_Int32 nAttrToken) const
Returns the boolean value of the specified attribute.
std::optional< sal_Int32 > getToken(sal_Int32 nAttrToken) const
Returns the token identifier of the value of the specified attribute.
std::optional< double > getDouble(sal_Int32 nAttrToken) const
Returns the double value of the specified attribute.
bool has(key_type nKey) const
Returns true, if the object associated to the passed key exists.
Definition: refmap.hxx:52
XmlFilterBase & getFilter() const
Returns the filter instance.
virtual ::oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElement, const AttributeList &rAttribs) override
AreaSeriesContext(::oox::core::ContextHandler2Helper &rParent, SeriesModel &rModel)
BarSeriesContext(::oox::core::ContextHandler2Helper &rParent, SeriesModel &rModel)
virtual ::oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElement, const AttributeList &rAttribs) override
virtual ::oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElement, const AttributeList &rAttribs) override
BubbleSeriesContext(::oox::core::ContextHandler2Helper &rParent, SeriesModel &rModel)
Handler for a chart data point label context (c:dLbl element).
virtual ::oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElement, const AttributeList &rAttribs) override
DataLabelContext(::oox::core::ContextHandler2Helper &rParent, DataLabelModel &rModel)
virtual void onCharacters(const OUString &rChars) override
Handler for a chart data point label context (c:dLbls element).
DataLabelsContext(::oox::core::ContextHandler2Helper &rParent, DataLabelsModel &rModel)
virtual ::oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElement, const AttributeList &rAttribs) override
virtual void onCharacters(const OUString &rChars) override
Handler for a chart data point context (c:dPt element).
virtual ::oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElement, const AttributeList &rAttribs) override
DataPointContext(::oox::core::ContextHandler2Helper &rParent, DataPointModel &rModel)
Handler for a data source context (c:bubbleSize, c:cat, c:minus, c:plus, c:val, c:xVal,...
Handler for a series error bar context (c:errBars element).
virtual ::oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElement, const AttributeList &rAttribs) override
ErrorBarContext(::oox::core::ContextHandler2Helper &rParent, ErrorBarModel &rModel)
Handler for a chart layout context (c:layout element).
virtual ::oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElement, const AttributeList &rAttribs) override
LineSeriesContext(::oox::core::ContextHandler2Helper &rParent, SeriesModel &rModel)
ModelType & create(KeyType eKey)
Definition: modelbase.hxx:85
Handler for fill bitmap settings (c:pictureOptions element).
PictureOptionsContext(::oox::core::ContextHandler2Helper &rParent, PictureOptionsModel &rModel)
virtual ::oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElement, const AttributeList &rAttribs) override
virtual ::oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElement, const AttributeList &rAttribs) override
PieSeriesContext(::oox::core::ContextHandler2Helper &rParent, SeriesModel &rModel)
virtual ::oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElement, const AttributeList &rAttribs) override
RadarSeriesContext(::oox::core::ContextHandler2Helper &rParent, SeriesModel &rModel)
ScatterSeriesContext(::oox::core::ContextHandler2Helper &rParent, SeriesModel &rModel)
virtual ::oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElement, const AttributeList &rAttribs) override
Handler base class for chart data series contexts (c:ser element).
virtual ::oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElement, const AttributeList &rAttribs) override
SeriesContextBase(::oox::core::ContextHandler2Helper &rParent, SeriesModel &rModel)
Help class for all contexts that have only the c:spPr child element.
virtual ::oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElement, const AttributeList &rAttribs) override
SurfaceSeriesContext(::oox::core::ContextHandler2Helper &rParent, SeriesModel &rModel)
Handler for a chart text context (c:tx element).
Handler for a series trendline context (c:trendline element).
virtual ::oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElement, const AttributeList &rAttribs) override
virtual void onCharacters(const OUString &rChars) override
TrendlineContext(::oox::core::ContextHandler2Helper &rParent, TrendlineModel &rModel)
Handler for a series trendline label context (c:trendlineLbl element).
TrendlineLabelContext(::oox::core::ContextHandler2Helper &rParent, TrendlineLabelModel &rModel)
virtual ::oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElement, const AttributeList &rAttribs) override
const char * name
const sal_uInt16 idx[]
sal_Int32 getToken(const Context &rContext, const char *pToken)
def forward(n)
def backward(n)
size
css::uno::Reference< css::deployment::XPackageRegistry > create(css::uno::Reference< css::deployment::XPackageRegistry > const &xRootRegistry, OUString const &context, OUString const &cachePath, css::uno::Reference< css::uno::XComponentContext > const &xComponentContext)
::rtl::Reference< ContextHandler > ContextHandlerRef
XML_none
XML_TOKEN_INVALID
std::optional< bool > mobShowDataLabelsRange
True = show data point value.
Definition: seriesmodel.hxx:47
sal_Int32 mnIndex
Reference to the labels container.
Definition: seriesmodel.hxx:64
TextRef mxText
Layout/position of the data point label frame.
Definition: seriesmodel.hxx:62
ShapeRef mxLeaderLines
Settings for individual data point labels.
Definition: seriesmodel.hxx:76
std::optional< sal_Int32 > monMarkerSize
Pie slice moved from pie center.
sal_Int32 mnIndex
True = show bubbles with 3D shade.
std::optional< sal_Int32 > monExplosion
Data point marker formatting.
bool mbInvertNeg
Unique data point index.
ShapeRef mxMarkerProp
Fill bitmap settings.
std::optional< sal_Int32 > monMarkerSymbol
Size of the series line marker (2...72).
PictureOptionsRef mxPicOptions
Data point formatting.
std::optional< bool > mobBubble3d
Series line marker symbol.
sal_Int32 mnValueType
Type of the error bars (plus/minus/both).
bool mbNoEndCap
Type of the values.
sal_Int32 mnTypeId
Direction of the error bars (x/y).
ShapeRef mxShapeProp
Source ranges for manual error bar values.
double mfValue
Error line formatting.
sal_Int32 mnDirection
Fixed value for several error bar types.
void setAttributes(const AttributeList &rAttribs)
Definition: modelbase.cxx:32
bool mbApplyToEnd
True = draw picture at left/right side of 3D data points.
Definition: seriesmodel.hxx:92
sal_Int32 mnPictureFormat
Bitmap stacking unit.
Definition: seriesmodel.hxx:89
bool mbApplyToSides
True = draw picture at front/back side of 3D data points.
Definition: seriesmodel.hxx:91
bool mbApplyToFront
Bitmap mode (stretch/tile).
Definition: seriesmodel.hxx:90
sal_Int32 mnMarkerSymbol
Size of the series line marker (2...72).
DataPointVector maPoints
All trendlines of this series.
sal_Int32 mnOrder
Series line marker symbol.
TrendlineVector maTrendlines
All error bars of this series.
sal_Int32 mnExplosion
3D bar shape type.
DataLabelsRef mxLabels
Series title source.
bool mbInvertNeg
True = show bubbles with 3D shade.
ErrorBarVector maErrorBars
Series source ranges.
@ DATALABELS
Data point size (e.g. bubble size in bubble charts).
@ VALUES
Data point categories.
sal_Int32 mnMarkerSize
Series index used for automatic formatting.
sal_Int32 mnIndex
Pie slice moved from pie center.
std::optional< sal_Int32 > monShape
Data point label settings for all points.
PictureOptionsRef mxPicOptions
Series formatting.
ShapeRef mxMarkerProp
Fill bitmap settings.
TextRef mxText
Data point marker formatting.
ShapeRef mxShapeProp
Explicit formatted data points.
bool mbSmooth
True = invert negative data points.
NumberFormat maNumberFormat
Text source of the label.
TextRef mxText
Layout/position of the frame.
LayoutRef mxLayout
Label text formatting.
TextBodyRef mxTextProp
Label frame formatting.
TrendlineLabelRef mxLabel
Trendline formatting.
sal_Int32 mnTypeId
Moving average period in range [2, 255].
std::optional< double > mfBackward
User-defined name of the trendline.
bool mbDispRSquared
True = show equation of the trendline.
bool mbDispEquation
Type of the trendline.
OUString maName
Trendline label text object.
std::optional< double > mfIntercept
Size of trendline behind last data point.
sal_Int32 mnPeriod
Polynomial order in range [2, 6].
sal_Int32 mnOrder
Crossing point with Y axis.
std::optional< double > mfForward
Size of trendline before first data point.