LCOV - code coverage report
Current view: top level - usr/local/src/libreoffice/oox/source/drawingml/chart - seriescontext.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 49 335 14.6 %
Date: 2013-07-09 Functions: 13 71 18.3 %
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           0 : ContextHandlerRef lclDataLabelSharedCreateContext( ContextHandler2& rContext,
      43             :         sal_Int32 nElement, const AttributeList& rAttribs, DataLabelModelBase& orModel )
      44             : {
      45           0 :     if( rContext.isRootElement() ) switch( nElement )
      46             :     {
      47             :         case C_TOKEN( delete ):
      48             :             // default is 'false', not 'true' as specified
      49           0 :             orModel.mbDeleted = rAttribs.getBool( XML_val, false );
      50           0 :             return 0;
      51             :         case C_TOKEN( dLblPos ):
      52           0 :             orModel.monLabelPos = rAttribs.getToken( XML_val, XML_TOKEN_INVALID );
      53           0 :             return 0;
      54             :         case C_TOKEN( numFmt ):
      55           0 :             orModel.maNumberFormat.setAttributes( rAttribs );
      56           0 :             return 0;
      57             :         case C_TOKEN( showBubbleSize ):
      58           0 :             orModel.mobShowBubbleSize = rAttribs.getBool( XML_val );
      59           0 :             return 0;
      60             :         case C_TOKEN( showCatName ):
      61           0 :             orModel.mobShowCatName = rAttribs.getBool( XML_val );
      62           0 :             return 0;
      63             :         case C_TOKEN( showLegendKey ):
      64           0 :             orModel.mobShowLegendKey = rAttribs.getBool( XML_val );
      65           0 :             return 0;
      66             :         case C_TOKEN( showPercent ):
      67           0 :             orModel.mobShowPercent = rAttribs.getBool( XML_val );
      68           0 :             return 0;
      69             :         case C_TOKEN( showSerName ):
      70           0 :             orModel.mobShowSerName = rAttribs.getBool( XML_val );
      71           0 :             return 0;
      72             :         case C_TOKEN( showVal ):
      73           0 :             orModel.mobShowVal = rAttribs.getBool( XML_val );
      74           0 :             return 0;
      75             :         case C_TOKEN( separator ):
      76             :             // collect separator text in onCharacters()
      77           0 :             return &rContext;
      78             :         case C_TOKEN( spPr ):
      79           0 :             return new ShapePropertiesContext( rContext, orModel.mxShapeProp.create() );
      80             :         case C_TOKEN( txPr ):
      81           0 :             return new TextBodyContext( rContext, orModel.mxTextProp.create() );
      82             :     }
      83           0 :     return 0;
      84             : }
      85             : 
      86           0 : void lclDataLabelSharedCharacters( ContextHandler2& rContext, const OUString& rChars, DataLabelModelBase& orModel )
      87             : {
      88           0 :     if( rContext.isCurrentElement( C_TOKEN( separator ) ) )
      89           0 :         orModel.moaSeparator = rChars;
      90           0 : }
      91             : 
      92             : } // namespace
      93             : 
      94             : // ============================================================================
      95             : 
      96           0 : DataLabelContext::DataLabelContext( ContextHandler2Helper& rParent, DataLabelModel& rModel ) :
      97           0 :     ContextBase< DataLabelModel >( rParent, rModel )
      98             : {
      99           0 : }
     100             : 
     101           0 : DataLabelContext::~DataLabelContext()
     102             : {
     103           0 : }
     104             : 
     105           0 : ContextHandlerRef DataLabelContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
     106             : {
     107           0 :     if( isRootElement() ) switch( nElement )
     108             :     {
     109             :         case C_TOKEN( idx ):
     110           0 :             mrModel.mnIndex = rAttribs.getInteger( XML_val, -1 );
     111           0 :             return 0;
     112             :         case C_TOKEN( layout ):
     113           0 :             return new LayoutContext( *this, mrModel.mxLayout.create() );
     114             :         case C_TOKEN( tx ):
     115           0 :             return new TextContext( *this, mrModel.mxText.create() );
     116             :     }
     117           0 :     return lclDataLabelSharedCreateContext( *this, nElement, rAttribs, mrModel );
     118             : }
     119             : 
     120           0 : void DataLabelContext::onCharacters( const OUString& rChars )
     121             : {
     122           0 :     lclDataLabelSharedCharacters( *this, rChars, mrModel );
     123           0 : }
     124             : 
     125             : // ============================================================================
     126             : 
     127           0 : DataLabelsContext::DataLabelsContext( ContextHandler2Helper& rParent, DataLabelsModel& rModel ) :
     128           0 :     ContextBase< DataLabelsModel >( rParent, rModel )
     129             : {
     130           0 : }
     131             : 
     132           0 : DataLabelsContext::~DataLabelsContext()
     133             : {
     134           0 : }
     135             : 
     136           0 : ContextHandlerRef DataLabelsContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
     137             : {
     138           0 :     if( isRootElement() ) switch( nElement )
     139             :     {
     140             :         case C_TOKEN( dLbl ):
     141           0 :             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           0 :             mrModel.mbShowLeaderLines = rAttribs.getBool( XML_val, false );
     147           0 :             return 0;
     148             :     }
     149           0 :     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           0 : TrendlineContext::TrendlineContext( ContextHandler2Helper& rParent, TrendlineModel& rModel ) :
     268           0 :     ContextBase< TrendlineModel >( rParent, rModel )
     269             : {
     270           0 : }
     271             : 
     272           0 : TrendlineContext::~TrendlineContext()
     273             : {
     274           0 : }
     275             : 
     276           0 : ContextHandlerRef TrendlineContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
     277             : {
     278           0 :     if( isRootElement() ) switch( nElement )
     279             :     {
     280             :         case C_TOKEN( backward ):
     281           0 :             mrModel.mfBackward = rAttribs.getDouble( XML_val, 0.0 );
     282           0 :             return 0;
     283             :         case C_TOKEN( dispEq ):
     284             :             // default is 'false', not 'true' as specified
     285           0 :             mrModel.mbDispEquation = rAttribs.getBool( XML_val, false );
     286           0 :             return 0;
     287             :         case C_TOKEN( dispRSqr ):
     288             :             // default is 'false', not 'true' as specified
     289           0 :             mrModel.mbDispRSquared = rAttribs.getBool( XML_val, false );
     290           0 :             return 0;
     291             :         case C_TOKEN( forward ):
     292           0 :             mrModel.mfForward = rAttribs.getDouble( XML_val, 0.0 );
     293           0 :             return 0;
     294             :         case C_TOKEN( intercept ):
     295           0 :             mrModel.mfIntercept = rAttribs.getDouble( XML_val, 0.0 );
     296           0 :             return 0;
     297             :         case C_TOKEN( name ):
     298           0 :             return this;    // collect name in onCharacters()
     299             :         case C_TOKEN( order ):
     300           0 :             mrModel.mnOrder = rAttribs.getInteger( XML_val, 2 );
     301           0 :             return 0;
     302             :         case C_TOKEN( period ):
     303           0 :             mrModel.mnPeriod = rAttribs.getInteger( XML_val, 2 );
     304           0 :             return 0;
     305             :         case C_TOKEN( spPr ):
     306           0 :             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           0 :             mrModel.mnTypeId = rAttribs.getToken( XML_val, XML_linear );
     311           0 :             return 0;
     312             :     }
     313           0 :     return 0;
     314             : }
     315             : 
     316           0 : void TrendlineContext::onCharacters( const OUString& rChars )
     317             : {
     318           0 :     if( isCurrentElement( C_TOKEN( name ) ) )
     319           0 :         mrModel.maName = rChars;
     320           0 : }
     321             : 
     322             : // ============================================================================
     323             : 
     324           0 : DataPointContext::DataPointContext( ContextHandler2Helper& rParent, DataPointModel& rModel ) :
     325           0 :     ContextBase< DataPointModel >( rParent, rModel )
     326             : {
     327           0 : }
     328             : 
     329           0 : DataPointContext::~DataPointContext()
     330             : {
     331           0 : }
     332             : 
     333           0 : ContextHandlerRef DataPointContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
     334             : {
     335           0 :     switch( getCurrentElement() )
     336             :     {
     337             :         case C_TOKEN( dPt ):
     338           0 :             switch( nElement )
     339             :             {
     340             :                 case C_TOKEN( bubble3D ):
     341           0 :                     mrModel.mobBubble3d = rAttribs.getBool( XML_val );
     342           0 :                     return 0;
     343             :                 case C_TOKEN( explosion ):
     344             :                     // if the 'val' attribute is missing, series explosion remains unchanged
     345           0 :                     mrModel.monExplosion = rAttribs.getInteger( XML_val );
     346           0 :                     return 0;
     347             :                 case C_TOKEN( idx ):
     348           0 :                     mrModel.mnIndex = rAttribs.getInteger( XML_val, -1 );
     349           0 :                     return 0;
     350             :                 case C_TOKEN( invertIfNegative ):
     351             :                     // default is 'false', not 'true' as specified (value not derived from series!)
     352           0 :                     mrModel.mbInvertNeg = rAttribs.getBool( XML_val, false );
     353           0 :                     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           0 :                     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           2 : SeriesContextBase::SeriesContextBase( ContextHandler2Helper& rParent, SeriesModel& rModel ) :
     383           2 :     ContextBase< SeriesModel >( rParent, rModel )
     384             : {
     385           2 : }
     386             : 
     387           2 : SeriesContextBase::~SeriesContextBase()
     388             : {
     389           2 : }
     390             : 
     391          10 : ContextHandlerRef SeriesContextBase::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
     392             : {
     393          10 :     switch( getCurrentElement() )
     394             :     {
     395             :         case C_TOKEN( ser ):
     396           8 :             switch( nElement )
     397             :             {
     398             :                 case C_TOKEN( idx ):
     399           2 :                     mrModel.mnIndex = rAttribs.getInteger( XML_val, -1 );
     400           2 :                     return 0;
     401             :                 case C_TOKEN( order ):
     402           2 :                     mrModel.mnOrder = rAttribs.getInteger( XML_val, -1 );
     403           2 :                     return 0;
     404             :                 case C_TOKEN( spPr ):
     405           2 :                     return new ShapePropertiesContext( *this, mrModel.mxShapeProp.create() );
     406             :                 case C_TOKEN( tx ):
     407           2 :                     return new TextContext( *this, mrModel.mxText.create() );
     408             :             }
     409           0 :         break;
     410             : 
     411             :         case C_TOKEN( marker ):
     412           2 :             switch( nElement )
     413             :             {
     414             :                 case C_TOKEN( size ):
     415           2 :                     mrModel.mnMarkerSize = rAttribs.getInteger( XML_val, 5 );
     416           2 :                     return 0;
     417             :                 case C_TOKEN( spPr ):
     418           0 :                     return new ShapePropertiesContext( *this, mrModel.mxMarkerProp.create() );
     419             :                 case C_TOKEN( symbol ):
     420           0 :                     mrModel.mnMarkerSymbol = rAttribs.getToken( XML_val, XML_none );
     421           0 :                     return 0;
     422             :             }
     423           0 :         break;
     424             :     }
     425           0 :     return 0;
     426             : }
     427             : 
     428             : // ============================================================================
     429             : 
     430           0 : AreaSeriesContext::AreaSeriesContext( ContextHandler2Helper& rParent, SeriesModel& rModel ) :
     431           0 :     SeriesContextBase( rParent, rModel )
     432             : {
     433           0 : }
     434             : 
     435           0 : AreaSeriesContext::~AreaSeriesContext()
     436             : {
     437           0 : }
     438             : 
     439           0 : ContextHandlerRef AreaSeriesContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
     440             : {
     441           0 :     switch( getCurrentElement() )
     442             :     {
     443             :         case C_TOKEN( ser ):
     444           0 :             switch( nElement )
     445             :             {
     446             :                 case C_TOKEN( cat ):
     447           0 :                     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           0 :                     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           0 :                     return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::VALUES ) );
     458             :             }
     459           0 :         break;
     460             :     }
     461           0 :     return SeriesContextBase::onCreateContext( nElement, rAttribs );
     462             : }
     463             : 
     464             : // ============================================================================
     465             : 
     466           0 : BarSeriesContext::BarSeriesContext( ContextHandler2Helper& rParent, SeriesModel& rModel ) :
     467           0 :     SeriesContextBase( rParent, rModel )
     468             : {
     469           0 : }
     470             : 
     471           0 : BarSeriesContext::~BarSeriesContext()
     472             : {
     473           0 : }
     474             : 
     475           0 : ContextHandlerRef BarSeriesContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
     476             : {
     477           0 :     switch( getCurrentElement() )
     478             :     {
     479             :         case C_TOKEN( ser ):
     480           0 :             switch( nElement )
     481             :             {
     482             :                 case C_TOKEN( cat ):
     483           0 :                     return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::CATEGORIES ) );
     484             :                 case C_TOKEN( dLbls ):
     485           0 :                     return new DataLabelsContext( *this, mrModel.mxLabels.create() );
     486             :                 case C_TOKEN( dPt ):
     487           0 :                     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           0 :                     mrModel.mbInvertNeg = rAttribs.getBool( XML_val, false );
     493           0 :                     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           0 :                     return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::VALUES ) );
     504             :             }
     505           0 :         break;
     506             :     }
     507           0 :     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           0 : LineSeriesContext::LineSeriesContext( ContextHandler2Helper& rParent, SeriesModel& rModel ) :
     559           0 :     SeriesContextBase( rParent, rModel )
     560             : {
     561           0 : }
     562             : 
     563           0 : LineSeriesContext::~LineSeriesContext()
     564             : {
     565           0 : }
     566             : 
     567           0 : ContextHandlerRef LineSeriesContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
     568             : {
     569           0 :     switch( getCurrentElement() )
     570             :     {
     571             :         case C_TOKEN( ser ):
     572           0 :             switch( nElement )
     573             :             {
     574             :                 case C_TOKEN( cat ):
     575           0 :                     return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::CATEGORIES ) );
     576             :                 case C_TOKEN( dLbls ):
     577           0 :                     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           0 :                     return this;
     584             :                 case C_TOKEN( smooth ):
     585             :                     // default is 'false', not 'true' as specified
     586           0 :                     mrModel.mbSmooth = rAttribs.getBool( XML_val, false );
     587           0 :                     return 0;
     588             :                 case C_TOKEN( trendline ):
     589           0 :                     return new TrendlineContext( *this, mrModel.maTrendlines.create() );
     590             :                 case C_TOKEN( val ):
     591           0 :                     return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::VALUES ) );
     592             :             }
     593           0 :         break;
     594             :     }
     595           0 :     return SeriesContextBase::onCreateContext( nElement, rAttribs );
     596             : }
     597             : 
     598             : // ============================================================================
     599             : 
     600           0 : PieSeriesContext::PieSeriesContext( ContextHandler2Helper& rParent, SeriesModel& rModel ) :
     601           0 :     SeriesContextBase( rParent, rModel )
     602             : {
     603           0 : }
     604             : 
     605           0 : PieSeriesContext::~PieSeriesContext()
     606             : {
     607           0 : }
     608             : 
     609           0 : ContextHandlerRef PieSeriesContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
     610             : {
     611           0 :     switch( getCurrentElement() )
     612             :     {
     613             :         case C_TOKEN( ser ):
     614           0 :             switch( nElement )
     615             :             {
     616             :                 case C_TOKEN( cat ):
     617           0 :                     return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::CATEGORIES ) );
     618             :                 case C_TOKEN( dLbls ):
     619           0 :                     return new DataLabelsContext( *this, mrModel.mxLabels.create() );
     620             :                 case C_TOKEN( dPt ):
     621           0 :                     return new DataPointContext( *this, mrModel.maPoints.create() );
     622             :                 case C_TOKEN( explosion ):
     623           0 :                     mrModel.mnExplosion = rAttribs.getInteger( XML_val, 0 );
     624           0 :                     return 0;
     625             :                 case C_TOKEN( val ):
     626           0 :                     return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::VALUES ) );
     627             :             }
     628           0 :         break;
     629             :     }
     630           0 :     return SeriesContextBase::onCreateContext( nElement, rAttribs );
     631             : }
     632             : 
     633             : // ============================================================================
     634             : 
     635           0 : RadarSeriesContext::RadarSeriesContext( ContextHandler2Helper& rParent, SeriesModel& rModel ) :
     636           0 :     SeriesContextBase( rParent, rModel )
     637             : {
     638           0 : }
     639             : 
     640           0 : RadarSeriesContext::~RadarSeriesContext()
     641             : {
     642           0 : }
     643             : 
     644           0 : ContextHandlerRef RadarSeriesContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
     645             : {
     646           0 :     switch( getCurrentElement() )
     647             :     {
     648             :         case C_TOKEN( ser ):
     649           0 :             switch( nElement )
     650             :             {
     651             :                 case C_TOKEN( cat ):
     652           0 :                     return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::CATEGORIES ) );
     653             :                 case C_TOKEN( dLbls ):
     654           0 :                     return new DataLabelsContext( *this, mrModel.mxLabels.create() );
     655             :                 case C_TOKEN( dPt ):
     656           0 :                     return new DataPointContext( *this, mrModel.maPoints.create() );
     657             :                 case C_TOKEN( marker ):
     658           0 :                     return this;
     659             :                 case C_TOKEN( smooth ):
     660             :                     // default is 'false', not 'true' as specified
     661           0 :                     mrModel.mbSmooth = rAttribs.getBool( XML_val, false );
     662           0 :                     return 0;
     663             :                 case C_TOKEN( val ):
     664           0 :                     return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::VALUES ) );
     665             :             }
     666           0 :         break;
     667             :     }
     668           0 :     return SeriesContextBase::onCreateContext( nElement, rAttribs );
     669             : }
     670             : 
     671             : // ============================================================================
     672             : 
     673           2 : ScatterSeriesContext::ScatterSeriesContext( ContextHandler2Helper& rParent, SeriesModel& rModel ) :
     674           2 :     SeriesContextBase( rParent, rModel )
     675             : {
     676           2 : }
     677             : 
     678           4 : ScatterSeriesContext::~ScatterSeriesContext()
     679             : {
     680           4 : }
     681             : 
     682          17 : ContextHandlerRef ScatterSeriesContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
     683             : {
     684          17 :     switch( getCurrentElement() )
     685             :     {
     686             :         case C_TOKEN( ser ):
     687          15 :             switch( nElement )
     688             :             {
     689             :                 case C_TOKEN( dLbls ):
     690           0 :                     return new DataLabelsContext( *this, mrModel.mxLabels.create() );
     691             :                 case C_TOKEN( dPt ):
     692           0 :                     return new DataPointContext( *this, mrModel.maPoints.create() );
     693             :                 case C_TOKEN( errBars ):
     694           1 :                     return new ErrorBarContext( *this, mrModel.maErrorBars.create() );
     695             :                 case C_TOKEN( marker ):
     696           2 :                     return this;
     697             :                 case C_TOKEN( smooth ):
     698             :                     // default is 'false', not 'true' as specified
     699           0 :                     mrModel.mbSmooth = rAttribs.getBool( XML_val, false );
     700           0 :                     return 0;
     701             :                 case C_TOKEN( trendline ):
     702           0 :                     return new TrendlineContext( *this, mrModel.maTrendlines.create() );
     703             :                 case C_TOKEN( xVal ):
     704           2 :                     return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::CATEGORIES ) );
     705             :                 case C_TOKEN( yVal ):
     706           2 :                     return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::VALUES ) );
     707             :             }
     708           8 :         break;
     709             :     }
     710          10 :     return SeriesContextBase::onCreateContext( nElement, rAttribs );
     711             : }
     712             : 
     713             : // ============================================================================
     714             : 
     715           0 : SurfaceSeriesContext::SurfaceSeriesContext( ContextHandler2Helper& rParent, SeriesModel& rModel ) :
     716           0 :     SeriesContextBase( rParent, rModel )
     717             : {
     718           0 : }
     719             : 
     720           0 : SurfaceSeriesContext::~SurfaceSeriesContext()
     721             : {
     722           0 : }
     723             : 
     724           0 : ContextHandlerRef SurfaceSeriesContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
     725             : {
     726           0 :     switch( getCurrentElement() )
     727             :     {
     728             :         case C_TOKEN( ser ):
     729           0 :             switch( nElement )
     730             :             {
     731             :                 case C_TOKEN( cat ):
     732           0 :                     return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::CATEGORIES ) );
     733             :                 case C_TOKEN( val ):
     734           0 :                     return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::VALUES ) );
     735             :             }
     736           0 :         break;
     737             :     }
     738           0 :     return SeriesContextBase::onCreateContext( nElement, rAttribs );
     739             : }
     740             : 
     741             : // ============================================================================
     742             : 
     743             : } // namespace chart
     744             : } // namespace drawingml
     745         141 : } // namespace oox
     746             : 
     747             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10