LCOV - code coverage report
Current view: top level - oox/source/drawingml/chart - seriescontext.cxx (source / functions) Hit Total Coverage
Test: commit 0e63ca4fde4e446f346e35849c756a30ca294aab Lines: 216 335 64.5 %
Date: 2014-04-11 Functions: 49 71 69.0 %
Legend: Lines: hit not hit

          Line data    Source code
       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             : 
      20             : #include "oox/drawingml/chart/seriescontext.hxx"
      21             : 
      22             : #include "oox/drawingml/shapepropertiescontext.hxx"
      23             : #include "oox/drawingml/textbodycontext.hxx"
      24             : #include "oox/drawingml/chart/datasourcecontext.hxx"
      25             : #include "oox/drawingml/chart/seriesmodel.hxx"
      26             : #include "oox/drawingml/chart/titlecontext.hxx"
      27             : 
      28             : namespace oox {
      29             : namespace drawingml {
      30             : namespace chart {
      31             : 
      32             : 
      33             : 
      34             : using ::oox::core::ContextHandler2;
      35             : using ::oox::core::ContextHandler2Helper;
      36             : using ::oox::core::ContextHandlerRef;
      37             : 
      38             : 
      39             : 
      40             : namespace {
      41             : 
      42         589 : ContextHandlerRef lclDataLabelSharedCreateContext( ContextHandler2& rContext,
      43             :         sal_Int32 nElement, const AttributeList& rAttribs, DataLabelModelBase& orModel )
      44             : {
      45         589 :     if( rContext.isRootElement() ) switch( nElement )
      46             :     {
      47             :         case C_TOKEN( delete ):
      48             :             // default is 'false', not 'true' as specified
      49          33 :             orModel.mbDeleted = rAttribs.getBool( XML_val, false );
      50          33 :             return 0;
      51             :         case C_TOKEN( dLblPos ):
      52          36 :             orModel.monLabelPos = rAttribs.getToken( XML_val, XML_TOKEN_INVALID );
      53          36 :             return 0;
      54             :         case C_TOKEN( numFmt ):
      55           1 :             orModel.maNumberFormat.setAttributes( rAttribs );
      56           1 :             return 0;
      57             :         case C_TOKEN( showBubbleSize ):
      58          69 :             orModel.mobShowBubbleSize = rAttribs.getBool( XML_val );
      59          69 :             return 0;
      60             :         case C_TOKEN( showCatName ):
      61          89 :             orModel.mobShowCatName = rAttribs.getBool( XML_val );
      62          89 :             return 0;
      63             :         case C_TOKEN( showLegendKey ):
      64          82 :             orModel.mobShowLegendKey = rAttribs.getBool( XML_val );
      65          82 :             return 0;
      66             :         case C_TOKEN( showPercent ):
      67          89 :             orModel.mobShowPercent = rAttribs.getBool( XML_val );
      68          89 :             return 0;
      69             :         case C_TOKEN( showSerName ):
      70          89 :             orModel.mobShowSerName = rAttribs.getBool( XML_val );
      71          89 :             return 0;
      72             :         case C_TOKEN( showVal ):
      73          85 :             orModel.mobShowVal = rAttribs.getBool( XML_val );
      74          85 :             return 0;
      75             :         case C_TOKEN( separator ):
      76             :             // collect separator text in onCharacters()
      77           7 :             return &rContext;
      78             :         case C_TOKEN( spPr ):
      79           6 :             return new ShapePropertiesContext( rContext, orModel.mxShapeProp.create() );
      80             :         case C_TOKEN( txPr ):
      81           3 :             return new TextBodyContext( rContext, orModel.mxTextProp.create() );
      82             :     }
      83           0 :     return 0;
      84             : }
      85             : 
      86           7 : void lclDataLabelSharedCharacters( ContextHandler2& rContext, const OUString& rChars, DataLabelModelBase& orModel )
      87             : {
      88           7 :     if( rContext.isCurrentElement( C_TOKEN( separator ) ) )
      89           7 :         orModel.moaSeparator = rChars;
      90           7 : }
      91             : 
      92             : } // namespace
      93             : 
      94             : 
      95             : 
      96          73 : DataLabelContext::DataLabelContext( ContextHandler2Helper& rParent, DataLabelModel& rModel ) :
      97          73 :     ContextBase< DataLabelModel >( rParent, rModel )
      98             : {
      99          73 : }
     100             : 
     101         146 : DataLabelContext::~DataLabelContext()
     102             : {
     103         146 : }
     104             : 
     105         434 : ContextHandlerRef DataLabelContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
     106             : {
     107         434 :     if( isRootElement() ) switch( nElement )
     108             :     {
     109             :         case C_TOKEN( idx ):
     110          73 :             mrModel.mnIndex = rAttribs.getInteger( XML_val, -1 );
     111          73 :             return 0;
     112             :         case C_TOKEN( layout ):
     113          30 :             return new LayoutContext( *this, mrModel.mxLayout.create() );
     114             :         case C_TOKEN( tx ):
     115          31 :             return new TextContext( *this, mrModel.mxText.create() );
     116             :     }
     117         300 :     return lclDataLabelSharedCreateContext( *this, nElement, rAttribs, mrModel );
     118             : }
     119             : 
     120           7 : void DataLabelContext::onCharacters( const OUString& rChars )
     121             : {
     122           7 :     lclDataLabelSharedCharacters( *this, rChars, mrModel );
     123           7 : }
     124             : 
     125             : 
     126             : 
     127          52 : DataLabelsContext::DataLabelsContext( ContextHandler2Helper& rParent, DataLabelsModel& rModel ) :
     128          52 :     ContextBase< DataLabelsModel >( rParent, rModel )
     129             : {
     130          52 : }
     131             : 
     132         104 : DataLabelsContext::~DataLabelsContext()
     133             : {
     134         104 : }
     135             : 
     136         375 : ContextHandlerRef DataLabelsContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
     137             : {
     138         375 :     if( isRootElement() ) switch( nElement )
     139             :     {
     140             :         case C_TOKEN( dLbl ):
     141          73 :             return new DataLabelContext( *this, mrModel.maPointLabels.create() );
     142             :         case C_TOKEN( leaderLines ):
     143           0 :             return new ShapePrWrapperContext( *this, mrModel.mxLeaderLines.create() );
     144             :         case C_TOKEN( showLeaderLines ):
     145             :             // default is 'false', not 'true' as specified
     146          13 :             mrModel.mbShowLeaderLines = rAttribs.getBool( XML_val, false );
     147          13 :             return 0;
     148             :     }
     149         289 :     return lclDataLabelSharedCreateContext( *this, nElement, rAttribs, mrModel );
     150             : }
     151             : 
     152           0 : void DataLabelsContext::onCharacters( const OUString& rChars )
     153             : {
     154           0 :     lclDataLabelSharedCharacters( *this, rChars, mrModel );
     155           0 : }
     156             : 
     157             : 
     158             : 
     159           0 : PictureOptionsContext::PictureOptionsContext( ContextHandler2Helper& rParent, PictureOptionsModel& rModel ) :
     160           0 :     ContextBase< PictureOptionsModel >( rParent, rModel )
     161             : {
     162           0 : }
     163             : 
     164           0 : PictureOptionsContext::~PictureOptionsContext()
     165             : {
     166           0 : }
     167             : 
     168           0 : ContextHandlerRef PictureOptionsContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
     169             : {
     170           0 :     if( isRootElement() ) switch( nElement )
     171             :     {
     172             :         case C_TOKEN( applyToEnd ):
     173             :             // default is 'false', not 'true' as specified
     174           0 :             mrModel.mbApplyToEnd = rAttribs.getBool( XML_val, false );
     175           0 :             return 0;
     176             :         case C_TOKEN( applyToFront ):
     177             :             // default is 'false', not 'true' as specified
     178           0 :             mrModel.mbApplyToFront = rAttribs.getBool( XML_val, false );
     179           0 :             return 0;
     180             :         case C_TOKEN( applyToSides ):
     181             :             // default is 'false', not 'true' as specified
     182           0 :             mrModel.mbApplyToSides = rAttribs.getBool( XML_val, false );
     183           0 :             return 0;
     184             :         case C_TOKEN( pictureFormat ):
     185           0 :             mrModel.mnPictureFormat = rAttribs.getToken( XML_val, XML_stretch );
     186           0 :             return 0;
     187             :         case C_TOKEN( pictureStackUnit ):
     188           0 :             mrModel.mfStackUnit = rAttribs.getDouble( XML_val, 1.0 );
     189           0 :             return 0;
     190             :     }
     191           0 :     return 0;
     192             : }
     193             : 
     194             : 
     195             : 
     196           1 : ErrorBarContext::ErrorBarContext( ContextHandler2Helper& rParent, ErrorBarModel& rModel ) :
     197           1 :     ContextBase< ErrorBarModel >( rParent, rModel )
     198             : {
     199           1 : }
     200             : 
     201           2 : ErrorBarContext::~ErrorBarContext()
     202             : {
     203           2 : }
     204             : 
     205           5 : ContextHandlerRef ErrorBarContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
     206             : {
     207           5 :     if( isRootElement() ) switch( nElement )
     208             :     {
     209             :         case C_TOKEN( errBarType ):
     210           1 :             mrModel.mnTypeId = rAttribs.getToken( XML_val, XML_both );
     211           1 :             return 0;
     212             :         case C_TOKEN( errDir ):
     213           1 :             mrModel.mnDirection = rAttribs.getToken( XML_val, XML_TOKEN_INVALID );
     214           1 :             return 0;
     215             :         case C_TOKEN( errValType ):
     216           1 :             mrModel.mnValueType = rAttribs.getToken( XML_val, XML_fixedVal );
     217           1 :             return 0;
     218             :         case C_TOKEN( minus ):
     219           0 :             return new DataSourceContext( *this, mrModel.maSources.create( ErrorBarModel::MINUS ) );
     220             :         case C_TOKEN( noEndCap ):
     221             :             // default is 'false', not 'true' as specified
     222           1 :             mrModel.mbNoEndCap = rAttribs.getBool( XML_val, false );
     223           1 :             return 0;
     224             :         case C_TOKEN( plus ):
     225           0 :             return new DataSourceContext( *this, mrModel.maSources.create( ErrorBarModel::PLUS ) );
     226             :         case C_TOKEN( spPr ):
     227           0 :             return new ShapePropertiesContext( *this, mrModel.mxShapeProp.create() );
     228             :         case C_TOKEN( val ):
     229           1 :             mrModel.mfValue = rAttribs.getDouble( XML_val, 0.0 );
     230           1 :             return 0;
     231             :     }
     232           0 :     return 0;
     233             : }
     234             : 
     235             : 
     236             : 
     237           0 : TrendlineLabelContext::TrendlineLabelContext( ContextHandler2Helper& rParent, TrendlineLabelModel& rModel ) :
     238           0 :     ContextBase< TrendlineLabelModel >( rParent, rModel )
     239             : {
     240           0 : }
     241             : 
     242           0 : TrendlineLabelContext::~TrendlineLabelContext()
     243             : {
     244           0 : }
     245             : 
     246           0 : ContextHandlerRef TrendlineLabelContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
     247             : {
     248           0 :     if( isRootElement() ) switch( nElement )
     249             :     {
     250             :         case C_TOKEN( layout ):
     251           0 :             return new LayoutContext( *this, mrModel.mxLayout.create() );
     252             :         case C_TOKEN( numFmt ):
     253           0 :             mrModel.maNumberFormat.setAttributes( rAttribs );
     254           0 :             return 0;
     255             :         case C_TOKEN( spPr ):
     256           0 :             return new ShapePropertiesContext( *this, mrModel.mxShapeProp.create() );
     257             :         case C_TOKEN( tx ):
     258           0 :             return new TextContext( *this, mrModel.mxText.create() );
     259             :         case C_TOKEN( txPr ):
     260           0 :             return new TextBodyContext( *this, mrModel.mxTextProp.create() );
     261             :     }
     262           0 :     return 0;
     263             : }
     264             : 
     265             : 
     266             : 
     267           3 : TrendlineContext::TrendlineContext( ContextHandler2Helper& rParent, TrendlineModel& rModel ) :
     268           3 :     ContextBase< TrendlineModel >( rParent, rModel )
     269             : {
     270           3 : }
     271             : 
     272           6 : TrendlineContext::~TrendlineContext()
     273             : {
     274           6 : }
     275             : 
     276          24 : ContextHandlerRef TrendlineContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
     277             : {
     278          24 :     if( isRootElement() ) switch( nElement )
     279             :     {
     280             :         case C_TOKEN( backward ):
     281           3 :             mrModel.mfBackward = rAttribs.getDouble( XML_val, 0.0 );
     282           3 :             return 0;
     283             :         case C_TOKEN( dispEq ):
     284             :             // default is 'false', not 'true' as specified
     285           3 :             mrModel.mbDispEquation = rAttribs.getBool( XML_val, false );
     286           3 :             return 0;
     287             :         case C_TOKEN( dispRSqr ):
     288             :             // default is 'false', not 'true' as specified
     289           3 :             mrModel.mbDispRSquared = rAttribs.getBool( XML_val, false );
     290           3 :             return 0;
     291             :         case C_TOKEN( forward ):
     292           3 :             mrModel.mfForward = rAttribs.getDouble( XML_val, 0.0 );
     293           3 :             return 0;
     294             :         case C_TOKEN( intercept ):
     295           1 :             mrModel.mfIntercept = rAttribs.getDouble( XML_val, 0.0 );
     296           1 :             return 0;
     297             :         case C_TOKEN( name ):
     298           3 :             return this;    // collect name in onCharacters()
     299             :         case C_TOKEN( order ):
     300           1 :             mrModel.mnOrder = rAttribs.getInteger( XML_val, 2 );
     301           1 :             return 0;
     302             :         case C_TOKEN( period ):
     303           1 :             mrModel.mnPeriod = rAttribs.getInteger( XML_val, 2 );
     304           1 :             return 0;
     305             :         case C_TOKEN( spPr ):
     306           3 :             return new ShapePropertiesContext( *this, mrModel.mxShapeProp.create() );
     307             :         case C_TOKEN( trendlineLbl ):
     308           0 :             return new TrendlineLabelContext( *this, mrModel.mxLabel.create() );
     309             :         case C_TOKEN( trendlineType ):
     310           3 :             mrModel.mnTypeId = rAttribs.getToken( XML_val, XML_linear );
     311           3 :             return 0;
     312             :     }
     313           0 :     return 0;
     314             : }
     315             : 
     316           3 : void TrendlineContext::onCharacters( const OUString& rChars )
     317             : {
     318           3 :     if( isCurrentElement( C_TOKEN( name ) ) )
     319           3 :         mrModel.maName = rChars;
     320           3 : }
     321             : 
     322             : 
     323             : 
     324          66 : DataPointContext::DataPointContext( ContextHandler2Helper& rParent, DataPointModel& rModel ) :
     325          66 :     ContextBase< DataPointModel >( rParent, rModel )
     326             : {
     327          66 : }
     328             : 
     329         132 : DataPointContext::~DataPointContext()
     330             : {
     331         132 : }
     332             : 
     333         168 : ContextHandlerRef DataPointContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
     334             : {
     335         168 :     switch( getCurrentElement() )
     336             :     {
     337             :         case C_TOKEN( dPt ):
     338         168 :             switch( nElement )
     339             :             {
     340             :                 case C_TOKEN( bubble3D ):
     341          34 :                     mrModel.mobBubble3d = rAttribs.getBool( XML_val );
     342          34 :                     return 0;
     343             :                 case C_TOKEN( explosion ):
     344             :                     // if the 'val' attribute is missing, series explosion remains unchanged
     345           2 :                     mrModel.monExplosion = rAttribs.getInteger( XML_val );
     346           2 :                     return 0;
     347             :                 case C_TOKEN( idx ):
     348          66 :                     mrModel.mnIndex = rAttribs.getInteger( XML_val, -1 );
     349          66 :                     return 0;
     350             :                 case C_TOKEN( invertIfNegative ):
     351             :                     // default is 'false', not 'true' as specified (value not derived from series!)
     352           1 :                     mrModel.mbInvertNeg = rAttribs.getBool( XML_val, false );
     353           1 :                     return 0;
     354             :                 case C_TOKEN( marker ):
     355           0 :                     return this;
     356             :                 case C_TOKEN( pictureOptions ):
     357           0 :                     return new PictureOptionsContext( *this, mrModel.mxPicOptions.create() );
     358             :                 case C_TOKEN( spPr ):
     359          65 :                     return new ShapePropertiesContext( *this, mrModel.mxShapeProp.create() );
     360             :             }
     361           0 :         break;
     362             : 
     363             :         case C_TOKEN( marker ):
     364           0 :             switch( nElement )
     365             :             {
     366             :                 case C_TOKEN( size ):
     367           0 :                     mrModel.monMarkerSize = rAttribs.getInteger( XML_val, 5 );
     368           0 :                     return 0;
     369             :                 case C_TOKEN( spPr ):
     370           0 :                     return new ShapePropertiesContext( *this, mrModel.mxMarkerProp.create() );
     371             :                 case C_TOKEN( symbol ):
     372           0 :                     mrModel.monMarkerSymbol = rAttribs.getToken( XML_val, XML_none );
     373           0 :                     return 0;
     374             :             }
     375           0 :         break;
     376             :     }
     377           0 :     return 0;
     378             : }
     379             : 
     380             : 
     381             : 
     382         157 : SeriesContextBase::SeriesContextBase( ContextHandler2Helper& rParent, SeriesModel& rModel ) :
     383         157 :     ContextBase< SeriesModel >( rParent, rModel )
     384             : {
     385         157 : }
     386             : 
     387         157 : SeriesContextBase::~SeriesContextBase()
     388             : {
     389         157 : }
     390             : 
     391         574 : ContextHandlerRef SeriesContextBase::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
     392             : {
     393         574 :     switch( getCurrentElement() )
     394             :     {
     395             :         case C_TOKEN( ser ):
     396         551 :             switch( nElement )
     397             :             {
     398             :                 case C_TOKEN( idx ):
     399         157 :                     mrModel.mnIndex = rAttribs.getInteger( XML_val, -1 );
     400         157 :                     return 0;
     401             :                 case C_TOKEN( order ):
     402         157 :                     mrModel.mnOrder = rAttribs.getInteger( XML_val, -1 );
     403         157 :                     return 0;
     404             :                 case C_TOKEN( spPr ):
     405          85 :                     return new ShapePropertiesContext( *this, mrModel.mxShapeProp.create() );
     406             :                 case C_TOKEN( tx ):
     407         152 :                     return new TextContext( *this, mrModel.mxText.create() );
     408             :             }
     409           0 :         break;
     410             : 
     411             :         case C_TOKEN( marker ):
     412          23 :             switch( nElement )
     413             :             {
     414             :                 case C_TOKEN( size ):
     415           5 :                     mrModel.mnMarkerSize = rAttribs.getInteger( XML_val, 5 );
     416           5 :                     return 0;
     417             :                 case C_TOKEN( spPr ):
     418           5 :                     return new ShapePropertiesContext( *this, mrModel.mxMarkerProp.create() );
     419             :                 case C_TOKEN( symbol ):
     420          13 :                     mrModel.mnMarkerSymbol = rAttribs.getToken( XML_val, XML_none );
     421          13 :                     return 0;
     422             :             }
     423           0 :         break;
     424             :     }
     425           0 :     return 0;
     426             : }
     427             : 
     428             : 
     429             : 
     430           2 : AreaSeriesContext::AreaSeriesContext( ContextHandler2Helper& rParent, SeriesModel& rModel ) :
     431           2 :     SeriesContextBase( rParent, rModel )
     432             : {
     433           2 : }
     434             : 
     435           4 : AreaSeriesContext::~AreaSeriesContext()
     436             : {
     437           4 : }
     438             : 
     439          13 : ContextHandlerRef AreaSeriesContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
     440             : {
     441          13 :     switch( getCurrentElement() )
     442             :     {
     443             :         case C_TOKEN( ser ):
     444          13 :             switch( nElement )
     445             :             {
     446             :                 case C_TOKEN( cat ):
     447           2 :                     return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::CATEGORIES ) );
     448             :                 case C_TOKEN( errBars ):
     449           0 :                     return new ErrorBarContext( *this, mrModel.maErrorBars.create() );
     450             :                 case C_TOKEN( dLbls ):
     451           2 :                     return new DataLabelsContext( *this, mrModel.mxLabels.create() );
     452             :                 case C_TOKEN( dPt ):
     453           0 :                     return new DataPointContext( *this, mrModel.maPoints.create() );
     454             :                 case C_TOKEN( trendline ):
     455           0 :                     return new TrendlineContext( *this, mrModel.maTrendlines.create() );
     456             :                 case C_TOKEN( val ):
     457           2 :                     return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::VALUES ) );
     458             :             }
     459           7 :         break;
     460             :     }
     461           7 :     return SeriesContextBase::onCreateContext( nElement, rAttribs );
     462             : }
     463             : 
     464             : 
     465             : 
     466         118 : BarSeriesContext::BarSeriesContext( ContextHandler2Helper& rParent, SeriesModel& rModel ) :
     467         118 :     SeriesContextBase( rParent, rModel )
     468             : {
     469         118 : }
     470             : 
     471         236 : BarSeriesContext::~BarSeriesContext()
     472             : {
     473         236 : }
     474             : 
     475         679 : ContextHandlerRef BarSeriesContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
     476             : {
     477         679 :     switch( getCurrentElement() )
     478             :     {
     479             :         case C_TOKEN( ser ):
     480         679 :             switch( nElement )
     481             :             {
     482             :                 case C_TOKEN( cat ):
     483         104 :                     return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::CATEGORIES ) );
     484             :                 case C_TOKEN( dLbls ):
     485           1 :                     return new DataLabelsContext( *this, mrModel.mxLabels.create() );
     486             :                 case C_TOKEN( dPt ):
     487           1 :                     return new DataPointContext( *this, mrModel.maPoints.create() );
     488             :                 case C_TOKEN( errBars ):
     489           0 :                     return new ErrorBarContext( *this, mrModel.maErrorBars.create() );
     490             :                 case C_TOKEN( invertIfNegative ):
     491             :                     // default is 'false', not 'true' as specified
     492          47 :                     mrModel.mbInvertNeg = rAttribs.getBool( XML_val, false );
     493          47 :                     return 0;
     494             :                 case C_TOKEN( pictureOptions ):
     495           0 :                     return new PictureOptionsContext( *this, mrModel.mxPicOptions.create() );
     496             :                 case C_TOKEN( shape ):
     497             :                     // missing attribute does not change shape type to 'box' as specified
     498           0 :                     mrModel.monShape = rAttribs.getToken( XML_val );
     499           0 :                     return 0;
     500             :                 case C_TOKEN( trendline ):
     501           0 :                     return new TrendlineContext( *this, mrModel.maTrendlines.create() );
     502             :                 case C_TOKEN( val ):
     503         116 :                     return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::VALUES ) );
     504             :             }
     505         410 :         break;
     506             :     }
     507         410 :     return SeriesContextBase::onCreateContext( nElement, rAttribs );
     508             : }
     509             : 
     510             : 
     511             : 
     512           0 : BubbleSeriesContext::BubbleSeriesContext( ContextHandler2Helper& rParent, SeriesModel& rModel ) :
     513           0 :     SeriesContextBase( rParent, rModel )
     514             : {
     515           0 : }
     516             : 
     517           0 : BubbleSeriesContext::~BubbleSeriesContext()
     518             : {
     519           0 : }
     520             : 
     521           0 : ContextHandlerRef BubbleSeriesContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
     522             : {
     523           0 :     switch( getCurrentElement() )
     524             :     {
     525             :         case C_TOKEN( ser ):
     526           0 :             switch( nElement )
     527             :             {
     528             :                 case C_TOKEN( bubble3D ):
     529             :                     // default is 'false', not 'true' as specified
     530           0 :                     mrModel.mbBubble3d = rAttribs.getBool( XML_val, false );
     531           0 :                     return 0;
     532             :                 case C_TOKEN( bubbleSize ):
     533           0 :                     return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::POINTS ) );
     534             :                 case C_TOKEN( dLbls ):
     535           0 :                     return new DataLabelsContext( *this, mrModel.mxLabels.create() );
     536             :                 case C_TOKEN( dPt ):
     537           0 :                     return new DataPointContext( *this, mrModel.maPoints.create() );
     538             :                 case C_TOKEN( errBars ):
     539           0 :                     return new ErrorBarContext( *this, mrModel.maErrorBars.create() );
     540             :                 case C_TOKEN( invertIfNegative ):
     541             :                     // default is 'false', not 'true' as specified
     542           0 :                     mrModel.mbInvertNeg = rAttribs.getBool( XML_val, false );
     543           0 :                     return 0;
     544             :                 case C_TOKEN( trendline ):
     545           0 :                     return new TrendlineContext( *this, mrModel.maTrendlines.create() );
     546             :                 case C_TOKEN( xVal ):
     547           0 :                     return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::CATEGORIES ) );
     548             :                 case C_TOKEN( yVal ):
     549           0 :                     return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::VALUES ) );
     550             :             }
     551           0 :         break;
     552             :     }
     553           0 :     return SeriesContextBase::onCreateContext( nElement, rAttribs );
     554             : }
     555             : 
     556             : 
     557             : 
     558          18 : LineSeriesContext::LineSeriesContext( ContextHandler2Helper& rParent, SeriesModel& rModel ) :
     559          18 :     SeriesContextBase( rParent, rModel )
     560             : {
     561          18 : }
     562             : 
     563          36 : LineSeriesContext::~LineSeriesContext()
     564             : {
     565          36 : }
     566             : 
     567         139 : ContextHandlerRef LineSeriesContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
     568             : {
     569         139 :     switch( getCurrentElement() )
     570             :     {
     571             :         case C_TOKEN( ser ):
     572         125 :             switch( nElement )
     573             :             {
     574             :                 case C_TOKEN( cat ):
     575          16 :                     return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::CATEGORIES ) );
     576             :                 case C_TOKEN( dLbls ):
     577           6 :                     return new DataLabelsContext( *this, mrModel.mxLabels.create() );
     578             :                 case C_TOKEN( dPt ):
     579           0 :                     return new DataPointContext( *this, mrModel.maPoints.create() );
     580             :                 case C_TOKEN( errBars ):
     581           0 :                     return new ErrorBarContext( *this, mrModel.maErrorBars.create() );
     582             :                 case C_TOKEN( marker ):
     583          10 :                     return this;
     584             :                 case C_TOKEN( smooth ):
     585             :                     // TODO: fix for MSO 2007 behavior
     586             :                     // MSO 2007 writes false by default and not true
     587          10 :                     mrModel.mbSmooth = rAttribs.getBool( XML_val, true );
     588          10 :                     return 0;
     589             :                 case C_TOKEN( trendline ):
     590           0 :                     return new TrendlineContext( *this, mrModel.maTrendlines.create() );
     591             :                 case C_TOKEN( val ):
     592          18 :                     return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::VALUES ) );
     593             :             }
     594          65 :         break;
     595             :     }
     596          79 :     return SeriesContextBase::onCreateContext( nElement, rAttribs );
     597             : }
     598             : 
     599             : 
     600             : 
     601          14 : PieSeriesContext::PieSeriesContext( ContextHandler2Helper& rParent, SeriesModel& rModel ) :
     602          14 :     SeriesContextBase( rParent, rModel )
     603             : {
     604          14 : }
     605             : 
     606          28 : PieSeriesContext::~PieSeriesContext()
     607             : {
     608          28 : }
     609             : 
     610         159 : ContextHandlerRef PieSeriesContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
     611             : {
     612         159 :     switch( getCurrentElement() )
     613             :     {
     614             :         case C_TOKEN( ser ):
     615         159 :             switch( nElement )
     616             :             {
     617             :                 case C_TOKEN( cat ):
     618          12 :                     return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::CATEGORIES ) );
     619             :                 case C_TOKEN( dLbls ):
     620          10 :                     return new DataLabelsContext( *this, mrModel.mxLabels.create() );
     621             :                 case C_TOKEN( dPt ):
     622          65 :                     return new DataPointContext( *this, mrModel.maPoints.create() );
     623             :                 case C_TOKEN( explosion ):
     624           9 :                     mrModel.mnExplosion = rAttribs.getInteger( XML_val, 0 );
     625           9 :                     return 0;
     626             :                 case C_TOKEN( val ):
     627          14 :                     return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::VALUES ) );
     628             :             }
     629          49 :         break;
     630             :     }
     631          49 :     return SeriesContextBase::onCreateContext( nElement, rAttribs );
     632             : }
     633             : 
     634             : 
     635             : 
     636           0 : RadarSeriesContext::RadarSeriesContext( ContextHandler2Helper& rParent, SeriesModel& rModel ) :
     637           0 :     SeriesContextBase( rParent, rModel )
     638             : {
     639           0 : }
     640             : 
     641           0 : RadarSeriesContext::~RadarSeriesContext()
     642             : {
     643           0 : }
     644             : 
     645           0 : ContextHandlerRef RadarSeriesContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
     646             : {
     647           0 :     switch( getCurrentElement() )
     648             :     {
     649             :         case C_TOKEN( ser ):
     650           0 :             switch( nElement )
     651             :             {
     652             :                 case C_TOKEN( cat ):
     653           0 :                     return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::CATEGORIES ) );
     654             :                 case C_TOKEN( dLbls ):
     655           0 :                     return new DataLabelsContext( *this, mrModel.mxLabels.create() );
     656             :                 case C_TOKEN( dPt ):
     657           0 :                     return new DataPointContext( *this, mrModel.maPoints.create() );
     658             :                 case C_TOKEN( marker ):
     659           0 :                     return this;
     660             :                 case C_TOKEN( smooth ):
     661             :                     // TODO: fix for MSO 2007 behavior
     662             :                     // MSO 2007 writes false by default and not true
     663           0 :                     mrModel.mbSmooth = rAttribs.getBool( XML_val, true );
     664           0 :                     return 0;
     665             :                 case C_TOKEN( val ):
     666           0 :                     return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::VALUES ) );
     667             :             }
     668           0 :         break;
     669             :     }
     670           0 :     return SeriesContextBase::onCreateContext( nElement, rAttribs );
     671             : }
     672             : 
     673             : 
     674             : 
     675           5 : ScatterSeriesContext::ScatterSeriesContext( ContextHandler2Helper& rParent, SeriesModel& rModel ) :
     676           5 :     SeriesContextBase( rParent, rModel )
     677             : {
     678           5 : }
     679             : 
     680          10 : ScatterSeriesContext::~ScatterSeriesContext()
     681             : {
     682          10 : }
     683             : 
     684          53 : ContextHandlerRef ScatterSeriesContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
     685             : {
     686          53 :     switch( getCurrentElement() )
     687             :     {
     688             :         case C_TOKEN( ser ):
     689          44 :             switch( nElement )
     690             :             {
     691             :                 case C_TOKEN( dLbls ):
     692           2 :                     return new DataLabelsContext( *this, mrModel.mxLabels.create() );
     693             :                 case C_TOKEN( dPt ):
     694           0 :                     return new DataPointContext( *this, mrModel.maPoints.create() );
     695             :                 case C_TOKEN( errBars ):
     696           1 :                     return new ErrorBarContext( *this, mrModel.maErrorBars.create() );
     697             :                 case C_TOKEN( marker ):
     698           3 :                     return this;
     699             :                 case C_TOKEN( smooth ):
     700             :                     // TODO: fix for MSO 2007 behavior
     701             :                     // MSO 2007 writes false by default and not true
     702           5 :                     mrModel.mbSmooth = rAttribs.getBool( XML_val, true );
     703           5 :                     return 0;
     704             :                 case C_TOKEN( trendline ):
     705           3 :                     return new TrendlineContext( *this, mrModel.maTrendlines.create() );
     706             :                 case C_TOKEN( xVal ):
     707           5 :                     return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::CATEGORIES ) );
     708             :                 case C_TOKEN( yVal ):
     709           5 :                     return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::VALUES ) );
     710             :             }
     711          20 :         break;
     712             :     }
     713          29 :     return SeriesContextBase::onCreateContext( nElement, rAttribs );
     714             : }
     715             : 
     716             : 
     717             : 
     718           0 : SurfaceSeriesContext::SurfaceSeriesContext( ContextHandler2Helper& rParent, SeriesModel& rModel ) :
     719           0 :     SeriesContextBase( rParent, rModel )
     720             : {
     721           0 : }
     722             : 
     723           0 : SurfaceSeriesContext::~SurfaceSeriesContext()
     724             : {
     725           0 : }
     726             : 
     727           0 : ContextHandlerRef SurfaceSeriesContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
     728             : {
     729           0 :     switch( getCurrentElement() )
     730             :     {
     731             :         case C_TOKEN( ser ):
     732           0 :             switch( nElement )
     733             :             {
     734             :                 case C_TOKEN( cat ):
     735           0 :                     return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::CATEGORIES ) );
     736             :                 case C_TOKEN( val ):
     737           0 :                     return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::VALUES ) );
     738             :             }
     739           0 :         break;
     740             :     }
     741           0 :     return SeriesContextBase::onCreateContext( nElement, rAttribs );
     742             : }
     743             : 
     744             : 
     745             : 
     746             : } // namespace chart
     747             : } // namespace drawingml
     748         177 : } // namespace oox
     749             : 
     750             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10