LibreOffice Module oox (master) 1
timeanimvaluecontext.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
21
23
25#include <oox/token/namespaces.hxx>
26#include <oox/token/tokens.hxx>
27
28using namespace ::oox::core;
29using namespace ::com::sun::star::uno;
30using namespace ::com::sun::star::xml::sax;
31
32namespace oox::ppt {
33
34 TimeAnimValueListContext::TimeAnimValueListContext( FragmentHandler2 const & rParent,
35 TimeAnimationValueList & aTavList )
36 : FragmentHandler2( rParent )
37 , maTavList( aTavList )
38 , mbInValue( false )
39 {
40 }
41
43 {
44 }
45
47 {
48 if( isCurrentElement( PPT_TOKEN( tav ) ) )
49 {
50 mbInValue = false;
51 }
52 }
53
55 {
56
57 switch ( aElementToken )
58 {
59 case PPT_TOKEN( tav ):
60 {
61 mbInValue = true;
63 val.msFormula = rAttribs.getStringDefaulted( XML_fmla);
64 val.msTime = rAttribs.getStringDefaulted( XML_tm);
65 maTavList.push_back( val );
66 return this;
67 }
68 case PPT_TOKEN( val ):
69 if( mbInValue )
70 {
71 // CT_TLAnimVariant
72 return new AnimVariantContext( *this, aElementToken, maTavList.back().maValue );
73 }
74 break;
75 default:
76 break;
77 }
78
79 return this;
80 }
81
82}
83
84/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Provides access to attribute values of an element.
OUString getStringDefaulted(sal_Int32 nAttrToken) const
Returns the string value of the specified attribute, returns an empty string if attribute not present...
context CT_TLAnimVariant
virtual ::oox::core::ContextHandlerRef onCreateContext(sal_Int32 aElementToken, const AttributeList &rAttribs) override
TimeAnimValueListContext(::oox::core::FragmentHandler2 const &rParent, TimeAnimationValueList &aTavList)
::std::vector< TimeAnimationValue > TimeAnimationValueList
TimeAnimationValueList maTavList