1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir 
28*cdf0e10cSrcweir #include "commontimenodecontext.hxx"
29*cdf0e10cSrcweir 
30*cdf0e10cSrcweir #include <algorithm>
31*cdf0e10cSrcweir 
32*cdf0e10cSrcweir #include "comphelper/anytostring.hxx"
33*cdf0e10cSrcweir #include "cppuhelper/exc_hlp.hxx"
34*cdf0e10cSrcweir #include <osl/diagnose.h>
35*cdf0e10cSrcweir 
36*cdf0e10cSrcweir #include <com/sun/star/animations/XTimeContainer.hpp>
37*cdf0e10cSrcweir #include <com/sun/star/animations/XAnimationNode.hpp>
38*cdf0e10cSrcweir #include <com/sun/star/animations/AnimationFill.hpp>
39*cdf0e10cSrcweir #include <com/sun/star/animations/AnimationRestart.hpp>
40*cdf0e10cSrcweir #include <com/sun/star/presentation/TextAnimationType.hpp>
41*cdf0e10cSrcweir #include <com/sun/star/presentation/EffectPresetClass.hpp>
42*cdf0e10cSrcweir #include <com/sun/star/presentation/EffectNodeType.hpp>
43*cdf0e10cSrcweir 
44*cdf0e10cSrcweir #include "oox/helper/attributelist.hxx"
45*cdf0e10cSrcweir #include "oox/core/fragmenthandler.hxx"
46*cdf0e10cSrcweir #include "oox/ppt/pptimport.hxx"
47*cdf0e10cSrcweir #include "oox/drawingml/drawingmltypes.hxx"
48*cdf0e10cSrcweir 
49*cdf0e10cSrcweir #include "animationtypes.hxx"
50*cdf0e10cSrcweir 
51*cdf0e10cSrcweir using namespace ::oox::core;
52*cdf0e10cSrcweir using namespace ::com::sun::star::uno;
53*cdf0e10cSrcweir using namespace ::com::sun::star::animations;
54*cdf0e10cSrcweir using namespace ::com::sun::star::presentation;
55*cdf0e10cSrcweir using namespace ::com::sun::star::xml::sax;
56*cdf0e10cSrcweir 
57*cdf0e10cSrcweir 
58*cdf0e10cSrcweir using ::rtl::OUString;
59*cdf0e10cSrcweir using ::com::sun::star::beans::NamedValue;
60*cdf0e10cSrcweir 
61*cdf0e10cSrcweir namespace oox { namespace ppt {
62*cdf0e10cSrcweir 
63*cdf0e10cSrcweir // BEGIN CUT&PASTE from sd/source/filter/ppt/pptanimations.hxx
64*cdf0e10cSrcweir struct convert_subtype
65*cdf0e10cSrcweir {
66*cdf0e10cSrcweir 	sal_Int32 mnID;
67*cdf0e10cSrcweir 	const sal_Char* mpStrSubType;
68*cdf0e10cSrcweir };
69*cdf0e10cSrcweir static const convert_subtype gConvertArray[] =
70*cdf0e10cSrcweir {
71*cdf0e10cSrcweir 	// fly in
72*cdf0e10cSrcweir 	{   1, "from-top" },
73*cdf0e10cSrcweir 	{   2, "from-right" },
74*cdf0e10cSrcweir 	{   3, "from-top-right" },
75*cdf0e10cSrcweir 	{   4, "from-bottom" },
76*cdf0e10cSrcweir 	{   5, "horizontal" },
77*cdf0e10cSrcweir 	{   6, "from-bottom-right" },
78*cdf0e10cSrcweir 	{   8, "from-left" },
79*cdf0e10cSrcweir 	{   9, "from-top-left" },
80*cdf0e10cSrcweir 	{  10, "vertical" },
81*cdf0e10cSrcweir 	{  12, "from-bottom-left" },
82*cdf0e10cSrcweir 	{  16, "in" },
83*cdf0e10cSrcweir 	{  21, "vertical-in" },
84*cdf0e10cSrcweir 	{  26, "horizontal-in" },
85*cdf0e10cSrcweir 	{  32, "out" },
86*cdf0e10cSrcweir 	{  36, "out-from-screen-center" },
87*cdf0e10cSrcweir 	{  37, "vertical-out" },
88*cdf0e10cSrcweir 	{  42, "horizontal-out" },
89*cdf0e10cSrcweir 	{  272, "in-slightly" },
90*cdf0e10cSrcweir 	{  288, "out-slightly" },
91*cdf0e10cSrcweir 	{  528, "in-from-screen-center" },
92*cdf0e10cSrcweir 	{  0, 0 }
93*cdf0e10cSrcweir };
94*cdf0e10cSrcweir 
95*cdf0e10cSrcweir 
96*cdf0e10cSrcweir struct preset_maping
97*cdf0e10cSrcweir {
98*cdf0e10cSrcweir 	sal_Int32	mnPresetClass;
99*cdf0e10cSrcweir 	sal_Int32	mnPresetId;
100*cdf0e10cSrcweir 	const sal_Char*	mpStrPresetId;
101*cdf0e10cSrcweir };
102*cdf0e10cSrcweir 
103*cdf0e10cSrcweir static const preset_maping gPresetMaping[] =
104*cdf0e10cSrcweir {
105*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::ENTRANCE, 1	,"ooo-entrance-appear" },
106*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::ENTRANCE, 2	,"ooo-entrance-fly-in" },
107*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::ENTRANCE, 3	,"ooo-entrance-venetian-blinds" },
108*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::ENTRANCE, 4	,"ooo-entrance-box" },
109*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::ENTRANCE, 5	,"ooo-entrance-checkerboard" },
110*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::ENTRANCE, 6	,"ooo-entrance-circle" },
111*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::ENTRANCE, 7	,"ooo-entrance-fly-in-slow" },
112*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::ENTRANCE, 8	,"ooo-entrance-diamond" },
113*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::ENTRANCE, 9	,"ooo-entrance-dissolve-in" },
114*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::ENTRANCE, 10	,"ooo-entrance-fade-in" },
115*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::ENTRANCE, 11	,"ooo-entrance-flash-once" },
116*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::ENTRANCE, 12	,"ooo-entrance-peek-in" },
117*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::ENTRANCE, 13	,"ooo-entrance-plus" },
118*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::ENTRANCE, 14	,"ooo-entrance-random-bars" },
119*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::ENTRANCE, 15	,"ooo-entrance-spiral-in" },
120*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::ENTRANCE, 16	,"ooo-entrance-split" },
121*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::ENTRANCE, 17	,"ooo-entrance-stretchy" },
122*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::ENTRANCE, 18	,"ooo-entrance-diagonal-squares" },
123*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::ENTRANCE, 19	,"ooo-entrance-swivel" },
124*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::ENTRANCE, 20	,"ooo-entrance-wedge" },
125*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::ENTRANCE, 21	,"ooo-entrance-wheel" },
126*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::ENTRANCE, 22	,"ooo-entrance-wipe" },
127*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::ENTRANCE, 23	,"ooo-entrance-zoom" },
128*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::ENTRANCE, 24	,"ooo-entrance-random" },
129*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::ENTRANCE, 25	,"ooo-entrance-boomerang" },
130*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::ENTRANCE, 26	,"ooo-entrance-bounce" },
131*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::ENTRANCE, 27	,"ooo-entrance-colored-lettering" },
132*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::ENTRANCE, 28	,"ooo-entrance-movie-credits" },
133*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::ENTRANCE, 29	,"ooo-entrance-ease-in" },
134*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::ENTRANCE, 30	,"ooo-entrance-float" },
135*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::ENTRANCE, 31	,"ooo-entrance-turn-and-grow" },
136*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::ENTRANCE, 34	,"ooo-entrance-breaks" },
137*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::ENTRANCE, 35	,"ooo-entrance-pinwheel" },
138*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::ENTRANCE, 37	,"ooo-entrance-rise-up" },
139*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::ENTRANCE, 38	,"ooo-entrance-falling-in" },
140*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::ENTRANCE, 39	,"ooo-entrance-thread" },
141*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::ENTRANCE, 40	,"ooo-entrance-unfold" },
142*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::ENTRANCE, 41	,"ooo-entrance-whip" },
143*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::ENTRANCE, 42	,"ooo-entrance-ascend" },
144*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::ENTRANCE, 43	,"ooo-entrance-center-revolve" },
145*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::ENTRANCE, 45	,"ooo-entrance-fade-in-and-swivel" },
146*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::ENTRANCE, 47	,"ooo-entrance-descend" },
147*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::ENTRANCE, 48	,"ooo-entrance-sling" },
148*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::ENTRANCE, 49	,"ooo-entrance-spin-in" },
149*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::ENTRANCE, 50	,"ooo-entrance-compress" },
150*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::ENTRANCE, 51	,"ooo-entrance-magnify" },
151*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::ENTRANCE, 52	,"ooo-entrance-curve-up" },
152*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::ENTRANCE, 53	,"ooo-entrance-fade-in-and-zoom" },
153*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::ENTRANCE, 54	,"ooo-entrance-glide" },
154*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::ENTRANCE, 55	,"ooo-entrance-expand" },
155*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::ENTRANCE, 56	,"ooo-entrance-flip" },
156*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::ENTRANCE, 58	,"ooo-entrance-fold" },
157*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::EMPHASIS, 1	,"ooo-emphasis-fill-color" },
158*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::EMPHASIS, 2	,"ooo-emphasis-font" },
159*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::EMPHASIS, 3	,"ooo-emphasis-font-color" },
160*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::EMPHASIS, 4	,"ooo-emphasis-font-size" },
161*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::EMPHASIS, 5	,"ooo-emphasis-font-style" },
162*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::EMPHASIS, 6	,"ooo-emphasis-grow-and-shrink" },
163*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::EMPHASIS, 7	,"ooo-emphasis-line-color" },
164*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::EMPHASIS, 8	,"ooo-emphasis-spin" },
165*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::EMPHASIS, 9	,"ooo-emphasis-transparency" },
166*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::EMPHASIS, 10	,"ooo-emphasis-bold-flash" },
167*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::EMPHASIS, 14	,"ooo-emphasis-blast" },
168*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::EMPHASIS, 15	,"ooo-emphasis-bold-reveal" },
169*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::EMPHASIS, 16	,"ooo-emphasis-color-over-by-word" },
170*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::EMPHASIS, 18	,"ooo-emphasis-reveal-underline" },
171*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::EMPHASIS, 19	,"ooo-emphasis-color-blend" },
172*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::EMPHASIS, 20	,"ooo-emphasis-color-over-by-letter" },
173*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::EMPHASIS, 21	,"ooo-emphasis-complementary-color" },
174*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::EMPHASIS, 22	,"ooo-emphasis-complementary-color-2" },
175*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::EMPHASIS, 23	,"ooo-emphasis-contrasting-color" },
176*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::EMPHASIS, 24	,"ooo-emphasis-darken" },
177*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::EMPHASIS, 25	,"ooo-emphasis-desaturate" },
178*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::EMPHASIS, 26	,"ooo-emphasis-flash-bulb" },
179*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::EMPHASIS, 27	,"ooo-emphasis-flicker" },
180*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::EMPHASIS, 28	,"ooo-emphasis-grow-with-color" },
181*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::EMPHASIS, 30	,"ooo-emphasis-lighten" },
182*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::EMPHASIS, 31	,"ooo-emphasis-style-emphasis" },
183*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::EMPHASIS, 32	,"ooo-emphasis-teeter" },
184*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::EMPHASIS, 33	,"ooo-emphasis-vertical-highlight" },
185*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::EMPHASIS, 34	,"ooo-emphasis-wave" },
186*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::EMPHASIS, 35	,"ooo-emphasis-blink" },
187*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::EMPHASIS, 36	,"ooo-emphasis-shimmer" },
188*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::EXIT, 1		,"ooo-exit-disappear" },
189*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::EXIT, 2		,"ooo-exit-fly-out" },
190*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::EXIT, 3		,"ooo-exit-venetian-blinds" },
191*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::EXIT, 4		,"ooo-exit-box" },
192*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::EXIT, 5		,"ooo-exit-checkerboard" },
193*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::EXIT, 6		,"ooo-exit-circle" },
194*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::EXIT, 7		,"ooo-exit-crawl-out" },
195*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::EXIT, 8		,"ooo-exit-diamond" },
196*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::EXIT, 9		,"ooo-exit-dissolve" },
197*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::EXIT, 10		,"ooo-exit-fade-out" },
198*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::EXIT, 11		,"ooo-exit-flash-once" },
199*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::EXIT, 12		,"ooo-exit-peek-out" },
200*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::EXIT, 13		,"ooo-exit-plus" },
201*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::EXIT, 14		,"ooo-exit-random-bars" },
202*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::EXIT, 15		,"ooo-exit-spiral-out" },
203*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::EXIT, 16		,"ooo-exit-split" },
204*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::EXIT, 17		,"ooo-exit-collapse" },
205*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::EXIT, 18		,"ooo-exit-diagonal-squares" },
206*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::EXIT, 19		,"ooo-exit-swivel" },
207*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::EXIT, 20		,"ooo-exit-wedge" },
208*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::EXIT, 21		,"ooo-exit-wheel" },
209*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::EXIT, 22		,"ooo-exit-wipe" },
210*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::EXIT, 23		,"ooo-exit-zoom" },
211*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::EXIT, 24		,"ooo-exit-random" },
212*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::EXIT, 25		,"ooo-exit-boomerang" },
213*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::EXIT, 26		,"ooo-exit-bounce" },
214*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::EXIT, 27		,"ooo-exit-colored-lettering" },
215*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::EXIT, 28		,"ooo-exit-movie-credits" },
216*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::EXIT, 29		,"ooo-exit-ease-out" },
217*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::EXIT, 30		,"ooo-exit-float" },
218*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::EXIT, 31		,"ooo-exit-turn-and-grow" },
219*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::EXIT, 34		,"ooo-exit-breaks" },
220*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::EXIT, 35		,"ooo-exit-pinwheel" },
221*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::EXIT, 37		,"ooo-exit-sink-down" },
222*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::EXIT, 38		,"ooo-exit-swish" },
223*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::EXIT, 39		,"ooo-exit-thread" },
224*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::EXIT, 40		,"ooo-exit-unfold" },
225*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::EXIT, 41		,"ooo-exit-whip" },
226*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::EXIT, 42		,"ooo-exit-descend" },
227*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::EXIT, 43		,"ooo-exit-center-revolve" },
228*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::EXIT, 45		,"ooo-exit-fade-out-and-swivel" },
229*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::EXIT, 47		,"ooo-exit-ascend" },
230*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::EXIT, 48		,"ooo-exit-sling" },
231*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::EXIT, 53		,"ooo-exit-fade-out-and-zoom" },
232*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::EXIT, 55		,"ooo-exit-contract" },
233*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::EXIT, 49		,"ooo-exit-spin-out" },
234*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::EXIT, 50		,"ooo-exit-stretchy" },
235*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::EXIT, 51		,"ooo-exit-magnify" },
236*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::EXIT, 52		,"ooo-exit-curve-down" },
237*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::EXIT, 54		,"ooo-exit-glide" },
238*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::EXIT, 56		,"ooo-exit-flip" },
239*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::EXIT, 58		,"ooo-exit-fold" },
240*cdf0e10cSrcweir 
241*cdf0e10cSrcweir 
242*cdf0e10cSrcweir 
243*cdf0e10cSrcweir 
244*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::MOTIONPATH, 16		,"ooo-motionpath-4-point-star" },
245*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::MOTIONPATH, 5		,"ooo-motionpath-5-point-star" },
246*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::MOTIONPATH, 11		,"ooo-motionpath-6-point-star" },
247*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::MOTIONPATH, 17		,"ooo-motionpath-8-point-star" },
248*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::MOTIONPATH, 1		,"ooo-motionpath-circle" },
249*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::MOTIONPATH, 6		,"ooo-motionpath-crescent-moon" },
250*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::MOTIONPATH, 3		,"ooo-motionpath-diamond" },
251*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::MOTIONPATH, 13		,"ooo-motionpath-equal-triangle" },
252*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::MOTIONPATH, 12		,"ooo-motionpath-oval" },
253*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::MOTIONPATH, 9		,"ooo-motionpath-heart" },
254*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::MOTIONPATH, 4		,"ooo-motionpath-hexagon" },
255*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::MOTIONPATH, 10		,"ooo-motionpath-octagon" },
256*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::MOTIONPATH, 14		,"ooo-motionpath-parallelogram" },
257*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::MOTIONPATH, 15		,"ooo-motionpath-pentagon" },
258*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::MOTIONPATH, 2		,"ooo-motionpath-right-triangle" },
259*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::MOTIONPATH, 7		,"ooo-motionpath-square" },
260*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::MOTIONPATH, 18		,"ooo-motionpath-teardrop" },
261*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::MOTIONPATH, 8		,"ooo-motionpath-trapezoid" },
262*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::MOTIONPATH, 37		,"ooo-motionpath-arc-down" },
263*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::MOTIONPATH, 51		,"ooo-motionpath-arc-left" },
264*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::MOTIONPATH, 58		,"ooo-motionpath-arc-right" },
265*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::MOTIONPATH, 44		,"ooo-motionpath-arc-up" },
266*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::MOTIONPATH, 41		,"ooo-motionpath-bounce-left" },
267*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::MOTIONPATH, 54		,"ooo-motionpath-bounce-right" },
268*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::MOTIONPATH, 48		,"ooo-motionpath-curvy-left" },
269*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::MOTIONPATH, 61		,"ooo-motionpath-curvy-right" },
270*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::MOTIONPATH, 60		,"ooo-motionpath-decaying-wave" },
271*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::MOTIONPATH, 49		,"ooo-motionpath-diagonal-down-right" },
272*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::MOTIONPATH, 56		,"ooo-motionpath-diagonal-up-right" },
273*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::MOTIONPATH, 42		,"ooo-motionpath-down" },
274*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::MOTIONPATH, 52		,"ooo-motionpath-funnel" },
275*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::MOTIONPATH, 53		,"ooo-motionpath-spring" },
276*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::MOTIONPATH, 62		,"ooo-motionpath-stairs-down" },
277*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::MOTIONPATH, 50		,"ooo-motionpath-turn-down" },
278*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::MOTIONPATH, 36		,"ooo-motionpath-turn-down-right" },
279*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::MOTIONPATH, 43		,"ooo-motionpath-turn-up" },
280*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::MOTIONPATH, 57		,"ooo-motionpath-turn-up-right" },
281*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::MOTIONPATH, 64		,"ooo-motionpath-up" },
282*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::MOTIONPATH, 47		,"ooo-motionpath-wave" },
283*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::MOTIONPATH, 38		,"ooo-motionpath-zigzag" },
284*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::MOTIONPATH, 31		,"ooo-motionpath-bean" },
285*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::MOTIONPATH, 25		,"ooo-motionpath-buzz-saw" },
286*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::MOTIONPATH, 20		,"ooo-motionpath-curved-square" },
287*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::MOTIONPATH, 21		,"ooo-motionpath-curved-x" },
288*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::MOTIONPATH, 23		,"ooo-motionpath-curvy-star" },
289*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::MOTIONPATH, 28		,"ooo-motionpath-figure-8-four" },
290*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::MOTIONPATH, 26		,"ooo-motionpath-horizontal-figure-8" },
291*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::MOTIONPATH, 34		,"ooo-motionpath-inverted-square" },
292*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::MOTIONPATH, 33		,"ooo-motionpath-inverted-triangle" },
293*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::MOTIONPATH, 24		,"ooo-motionpath-loop-de-loop" },
294*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::MOTIONPATH, 29		,"ooo-motionpath-neutron" },
295*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::MOTIONPATH, 27		,"ooo-motionpath-peanut" },
296*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::MOTIONPATH, 32		,"ooo-motionpath-clover" },
297*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::MOTIONPATH, 19		,"ooo-motionpath-pointy-star" },
298*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::MOTIONPATH, 30		,"ooo-motionpath-swoosh" },
299*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::MOTIONPATH, 22		,"ooo-motionpath-vertical-figure-8" },
300*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::MOTIONPATH, 35		,"ooo-motionpath-left" },
301*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::MOTIONPATH, 63		,"ooo-motionpath-right" },
302*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::MOTIONPATH, 55		,"ooo-motionpath-spiral-left" },
303*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::MOTIONPATH, 46		,"ooo-motionpath-spiral-right" },
304*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::MOTIONPATH, 40		,"ooo-motionpath-sine-wave" },
305*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::MOTIONPATH, 59		,"ooo-motionpath-s-curve-1" },
306*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::MOTIONPATH, 39		,"ooo-motionpath-s-curve-2" },
307*cdf0e10cSrcweir 	{ ::com::sun::star::presentation::EffectPresetClass::MOTIONPATH, 45		,"ooo-motionpath-heartbeat" },
308*cdf0e10cSrcweir 
309*cdf0e10cSrcweir 
310*cdf0e10cSrcweir 	{ 0,0,0 }
311*cdf0e10cSrcweir };
312*cdf0e10cSrcweir 
313*cdf0e10cSrcweir // from sd/source/filter/ppt/pptinanimations.cxx
314*cdf0e10cSrcweir static OUString getConvertedSubType( sal_Int16 nPresetClass, sal_Int32 nPresetId, sal_Int32 nPresetSubType )
315*cdf0e10cSrcweir {
316*cdf0e10cSrcweir 	const sal_Char* pStr = 0;
317*cdf0e10cSrcweir 
318*cdf0e10cSrcweir 	if( (nPresetClass == EffectPresetClass::ENTRANCE) || (nPresetClass == EffectPresetClass::EXIT) )
319*cdf0e10cSrcweir 	{
320*cdf0e10cSrcweir 		// skip wheel effect
321*cdf0e10cSrcweir 		if( nPresetId != 21 )
322*cdf0e10cSrcweir 		{
323*cdf0e10cSrcweir 			if( nPresetId == 5 )
324*cdf0e10cSrcweir 			{
325*cdf0e10cSrcweir 				// checkerboard
326*cdf0e10cSrcweir 				switch( nPresetSubType )
327*cdf0e10cSrcweir 				{
328*cdf0e10cSrcweir 				case  5: pStr = "downward"; break;
329*cdf0e10cSrcweir 				case 10: pStr = "across"; break;
330*cdf0e10cSrcweir 				}
331*cdf0e10cSrcweir 			}
332*cdf0e10cSrcweir 			else if( nPresetId == 17 )
333*cdf0e10cSrcweir 			{
334*cdf0e10cSrcweir 				// stretch
335*cdf0e10cSrcweir 				if( nPresetSubType == 10 )
336*cdf0e10cSrcweir 					pStr = "across";
337*cdf0e10cSrcweir 			}
338*cdf0e10cSrcweir 			else if( nPresetId == 18 )
339*cdf0e10cSrcweir 			{
340*cdf0e10cSrcweir 				// strips
341*cdf0e10cSrcweir 				switch( nPresetSubType )
342*cdf0e10cSrcweir 				{
343*cdf0e10cSrcweir 				case 3:	pStr = "right-to-top"; break;
344*cdf0e10cSrcweir 				case 6: pStr = "right-to-bottom"; break;
345*cdf0e10cSrcweir 				case 9: pStr = "left-to-top"; break;
346*cdf0e10cSrcweir 				case 12: pStr = "left-to-bottom"; break;
347*cdf0e10cSrcweir 				}
348*cdf0e10cSrcweir 			}
349*cdf0e10cSrcweir 
350*cdf0e10cSrcweir 			if( pStr == 0 )
351*cdf0e10cSrcweir 			{
352*cdf0e10cSrcweir 				const convert_subtype* p = gConvertArray;
353*cdf0e10cSrcweir 
354*cdf0e10cSrcweir 				while( p->mpStrSubType )
355*cdf0e10cSrcweir 				{
356*cdf0e10cSrcweir 					if( p->mnID == nPresetSubType )
357*cdf0e10cSrcweir 					{
358*cdf0e10cSrcweir 						pStr = p->mpStrSubType;
359*cdf0e10cSrcweir 						break;
360*cdf0e10cSrcweir 					}
361*cdf0e10cSrcweir 					p++;
362*cdf0e10cSrcweir 				}
363*cdf0e10cSrcweir 			}
364*cdf0e10cSrcweir 		}
365*cdf0e10cSrcweir 	}
366*cdf0e10cSrcweir 
367*cdf0e10cSrcweir 	if( pStr )
368*cdf0e10cSrcweir 		return OUString::createFromAscii( pStr );
369*cdf0e10cSrcweir 	else
370*cdf0e10cSrcweir 		return OUString::valueOf( nPresetSubType );
371*cdf0e10cSrcweir }
372*cdf0e10cSrcweir 
373*cdf0e10cSrcweir // END
374*cdf0e10cSrcweir 
375*cdf0e10cSrcweir     CommonTimeNodeContext::CommonTimeNodeContext(
376*cdf0e10cSrcweir             ContextHandler& rParent,
377*cdf0e10cSrcweir             sal_Int32  aElement,
378*cdf0e10cSrcweir             const Reference< XFastAttributeList >& xAttribs,
379*cdf0e10cSrcweir             const TimeNodePtr & pNode )
380*cdf0e10cSrcweir         : TimeNodeContext( rParent, aElement, xAttribs, pNode )
381*cdf0e10cSrcweir 			, mbIterate( false )
382*cdf0e10cSrcweir 	{
383*cdf0e10cSrcweir 		AttributeList attribs( xAttribs );
384*cdf0e10cSrcweir 		sal_Int32 nInt; // some temporary int value for float conversions
385*cdf0e10cSrcweir 
386*cdf0e10cSrcweir 		NodePropertyMap & aProps = pNode->getNodeProperties();
387*cdf0e10cSrcweir         TimeNode::UserDataMap & aUserData = pNode->getUserData();
388*cdf0e10cSrcweir 
389*cdf0e10cSrcweir 		if( attribs.hasAttribute( XML_accel ) )
390*cdf0e10cSrcweir 		{
391*cdf0e10cSrcweir 			double dPercent = ::oox::drawingml::GetPositiveFixedPercentage( xAttribs->getOptionalValue( XML_accel ) );
392*cdf0e10cSrcweir 			aProps[ NP_ACCELERATION ] <<= dPercent;
393*cdf0e10cSrcweir 		}
394*cdf0e10cSrcweir 
395*cdf0e10cSrcweir 		if( attribs.hasAttribute( XML_afterEffect ) )
396*cdf0e10cSrcweir 		{
397*cdf0e10cSrcweir 			aUserData[ CREATE_OUSTRING( "after-effect" ) ]
398*cdf0e10cSrcweir 				= makeAny( attribs.getBool( XML_afterEffect, false ) );
399*cdf0e10cSrcweir 		}
400*cdf0e10cSrcweir 		aProps[ NP_AUTOREVERSE ] = makeAny( attribs.getBool( XML_autoRev, false ) );
401*cdf0e10cSrcweir 
402*cdf0e10cSrcweir 		// TODO
403*cdf0e10cSrcweir 		if( attribs.hasAttribute( XML_bldLvl ) )
404*cdf0e10cSrcweir 		{
405*cdf0e10cSrcweir 			attribs.getInteger( XML_bldLvl, 0 );
406*cdf0e10cSrcweir 		}
407*cdf0e10cSrcweir 		if( attribs.hasAttribute( XML_decel ) )
408*cdf0e10cSrcweir 		{
409*cdf0e10cSrcweir 			double dPercent = ::oox::drawingml::GetPositiveFixedPercentage( xAttribs->getOptionalValue( XML_decel ) );
410*cdf0e10cSrcweir 			aProps[ NP_DECELERATE ] <<= dPercent;
411*cdf0e10cSrcweir 		}
412*cdf0e10cSrcweir 		// TODO
413*cdf0e10cSrcweir 		if( attribs.hasAttribute( XML_display ) )
414*cdf0e10cSrcweir 		{
415*cdf0e10cSrcweir 			aProps[ NP_DISPLAY ] <<= attribs.getBool( XML_display, true );
416*cdf0e10cSrcweir 		}
417*cdf0e10cSrcweir 		if( attribs.hasAttribute( XML_dur ) )
418*cdf0e10cSrcweir 		{
419*cdf0e10cSrcweir 			aProps[ NP_DURATION ] = GetTime( xAttribs->getOptionalValue( XML_dur) );
420*cdf0e10cSrcweir 		}
421*cdf0e10cSrcweir 		// TODO
422*cdf0e10cSrcweir 		if( attribs.hasAttribute( XML_evtFilter ) )
423*cdf0e10cSrcweir 		{
424*cdf0e10cSrcweir 			xAttribs->getOptionalValue( XML_evtFilter );
425*cdf0e10cSrcweir 		}
426*cdf0e10cSrcweir 		// ST_TLTimeNodeFillType
427*cdf0e10cSrcweir 		if( attribs.hasAttribute( XML_fill ) )
428*cdf0e10cSrcweir 		{
429*cdf0e10cSrcweir 			nInt = xAttribs->getOptionalValueToken( XML_fill, 0 );
430*cdf0e10cSrcweir 			if( nInt != 0 )
431*cdf0e10cSrcweir 			{
432*cdf0e10cSrcweir 				sal_Int16 nEnum;
433*cdf0e10cSrcweir 				switch( nInt )
434*cdf0e10cSrcweir 				{
435*cdf0e10cSrcweir 				case XML_remove:
436*cdf0e10cSrcweir 					nEnum = AnimationFill::REMOVE;
437*cdf0e10cSrcweir 					break;
438*cdf0e10cSrcweir 				case XML_freeze:
439*cdf0e10cSrcweir 					nEnum = AnimationFill::FREEZE;
440*cdf0e10cSrcweir 					break;
441*cdf0e10cSrcweir 				case XML_hold:
442*cdf0e10cSrcweir 					nEnum = AnimationFill::HOLD;
443*cdf0e10cSrcweir 					break;
444*cdf0e10cSrcweir 				case XML_transition:
445*cdf0e10cSrcweir 					nEnum = AnimationFill::TRANSITION;
446*cdf0e10cSrcweir 					break;
447*cdf0e10cSrcweir 				default:
448*cdf0e10cSrcweir 					nEnum = AnimationFill::DEFAULT;
449*cdf0e10cSrcweir 					break;
450*cdf0e10cSrcweir 				}
451*cdf0e10cSrcweir 				aProps[ NP_FILL ] <<=  (sal_Int16)nEnum;
452*cdf0e10cSrcweir 			}
453*cdf0e10cSrcweir 		}
454*cdf0e10cSrcweir 		if( attribs.hasAttribute( XML_grpId ) )
455*cdf0e10cSrcweir 		{
456*cdf0e10cSrcweir             attribs.getUnsigned( XML_grpId, 0 );
457*cdf0e10cSrcweir 		}
458*cdf0e10cSrcweir 		// ST_TLTimeNodeID
459*cdf0e10cSrcweir 		if( attribs.hasAttribute( XML_id ) )
460*cdf0e10cSrcweir 		{
461*cdf0e10cSrcweir             sal_uInt32 nId = attribs.getUnsigned( XML_id, 0 );
462*cdf0e10cSrcweir 			pNode->setId( nId );
463*cdf0e10cSrcweir 		}
464*cdf0e10cSrcweir 		// ST_TLTimeNodeMasterRelation
465*cdf0e10cSrcweir 		nInt = xAttribs->getOptionalValueToken( XML_masterRel, 0 );
466*cdf0e10cSrcweir 		if( nInt )
467*cdf0e10cSrcweir 		{
468*cdf0e10cSrcweir 			// TODO
469*cdf0e10cSrcweir 			switch(nInt)
470*cdf0e10cSrcweir 			{
471*cdf0e10cSrcweir 			case XML_sameClick:
472*cdf0e10cSrcweir 			case XML_lastClick:
473*cdf0e10cSrcweir 			case XML_nextClick:
474*cdf0e10cSrcweir 				break;
475*cdf0e10cSrcweir 			}
476*cdf0e10cSrcweir 		}
477*cdf0e10cSrcweir 
478*cdf0e10cSrcweir 		// TODO
479*cdf0e10cSrcweir 		if( attribs.hasAttribute( XML_nodePh ) )
480*cdf0e10cSrcweir 		{
481*cdf0e10cSrcweir 			attribs.getBool( XML_nodePh, false );
482*cdf0e10cSrcweir 		}
483*cdf0e10cSrcweir 		// ST_TLTimeNodeType
484*cdf0e10cSrcweir 		nInt = xAttribs->getOptionalValueToken( XML_nodeType, 0 );
485*cdf0e10cSrcweir 		if( nInt != 0 )
486*cdf0e10cSrcweir 		{
487*cdf0e10cSrcweir 			sal_Int16 nEnum;
488*cdf0e10cSrcweir 			switch( nInt )
489*cdf0e10cSrcweir 			{
490*cdf0e10cSrcweir 			case XML_clickEffect:
491*cdf0e10cSrcweir 			case XML_clickPar:
492*cdf0e10cSrcweir 				nEnum = EffectNodeType::ON_CLICK;
493*cdf0e10cSrcweir 				break;
494*cdf0e10cSrcweir 			case XML_withEffect:
495*cdf0e10cSrcweir 			case XML_withGroup:
496*cdf0e10cSrcweir 				nEnum = EffectNodeType::WITH_PREVIOUS;
497*cdf0e10cSrcweir 				break;
498*cdf0e10cSrcweir 			case XML_mainSeq:
499*cdf0e10cSrcweir 				nEnum = EffectNodeType::MAIN_SEQUENCE;
500*cdf0e10cSrcweir 				break;
501*cdf0e10cSrcweir 			case XML_interactiveSeq:
502*cdf0e10cSrcweir 				nEnum = EffectNodeType::INTERACTIVE_SEQUENCE;
503*cdf0e10cSrcweir 				break;
504*cdf0e10cSrcweir 			case XML_afterGroup:
505*cdf0e10cSrcweir 			case XML_afterEffect:
506*cdf0e10cSrcweir 				nEnum = EffectNodeType::AFTER_PREVIOUS;
507*cdf0e10cSrcweir 				break;
508*cdf0e10cSrcweir 			case XML_tmRoot:
509*cdf0e10cSrcweir 				nEnum = EffectNodeType::TIMING_ROOT;
510*cdf0e10cSrcweir 				break;
511*cdf0e10cSrcweir 			default:
512*cdf0e10cSrcweir 				nEnum = EffectNodeType::DEFAULT;
513*cdf0e10cSrcweir 				break;
514*cdf0e10cSrcweir 			}
515*cdf0e10cSrcweir 			aUserData[ CREATE_OUSTRING( "node-type" ) ] <<= nEnum;
516*cdf0e10cSrcweir 		}
517*cdf0e10cSrcweir 
518*cdf0e10cSrcweir 		// ST_TLTimeNodePresetClassType
519*cdf0e10cSrcweir 		nInt = xAttribs->getOptionalValueToken( XML_presetClass, 0 );
520*cdf0e10cSrcweir 		sal_Int16 nEffectPresetClass = 0;
521*cdf0e10cSrcweir 		sal_Int32 nPresetId = 0;
522*cdf0e10cSrcweir 		sal_Int32 nPresetSubType = 0;
523*cdf0e10cSrcweir 		if( nInt != 0 )
524*cdf0e10cSrcweir 		{
525*cdf0e10cSrcweir 			// TODO put that in a function
526*cdf0e10cSrcweir 			switch( nInt )
527*cdf0e10cSrcweir 			{
528*cdf0e10cSrcweir 			case XML_entr:
529*cdf0e10cSrcweir 				nEffectPresetClass = EffectPresetClass::ENTRANCE;
530*cdf0e10cSrcweir 				break;
531*cdf0e10cSrcweir 			case XML_exit:
532*cdf0e10cSrcweir 				nEffectPresetClass = EffectPresetClass::EXIT;
533*cdf0e10cSrcweir 				break;
534*cdf0e10cSrcweir 			case XML_emph:
535*cdf0e10cSrcweir 				nEffectPresetClass = EffectPresetClass::EMPHASIS;
536*cdf0e10cSrcweir 				break;
537*cdf0e10cSrcweir 			case XML_path:
538*cdf0e10cSrcweir 				nEffectPresetClass = EffectPresetClass::MOTIONPATH;
539*cdf0e10cSrcweir 				break;
540*cdf0e10cSrcweir 			case XML_verb:
541*cdf0e10cSrcweir 				// TODO check that the value below is correct
542*cdf0e10cSrcweir 				nEffectPresetClass = EffectPresetClass::OLEACTION;
543*cdf0e10cSrcweir 				break;
544*cdf0e10cSrcweir 			case XML_mediacall:
545*cdf0e10cSrcweir 				nEffectPresetClass = EffectPresetClass::MEDIACALL;
546*cdf0e10cSrcweir 				break;
547*cdf0e10cSrcweir 			default:
548*cdf0e10cSrcweir 				nEffectPresetClass = 0;
549*cdf0e10cSrcweir 				break;
550*cdf0e10cSrcweir 			}
551*cdf0e10cSrcweir 			aUserData[ CREATE_OUSTRING( "preset-class" ) ] = makeAny( nEffectPresetClass );
552*cdf0e10cSrcweir 			if( attribs.hasAttribute( XML_presetID ) )
553*cdf0e10cSrcweir 			{
554*cdf0e10cSrcweir 				nPresetId = attribs.getInteger( XML_presetID, 0 );
555*cdf0e10cSrcweir 				const preset_maping* p = gPresetMaping;
556*cdf0e10cSrcweir 				while( p->mpStrPresetId && ((p->mnPresetClass != nEffectPresetClass) || (p->mnPresetId != nPresetId )) )
557*cdf0e10cSrcweir 					p++;
558*cdf0e10cSrcweir 
559*cdf0e10cSrcweir 				aUserData[ CREATE_OUSTRING( "preset-id" ) ]
560*cdf0e10cSrcweir 					= makeAny( OUString::createFromAscii( p->mpStrPresetId ) );
561*cdf0e10cSrcweir 				nPresetSubType = attribs.getInteger( XML_presetSubtype, 0 );
562*cdf0e10cSrcweir 				if( nPresetSubType )
563*cdf0e10cSrcweir 				{
564*cdf0e10cSrcweir 					aUserData[ CREATE_OUSTRING( "preset-sub-type" ) ]
565*cdf0e10cSrcweir 						= makeAny( getConvertedSubType( nEffectPresetClass, nPresetId, nPresetSubType ) );
566*cdf0e10cSrcweir 				}
567*cdf0e10cSrcweir 			}
568*cdf0e10cSrcweir 		}
569*cdf0e10cSrcweir 		if( attribs.hasAttribute( XML_repeatCount ) )
570*cdf0e10cSrcweir 		{
571*cdf0e10cSrcweir 			aProps[ NP_REPEATCOUNT ] = GetTime( xAttribs->getOptionalValue( XML_repeatCount ) );
572*cdf0e10cSrcweir 		}
573*cdf0e10cSrcweir 		/* see pptinanimation */
574*cdf0e10cSrcweir //			aProps[ NP_REPEATCOUNT ] <<= (fCount < ((float)3.40282346638528860e+38)) ? makeAny( (double)fCount ) : makeAny( Timing_INDEFINITE );
575*cdf0e10cSrcweir 		if( attribs.hasAttribute( XML_repeatDur ) )
576*cdf0e10cSrcweir 		{
577*cdf0e10cSrcweir 			aProps[ NP_REPEATDURATION ] = GetTime( xAttribs->getOptionalValue( XML_repeatDur ) );
578*cdf0e10cSrcweir 		}
579*cdf0e10cSrcweir 		// TODO repeatDur is otherwise the same as dur. What shall we do? -- Hub
580*cdf0e10cSrcweir 
581*cdf0e10cSrcweir 		// ST_TLTimeNodeRestartType
582*cdf0e10cSrcweir 		nInt = xAttribs->getOptionalValueToken( XML_restart, 0 );
583*cdf0e10cSrcweir 		if( nInt != 0 )
584*cdf0e10cSrcweir 		{
585*cdf0e10cSrcweir 			// TODO put that in a function
586*cdf0e10cSrcweir 			sal_Int16 nEnum;
587*cdf0e10cSrcweir 			switch( nInt )
588*cdf0e10cSrcweir 			{
589*cdf0e10cSrcweir 			case XML_always:
590*cdf0e10cSrcweir 				nEnum = AnimationRestart::ALWAYS;
591*cdf0e10cSrcweir 				break;
592*cdf0e10cSrcweir 			case XML_whenNotActive:
593*cdf0e10cSrcweir 				nEnum = AnimationRestart::WHEN_NOT_ACTIVE;
594*cdf0e10cSrcweir 				break;
595*cdf0e10cSrcweir 			case XML_never:
596*cdf0e10cSrcweir 				nEnum = AnimationRestart::NEVER;
597*cdf0e10cSrcweir 				break;
598*cdf0e10cSrcweir 			default:
599*cdf0e10cSrcweir 				nEnum =	AnimationRestart::DEFAULT;
600*cdf0e10cSrcweir 				break;
601*cdf0e10cSrcweir 			}
602*cdf0e10cSrcweir 			aProps[ NP_RESTART ] <<= (sal_Int16)nEnum;
603*cdf0e10cSrcweir 		}
604*cdf0e10cSrcweir 		// ST_Percentage TODO
605*cdf0e10cSrcweir 		xAttribs->getOptionalValue( XML_spd /*"10000" */ );
606*cdf0e10cSrcweir 		// ST_TLTimeNodeSyncType TODO
607*cdf0e10cSrcweir 		xAttribs->getOptionalValue( XML_syncBehavior );
608*cdf0e10cSrcweir 		// TODO (string)
609*cdf0e10cSrcweir 		xAttribs->getOptionalValue( XML_tmFilter );
610*cdf0e10cSrcweir 	}
611*cdf0e10cSrcweir 
612*cdf0e10cSrcweir 
613*cdf0e10cSrcweir 	CommonTimeNodeContext::~CommonTimeNodeContext( ) throw ( )
614*cdf0e10cSrcweir 	{
615*cdf0e10cSrcweir 	}
616*cdf0e10cSrcweir 
617*cdf0e10cSrcweir 
618*cdf0e10cSrcweir 	void SAL_CALL CommonTimeNodeContext::endFastElement( sal_Int32 aElement ) throw ( SAXException, RuntimeException)
619*cdf0e10cSrcweir 	{
620*cdf0e10cSrcweir 		if( aElement == ( PPT_TOKEN( iterate ) ) )
621*cdf0e10cSrcweir 		{
622*cdf0e10cSrcweir 			mbIterate = false;
623*cdf0e10cSrcweir 		}
624*cdf0e10cSrcweir 	}
625*cdf0e10cSrcweir 
626*cdf0e10cSrcweir 
627*cdf0e10cSrcweir 	Reference< XFastContextHandler > SAL_CALL CommonTimeNodeContext::createFastChildContext( ::sal_Int32 aElementToken, const Reference< XFastAttributeList >& xAttribs ) throw ( SAXException, RuntimeException )
628*cdf0e10cSrcweir 	{
629*cdf0e10cSrcweir 		Reference< XFastContextHandler > xRet;
630*cdf0e10cSrcweir 
631*cdf0e10cSrcweir 		switch ( aElementToken )
632*cdf0e10cSrcweir 		{
633*cdf0e10cSrcweir 		case PPT_TOKEN( childTnLst ):
634*cdf0e10cSrcweir 		case PPT_TOKEN( subTnLst ):
635*cdf0e10cSrcweir             xRet.set( new TimeNodeListContext( *this, mpNode->getChildren() ) );
636*cdf0e10cSrcweir 			break;
637*cdf0e10cSrcweir 
638*cdf0e10cSrcweir 		case PPT_TOKEN( stCondLst ):
639*cdf0e10cSrcweir             xRet.set( new CondListContext( *this, aElementToken, xAttribs, mpNode, mpNode->getStartCondition() ) );
640*cdf0e10cSrcweir 			break;
641*cdf0e10cSrcweir 		case PPT_TOKEN( endCondLst ):
642*cdf0e10cSrcweir             xRet.set( new CondListContext( *this, aElementToken, xAttribs, mpNode, mpNode->getEndCondition() ) );
643*cdf0e10cSrcweir 			break;
644*cdf0e10cSrcweir 
645*cdf0e10cSrcweir 		case PPT_TOKEN( endSync ):
646*cdf0e10cSrcweir             xRet.set( new CondContext( *this, xAttribs, mpNode, mpNode->getEndSyncValue() ) );
647*cdf0e10cSrcweir 			break;
648*cdf0e10cSrcweir 		case PPT_TOKEN( iterate ):
649*cdf0e10cSrcweir 		{
650*cdf0e10cSrcweir 			sal_Int32 nVal = xAttribs->getOptionalValueToken( XML_type, XML_el );
651*cdf0e10cSrcweir 			if( nVal != 0 )
652*cdf0e10cSrcweir 			{
653*cdf0e10cSrcweir 				// TODO put that in a function
654*cdf0e10cSrcweir 				sal_Int16 nEnum;
655*cdf0e10cSrcweir 				switch( nVal )
656*cdf0e10cSrcweir 				{
657*cdf0e10cSrcweir 				case XML_el:
658*cdf0e10cSrcweir 					nEnum =	TextAnimationType::BY_PARAGRAPH;
659*cdf0e10cSrcweir 					break;
660*cdf0e10cSrcweir 				case XML_lt:
661*cdf0e10cSrcweir 					nEnum = TextAnimationType::BY_LETTER;
662*cdf0e10cSrcweir 					break;
663*cdf0e10cSrcweir 				case XML_wd:
664*cdf0e10cSrcweir 					nEnum = TextAnimationType::BY_WORD;
665*cdf0e10cSrcweir 					break;
666*cdf0e10cSrcweir 				default:
667*cdf0e10cSrcweir 					// default is BY_WORD. See Ppt97Animation::GetTextAnimationType()
668*cdf0e10cSrcweir 					// in sd/source/filter/ppt/ppt97animations.cxx:297
669*cdf0e10cSrcweir 					nEnum = TextAnimationType::BY_WORD;
670*cdf0e10cSrcweir 					break;
671*cdf0e10cSrcweir 				}
672*cdf0e10cSrcweir 				mpNode->getNodeProperties()[ NP_ITERATETYPE ] <<= nEnum;
673*cdf0e10cSrcweir 			}
674*cdf0e10cSrcweir 			// in case of exception we ignore the whole tag.
675*cdf0e10cSrcweir 			AttributeList attribs( xAttribs );
676*cdf0e10cSrcweir 			// TODO what to do with this
677*cdf0e10cSrcweir 			/*bool bBackwards =*/ attribs.getBool( XML_backwards, false );
678*cdf0e10cSrcweir 			mbIterate = true;
679*cdf0e10cSrcweir 			break;
680*cdf0e10cSrcweir 		}
681*cdf0e10cSrcweir 		case PPT_TOKEN( tmAbs ):
682*cdf0e10cSrcweir 			if( mbIterate )
683*cdf0e10cSrcweir 			{
684*cdf0e10cSrcweir 				AttributeList attribs( xAttribs );
685*cdf0e10cSrcweir                 double fTime = attribs.getUnsigned( XML_val, 0 );
686*cdf0e10cSrcweir 				// time in ms. property is in % TODO
687*cdf0e10cSrcweir 				mpNode->getNodeProperties()[ NP_ITERATEINTERVAL ] <<= fTime;
688*cdf0e10cSrcweir 			}
689*cdf0e10cSrcweir 			break;
690*cdf0e10cSrcweir 		case PPT_TOKEN( tmPct ):
691*cdf0e10cSrcweir 			if( mbIterate )
692*cdf0e10cSrcweir 			{
693*cdf0e10cSrcweir 				AttributeList attribs( xAttribs );
694*cdf0e10cSrcweir                 double fPercent = (double)attribs.getUnsigned( XML_val, 0 ) / 100000.0;
695*cdf0e10cSrcweir 				mpNode->getNodeProperties()[ NP_ITERATEINTERVAL ] <<= fPercent;
696*cdf0e10cSrcweir 			}
697*cdf0e10cSrcweir 			break;
698*cdf0e10cSrcweir 		default:
699*cdf0e10cSrcweir 			break;
700*cdf0e10cSrcweir 		}
701*cdf0e10cSrcweir 
702*cdf0e10cSrcweir 		if( !xRet.is() )
703*cdf0e10cSrcweir 			xRet.set( this );
704*cdf0e10cSrcweir 
705*cdf0e10cSrcweir 		return xRet;
706*cdf0e10cSrcweir 	}
707*cdf0e10cSrcweir 
708*cdf0e10cSrcweir } }
709