LCOV - code coverage report
Current view: top level - libreoffice/oox/source/ppt - animvariantcontext.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 1 28 3.6 %
Date: 2012-12-17 Functions: 2 7 28.6 %
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 "animvariantcontext.hxx"
      21             : 
      22             : #include "comphelper/anytostring.hxx"
      23             : #include "cppuhelper/exc_hlp.hxx"
      24             : #include <osl/diagnose.h>
      25             : 
      26             : #include <com/sun/star/uno/Any.hxx>
      27             : #include <rtl/ustring.hxx>
      28             : 
      29             : #include "oox/helper/attributelist.hxx"
      30             : #include "oox/core/fragmenthandler.hxx"
      31             : #include "oox/core/xmlfilterbase.hxx"
      32             : #include "oox/drawingml/colorchoicecontext.hxx"
      33             : #include "pptfilterhelpers.hxx"
      34             : 
      35             : using ::rtl::OUString;
      36             : using namespace ::oox::core;
      37             : using namespace ::com::sun::star::uno;
      38             : using namespace ::com::sun::star::xml::sax;
      39             : 
      40             : namespace oox { namespace ppt {
      41             : 
      42           0 :     AnimVariantContext::AnimVariantContext( FragmentHandler2& rParent, sal_Int32 aElement, Any & aValue )
      43             :         : FragmentHandler2( rParent )
      44             :             , mnElement( aElement )
      45           0 :             , maValue( aValue )
      46             :     {
      47           0 :     }
      48             : 
      49           0 :     AnimVariantContext::~AnimVariantContext( ) throw( )
      50             :     {
      51           0 :     }
      52             : 
      53           0 :     void AnimVariantContext::onEndElement()
      54             :     {
      55           0 :         if( isCurrentElement( mnElement ) && maColor.isUsed() )
      56             :         {
      57           0 :             maValue = makeAny( maColor.getColor( getFilter().getGraphicHelper() ) );
      58             :         }
      59           0 :     }
      60             : 
      61             : 
      62           0 :     ContextHandlerRef AnimVariantContext::onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs )
      63             :     {
      64           0 :         switch( aElementToken )
      65             :         {
      66             :         case PPT_TOKEN( boolVal ):
      67             :         {
      68           0 :             bool val = rAttribs.getBool( XML_val, false );
      69           0 :             maValue = makeAny( val );
      70           0 :             return this;
      71             :         }
      72             :         case PPT_TOKEN( clrVal ):
      73           0 :             return new ::oox::drawingml::ColorContext( *this, maColor );
      74             :             // we'll defer setting the Any until the end.
      75             :         case PPT_TOKEN( fltVal ):
      76             :         {
      77           0 :             double val = rAttribs.getDouble( XML_val, 0.0 );
      78           0 :             maValue = makeAny( val );
      79           0 :             return this;
      80             :         }
      81             :         case PPT_TOKEN( intVal ):
      82             :         {
      83           0 :             sal_Int32 val = rAttribs.getInteger( XML_val, 0 );
      84           0 :             maValue = makeAny( val );
      85           0 :             return this;
      86             :         }
      87             :         case PPT_TOKEN( strVal ):
      88             :         {
      89           0 :             OUString val = rAttribs.getString( XML_val, OUString() );
      90           0 :             convertMeasure( val ); // ignore success or failure if it fails, use as is
      91           0 :             maValue = makeAny( val );
      92           0 :             return this;
      93             :         }
      94             :         default:
      95           0 :             break;
      96             :         }
      97             : 
      98           0 :         return this;
      99             :     }
     100             : 
     101             : 
     102             : 
     103         174 : } }
     104             : 
     105             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10