Coverage Report

Created: 2025-07-07 10:01

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