xref: /aoo42x/main/oox/source/ppt/animationtypes.cxx (revision ca5ec200)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 
25 #include "animationtypes.hxx"
26 
27 #include <com/sun/star/animations/Timing.hpp>
28 
29 #include "oox/helper/attributelist.hxx"
30 
31 using namespace ::com::sun::star::uno;
32 using namespace ::com::sun::star::animations;
33 using namespace ::com::sun::star::xml::sax;
34 
35 namespace oox { namespace ppt {
36 
37 // ST_TLTime
GetTime(const::rtl::OUString & val)38 Any GetTime(  const ::rtl::OUString & val )
39 {
40 	Any aDuration;
41 	if( val.compareToAscii( "indefinite" ) == 0 )
42 	{
43 		aDuration <<= Timing_INDEFINITE;
44 	}
45 	else
46 	{
47 		aDuration <<= val.toFloat() / 1000.0;
48 	}
49 	return aDuration;
50 }
51 
52 
53 // ST_TLTimeAnimateValueTime
GetTimeAnimateValueTime(const::rtl::OUString & val)54 Any GetTimeAnimateValueTime( const ::rtl::OUString & val )
55 {
56 	Any aPercent;
57 	if( val.compareToAscii( "indefinite" ) == 0 )
58 	{
59 		aPercent <<= Timing_INDEFINITE;
60 	}
61 	else
62 	{
63 		aPercent <<= val.toFloat() / 100000.0;
64 	}
65 	return aPercent;
66 }
67 
68 } }
69