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