Coverage Report

Created: 2026-06-30 11:14

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/oox/source/ppt/timenode.cxx
Line
Count
Source
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 <oox/ppt/timenode.hxx>
21
22
#include <com/sun/star/beans/NamedValue.hpp>
23
#include <com/sun/star/container/XEnumerationAccess.hpp>
24
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
25
#include <com/sun/star/animations/XAnimateColor.hpp>
26
#include <com/sun/star/animations/XAnimateMotion.hpp>
27
#include <com/sun/star/animations/XAnimateTransform.hpp>
28
#include <com/sun/star/animations/XCommand.hpp>
29
#include <com/sun/star/animations/XAudio.hpp>
30
#include <com/sun/star/animations/XIterateContainer.hpp>
31
#include <com/sun/star/animations/XTimeContainer.hpp>
32
#include <com/sun/star/animations/XTransitionFilter.hpp>
33
#include <com/sun/star/animations/AnimationNodeType.hpp>
34
#include <com/sun/star/animations/Event.hpp>
35
#include <com/sun/star/animations/EventTrigger.hpp>
36
#include <com/sun/star/io/WrongFormatException.hpp>
37
#include <com/sun/star/presentation/EffectNodeType.hpp>
38
#include <com/sun/star/uno/XComponentContext.hpp>
39
40
#include <oox/core/xmlfilterbase.hxx>
41
#include <oox/ppt/pptfilterhelpers.hxx>
42
#include <oox/token/tokens.hxx>
43
#include <sal/log.hxx>
44
#include <comphelper/diagnose_ex.hxx>
45
46
using namespace ::oox::core;
47
using namespace ::com::sun::star::beans;
48
using namespace ::com::sun::star::container;
49
using namespace ::com::sun::star::uno;
50
using namespace ::com::sun::star::lang;
51
using namespace ::com::sun::star::animations;
52
using namespace ::com::sun::star::presentation;
53
54
namespace {
55
56
void lcl_setAncestorSubItem( const Reference<XAnimationNode>& xParent, sal_Int16 nSubItem )
57
276
{
58
59
276
    Reference<XAnimationNode> xNode = xParent;
60
61
1.65k
    while ( xNode.is() )
62
1.38k
    {
63
1.38k
        if ( xNode->getType() == AnimationNodeType::ANIMATE )
64
0
        {
65
0
            Reference<XAnimate> xAnimate( xNode, UNO_QUERY );
66
0
            if ( xAnimate.is() )
67
0
                xAnimate->setSubItem( nSubItem );
68
0
            break;
69
0
        }
70
1.38k
        else if ( xNode->getType() == AnimationNodeType::ITERATE )
71
0
        {
72
0
            Reference<XIterateContainer> xIterateContainer( xNode, UNO_QUERY );
73
0
            if ( xIterateContainer.is() )
74
0
                xIterateContainer->setSubItem( nSubItem );
75
0
            break;
76
0
        }
77
78
1.38k
        xNode.set( xNode->getParent(), UNO_QUERY );
79
1.38k
    }
80
276
}
81
82
}
83
84
namespace oox::ppt {
85
        OUString TimeNode::getServiceName( sal_Int16 nNodeType )
86
1.27k
        {
87
1.27k
            OUString sServiceName;
88
1.27k
            switch( nNodeType )
89
1.27k
            {
90
215
            case AnimationNodeType::PAR:
91
215
                sServiceName = "com.sun.star.animations.ParallelTimeContainer";
92
215
                break;
93
708
            case AnimationNodeType::SEQ:
94
708
                sServiceName = "com.sun.star.animations.SequenceTimeContainer";
95
708
                break;
96
74
            case AnimationNodeType::ANIMATE:
97
74
                sServiceName = "com.sun.star.animations.Animate";
98
74
                break;
99
0
            case AnimationNodeType::ITERATE:
100
0
                sServiceName = "com.sun.star.animations.IterateContainer";
101
0
                break;
102
11
            case AnimationNodeType::ANIMATECOLOR:
103
11
                sServiceName = "com.sun.star.animations.AnimateColor";
104
11
                break;
105
55
            case AnimationNodeType::TRANSITIONFILTER:
106
55
                sServiceName = "com.sun.star.animations.TransitionFilter";
107
55
                break;
108
1
            case AnimationNodeType::ANIMATEMOTION:
109
1
                sServiceName = "com.sun.star.animations.AnimateMotion";
110
1
                break;
111
77
            case AnimationNodeType::ANIMATETRANSFORM:
112
77
                sServiceName = "com.sun.star.animations.AnimateTransform";
113
77
                break;
114
0
            case AnimationNodeType::COMMAND:
115
0
                sServiceName = "com.sun.star.animations.Command";
116
0
                break;
117
132
            case AnimationNodeType::SET:
118
132
                sServiceName = "com.sun.star.animations.AnimateSet";
119
132
                break;
120
0
            case AnimationNodeType::AUDIO:
121
0
                sServiceName = "com.sun.star.animations.Audio";
122
0
                break;
123
0
            default:
124
0
                SAL_INFO("oox.ppt","OOX: unhandled type " << nNodeType );
125
0
                break;
126
1.27k
            }
127
1.27k
            return sServiceName;
128
1.27k
        }
129
130
    TimeNode::TimeNode( sal_Int16 nNodeType )
131
2.09k
        : mnNodeType( nNodeType )
132
2.09k
        , mbHasEndSyncValue( false )
133
2.09k
    {
134
2.09k
    }
135
136
    TimeNode::~TimeNode()
137
2.09k
    {
138
2.09k
    }
139
140
    void fixMainSequenceTiming( const css::uno::Reference< css::animations::XAnimationNode >& xNode )
141
1.76k
    {
142
1.76k
        try
143
1.76k
        {
144
1.76k
            bool bFirst = true;
145
1.76k
            Reference< XEnumerationAccess > xEA( xNode, UNO_QUERY_THROW );
146
1.76k
            Reference< XEnumeration > xE( xEA->createEnumeration(), UNO_SET_THROW );
147
3.17k
            while( xE->hasMoreElements() )
148
1.40k
            {
149
                // click node
150
1.40k
                Reference< XAnimationNode > xClickNode( xE->nextElement(), UNO_QUERY );
151
152
1.40k
                Event aEvent;
153
1.40k
                aEvent.Trigger = EventTrigger::ON_NEXT;
154
1.40k
                aEvent.Repeat = 0;
155
1.40k
                xClickNode->setBegin( Any( aEvent ) );
156
157
1.40k
                if( bFirst )
158
710
                {
159
710
                    bFirst = false;
160
710
                    Reference< XEnumerationAccess > xEA2( xClickNode, UNO_QUERY_THROW );
161
710
                    Reference< XEnumeration > xE2( xEA2->createEnumeration(), UNO_SET_THROW );
162
710
                    if( xE2->hasMoreElements() )
163
689
                    {
164
                        // with node
165
689
                        xE2->nextElement() >>= xEA2;
166
689
                        if( xEA2.is() )
167
689
                            xE2 = xEA2->createEnumeration();
168
0
                        else
169
0
                            xE2.clear();
170
171
689
                        if( xE2.is() && xE2->hasMoreElements() )
172
678
                        {
173
678
                            Reference< XAnimationNode > xEffectNode( xE2->nextElement(), UNO_QUERY_THROW );
174
678
                            const Sequence< NamedValue > aUserData( xEffectNode->getUserData() );
175
678
                            for( const NamedValue& rProp : aUserData )
176
1.51k
                            {
177
1.51k
                                if ( rProp.Name == "node-type" )
178
643
                                {
179
643
                                    sal_Int16 nNodeType = 0;
180
643
                                    rProp.Value >>= nNodeType;
181
643
                                    if( nNodeType != css::presentation::EffectNodeType::ON_CLICK )
182
354
                                    {
183
                                        // first effect does not start on click, so correct
184
                                        // first click nodes begin to 0s
185
354
                                        xClickNode->setBegin( Any( 0.0 ) );
186
354
                                        break;
187
354
                                    }
188
643
                                }
189
1.51k
                            }
190
678
                        }
191
689
                    }
192
710
                }
193
1.40k
            }
194
1.76k
        }
195
1.76k
        catch( Exception& )
196
1.76k
        {
197
9
            SAL_INFO("oox.ppt","fixMainSequenceTiming(), exception caught!" );
198
9
        }
199
1.76k
    }
200
201
    void fixInteractiveSequenceTiming( const css::uno::Reference< css::animations::XAnimationNode >& xNode )
202
9
    {
203
9
        try
204
9
        {
205
9
            Any aBegin( xNode->getBegin() );
206
9
            Any aEmpty;
207
9
            xNode->setBegin( aEmpty );
208
209
9
            Reference< XEnumerationAccess > xEA( xNode, UNO_QUERY_THROW );
210
9
            Reference< XEnumeration > xE( xEA->createEnumeration(), UNO_SET_THROW );
211
21
            while( xE->hasMoreElements() )
212
12
            {
213
                // click node
214
12
                Reference< XAnimationNode > xClickNode( xE->nextElement(), UNO_QUERY );
215
12
                xClickNode->setBegin( aBegin );
216
12
            }
217
9
        }
218
9
        catch( Exception& )
219
9
        {
220
0
            SAL_INFO("oox.ppt","fixInteractiveSequenceTiming(), exception caught!" );
221
0
        }
222
9
    }
223
224
    void TimeNode::addNode( const XmlFilterBase& rFilter, const Reference< XAnimationNode >& rxNode, const SlidePersistPtr & pSlide )
225
1.27k
    {
226
1.27k
        try {
227
1.27k
            sal_Int16 nNodeType = mnNodeType;
228
229
1.27k
            if (mnNodeType == AnimationNodeType::PAR && maNodeProperties[NP_ITERATETYPE].hasValue())
230
0
                nNodeType = AnimationNodeType::ITERATE;
231
232
1.27k
            OUString sServiceName = getServiceName(nNodeType);
233
234
1.27k
            Reference< XAnimationNode > xNode = createAndInsert( rFilter, sServiceName, rxNode );
235
1.27k
            if (!xNode)
236
0
                return;
237
1.27k
            setNode(rFilter, xNode, pSlide, rxNode);
238
1.27k
        }
239
1.27k
        catch( const Exception& )
240
1.27k
        {
241
0
            TOOLS_INFO_EXCEPTION("oox.ppt","OOX: exception raised in TimeNode::addNode()" );
242
0
        }
243
1.27k
    }
244
245
    void TimeNode::setNode(const XmlFilterBase& rFilter, const Reference< XAnimationNode >& xNode, const SlidePersistPtr & pSlide, const Reference<XAnimationNode>& xParent)
246
2.08k
    {
247
2.08k
        SAL_WARN_IF( !xNode.is(), "oox.ppt", "null node passed" );
248
249
2.08k
        try {
250
2.08k
            if( !msId.isEmpty() )
251
2.08k
            {
252
2.08k
                pSlide->getAnimNodesMap()[ msId ] = xNode;
253
2.08k
            }
254
255
2.08k
            if( mpTarget )
256
350
            {
257
350
                sal_Int16 nSubItem(0);
258
350
                maNodeProperties[ NP_TARGET ] = mpTarget->convert( pSlide, nSubItem );
259
350
                if( mpTarget->mnType == XML_spTgt )
260
350
                {
261
350
                    if ( xNode->getType() == AnimationNodeType::ANIMATE ||
262
276
                            xNode->getType() == AnimationNodeType::ITERATE )
263
74
                    {
264
74
                        maNodeProperties[ NP_SUBITEM ] <<= nSubItem;
265
74
                    }
266
276
                    else
267
276
                        lcl_setAncestorSubItem( xParent, nSubItem );
268
350
                }
269
350
            }
270
271
2.08k
            if( !maStCondList.empty() )
272
382
            {
273
382
                Any aAny = AnimationCondition::convertList( pSlide, maStCondList );
274
382
                if( aAny.hasValue() )
275
382
                {
276
382
                    xNode->setBegin( aAny );
277
382
                }
278
279
382
            }
280
2.08k
            if( !maEndCondList.empty() )
281
0
            {
282
0
                Any aAny = AnimationCondition::convertList( pSlide, maEndCondList );
283
0
                if( aAny.hasValue() )
284
0
                {
285
0
                    xNode->setEnd( aAny );
286
0
                }
287
0
            }
288
2.08k
            if( mbHasEndSyncValue )
289
0
            {
290
0
                Any aValue = maEndSyncValue.convert( pSlide );
291
0
                xNode->setEndSync(aValue);
292
0
            }
293
294
2.08k
            if( !maUserData.empty() )
295
1.60k
            {
296
1.60k
                Sequence< NamedValue > aUserDataSeq( static_cast< sal_Int32 >( maUserData.size() ) );
297
1.60k
                NamedValue* pValues = aUserDataSeq.getArray();
298
1.60k
                for (auto const& elem : maUserData)
299
1.76k
                {
300
1.76k
                    pValues->Name = elem.first;
301
1.76k
                    pValues->Value = elem.second;
302
1.76k
                    ++pValues;
303
1.76k
                }
304
1.60k
                maNodeProperties[ NP_USERDATA ] <<= aUserDataSeq;
305
1.60k
            }
306
307
2.08k
            Reference< XAnimate > xAnimate( xNode, UNO_QUERY );
308
2.08k
            Reference< XAnimateColor > xAnimateColor( xNode, UNO_QUERY );
309
2.08k
            Reference< XAnimateMotion > xAnimateMotion( xNode, UNO_QUERY );
310
2.08k
            Reference< XAnimateTransform > xAnimateTransform( xNode, UNO_QUERY );
311
2.08k
            Reference< XCommand > xCommand( xNode, UNO_QUERY );
312
2.08k
            Reference< XAudio > xAudio( xNode, UNO_QUERY );
313
2.08k
            Reference< XIterateContainer > xIterateContainer( xNode, UNO_QUERY );
314
2.08k
            sal_Int16 nInt16 = 0;
315
2.08k
            bool bBool = false;
316
2.08k
            double fDouble = 0;
317
2.08k
            OUString sString;
318
2.08k
            Sequence< NamedValue > aSeq;
319
320
66.8k
            for( int i = 0; i < NP_SIZE_; i++)
321
64.7k
            {
322
64.7k
                Any & aValue( maNodeProperties[ i ] );
323
64.7k
                if( aValue.hasValue() )
324
7.57k
                {
325
7.57k
                    switch( i )
326
7.57k
                    {
327
267
                    case NP_TO:
328
267
                        if( xAnimate.is() )
329
267
                            xAnimate->setTo( aValue );
330
267
                        break;
331
108
                    case NP_FROM:
332
108
                        if( xAnimate.is() )
333
108
                            xAnimate->setFrom( aValue );
334
108
                        break;
335
7
                    case NP_BY:
336
7
                        if( xAnimate.is() )
337
7
                            xAnimate->setBy( aValue );
338
7
                        break;
339
0
                    case NP_HIDEDURINGSHOW:
340
0
                        if (xAudio.is() && (aValue >>= bBool))
341
0
                        {
342
0
                            xAudio->setHideDuringShow(bBool);
343
0
                        }
344
0
                        break;
345
0
                    case NP_ISNARRATION:
346
0
                        if (xAudio.is() && (aValue >>= bBool))
347
0
                        {
348
0
                            xAudio->setNarration(bBool);
349
0
                        }
350
0
                        break;
351
350
                    case NP_TARGET:
352
353
350
                        if (xParent.is() && xParent->getType() == AnimationNodeType::ITERATE)
354
0
                        {
355
0
                            Reference<XIterateContainer> xParentContainer(xParent, UNO_QUERY);
356
0
                            if (xParentContainer.is())
357
0
                                xParentContainer->setTarget(aValue);
358
0
                        }
359
350
                        else
360
350
                        {
361
350
                            if (xAnimate.is())
362
350
                                xAnimate->setTarget(aValue);
363
350
                            if (xCommand.is())
364
0
                                xCommand->setTarget(aValue);
365
350
                            if (xAudio.is())
366
0
                                xAudio->setSource(aValue);
367
350
                        }
368
350
                        break;
369
74
                    case NP_SUBITEM:
370
74
                        if( aValue >>= nInt16 )
371
74
                        {
372
74
                            if( xAnimate.is() )
373
74
                            {
374
74
                                xAnimate->setSubItem( nInt16 );
375
74
                            }
376
0
                            else if ( xIterateContainer.is() )
377
0
                            {
378
0
                                xIterateContainer->setSubItem( nInt16 );
379
0
                            }
380
74
                        }
381
0
                        else
382
0
                        {
383
0
                            SAL_INFO("oox.ppt","any >>= failed " << __LINE__ );
384
0
                        }
385
74
                        break;
386
220
                    case NP_ATTRIBUTENAME:
387
220
                        if( xAnimate.is() )
388
220
                        {
389
220
                            if( aValue >>= sString )
390
220
                                xAnimate->setAttributeName( sString );
391
0
                            else
392
0
                            {
393
0
                                SAL_INFO("oox.ppt","any >>= failed " << __LINE__ );
394
0
                            }
395
220
                        }
396
220
                        break;
397
220
                    case NP_CALCMODE:
398
74
                        if( xAnimate.is() )
399
74
                        {
400
74
                            if( aValue >>= nInt16 )
401
74
                                xAnimate->setCalcMode( nInt16 );
402
0
                            else
403
0
                            {
404
0
                                SAL_INFO("oox.ppt","any >>= failed " << __LINE__ );
405
0
                            }
406
74
                        }
407
74
                        break;
408
74
                    case NP_KEYTIMES:
409
20
                        if( xAnimate.is() )
410
20
                        {
411
20
                            Sequence<double> aKeyTimes;
412
20
                            if( aValue >>= aKeyTimes )
413
20
                                xAnimate->setKeyTimes(aKeyTimes);
414
0
                            else
415
0
                            {
416
0
                                SAL_INFO("oox.ppt","any >>= failed " << __LINE__ );
417
0
                            }
418
20
                        }
419
20
                        break;
420
20
                    case NP_VALUES:
421
20
                        if( xAnimate.is() )
422
20
                        {
423
20
                            Sequence<Any> aValues;
424
20
                            if( aValue >>= aValues )
425
20
                                xAnimate->setValues(aValues);
426
0
                            else
427
0
                            {
428
0
                                SAL_INFO("oox.ppt","any >>= failed " << __LINE__ );
429
0
                            }
430
20
                        }
431
20
                        break;
432
20
                    case NP_FORMULA:
433
8
                        if( xAnimate.is() )
434
8
                        {
435
8
                            if( aValue >>= sString )
436
8
                                xAnimate->setFormula(sString);
437
0
                            else
438
0
                            {
439
0
                                SAL_INFO("oox.ppt","any >>= failed " << __LINE__ );
440
0
                            }
441
8
                        }
442
8
                        break;
443
11
                    case NP_COLORINTERPOLATION:
444
11
                        if( xAnimateColor.is() )
445
11
                        {
446
11
                            if( aValue >>= nInt16 )
447
11
                                xAnimateColor->setColorInterpolation( nInt16 );
448
0
                            else
449
0
                            {
450
0
                                SAL_INFO("oox.ppt","any >>= failed " << __LINE__ );
451
0
                            }
452
11
                        }
453
11
                        break;
454
11
                    case NP_DIRECTION:
455
11
                        if( xAnimateColor.is() )
456
11
                        {
457
11
                            if( aValue >>= bBool )
458
11
                                xAnimateColor->setDirection( bBool );
459
0
                            else
460
0
                            {
461
0
                                SAL_INFO("oox.ppt","any >>= failed " << __LINE__ );
462
0
                            }
463
11
                        }
464
11
                        break;
465
11
                    case NP_PATH:
466
1
                        if( xAnimateMotion.is() )
467
1
                            xAnimateMotion->setPath( aValue );
468
1
                        break;
469
78
                    case NP_TRANSFORMTYPE:
470
78
                        if( xAnimateTransform.is() )
471
77
                        {
472
77
                            if( aValue >>= nInt16 )
473
77
                                xAnimateTransform->setTransformType( nInt16 );
474
0
                            else
475
0
                            {
476
0
                                SAL_INFO("oox.ppt","any >>= failed " << __LINE__ );
477
0
                            }
478
77
                        }
479
78
                        break;
480
1.60k
                    case NP_USERDATA:
481
1.60k
                        if( aValue >>= aSeq )
482
1.60k
                            xNode->setUserData( aSeq );
483
0
                        else
484
0
                        {
485
0
                            SAL_INFO("oox.ppt","any >>= failed " << __LINE__ );
486
0
                        }
487
1.60k
                        break;
488
1.60k
                    case NP_ACCELERATION:
489
82
                        if( aValue >>= fDouble )
490
82
                            xNode->setAcceleration( fDouble );
491
0
                        else
492
0
                        {
493
0
                            SAL_INFO("oox.ppt","any >>= failed " << __LINE__ );
494
0
                        }
495
82
                        break;
496
82
                    case NP_DECELERATE:
497
63
                        if( aValue >>= fDouble )
498
63
                            xNode->setDecelerate( fDouble );
499
0
                        else
500
0
                        {
501
0
                            SAL_INFO("oox.ppt","any >>= failed " << __LINE__ );
502
0
                        }
503
63
                        break;
504
2.08k
                    case NP_AUTOREVERSE:
505
2.08k
                        if( aValue >>= bBool )
506
2.08k
                            xNode->setAutoReverse( bBool );
507
0
                        else
508
0
                        {
509
0
                            SAL_INFO("oox.ppt","any >>= failed " << __LINE__ );
510
0
                        }
511
2.08k
                        break;
512
2.08k
                    case NP_DURATION:
513
1.22k
                        xNode->setDuration( aValue );
514
1.22k
                        break;
515
441
                    case NP_FILL:
516
441
                        if( aValue >>= nInt16 )
517
441
                            xNode->setFill( nInt16 );
518
0
                        else
519
0
                        {
520
0
                            SAL_INFO("oox.ppt","any >>= failed " << __LINE__ );
521
0
                        }
522
441
                        break;
523
441
                    case NP_REPEATCOUNT:
524
0
                        xNode->setRepeatCount( aValue );
525
0
                        break;
526
0
                    case NP_REPEATDURATION:
527
0
                        xNode->setRepeatDuration( aValue );
528
0
                        break;
529
815
                    case NP_RESTART:
530
815
                        if( aValue >>= nInt16 )
531
815
                            xNode->setRestart( nInt16 );
532
0
                        else
533
0
                        {
534
0
                            SAL_INFO("oox.ppt","any >>= failed " << __LINE__ );
535
0
                        }
536
815
                        break;
537
815
                    case NP_COMMAND:
538
0
                        if( xCommand.is() )
539
0
                        {
540
0
                            if( aValue >>= nInt16 )
541
0
                                xCommand->setCommand( nInt16 );
542
0
                            else
543
0
                            {
544
0
                                SAL_INFO("oox.ppt","any >>= failed " << __LINE__ );
545
0
                            }
546
0
                        }
547
0
                        break;
548
0
                    case NP_PARAMETER:
549
0
                        if( xCommand.is() )
550
0
                            xCommand->setParameter( aValue );
551
0
                        break;
552
0
                    case NP_ITERATETYPE:
553
0
                        if( xIterateContainer.is() )
554
0
                        {
555
0
                            if( aValue >>= nInt16 )
556
0
                                xIterateContainer->setIterateType( nInt16 );
557
0
                            else
558
0
                            {
559
0
                                SAL_INFO("oox.ppt","any >>= failed " << __LINE__ );
560
0
                            }
561
0
                        }
562
0
                        break;
563
0
                    case NP_ITERATEINTERVAL:
564
0
                        if( xIterateContainer.is() )
565
0
                        {
566
0
                            if( aValue >>= fDouble )
567
0
                                xIterateContainer->setIterateInterval( fDouble );
568
0
                            else
569
0
                            {
570
0
                                SAL_INFO("oox.ppt","any >>= failed " << __LINE__ );
571
0
                            }
572
0
                        }
573
0
                        break;
574
4
                    default:
575
4
                        SAL_INFO("oox.ppt","ERR-OOX: unknown prop index " << i );
576
4
                        break;
577
7.57k
                    }
578
7.57k
                }
579
64.7k
            }
580
581
2.08k
            if (xAnimate.is() && xAnimate->getValues().getLength() != xAnimate->getKeyTimes().getLength())
582
0
                throw css::io::WrongFormatException();
583
584
2.08k
            if( mnNodeType == AnimationNodeType::TRANSITIONFILTER )
585
55
            {
586
587
55
                Reference< XTransitionFilter > xFilter( xNode, UNO_QUERY );
588
55
                maTransitionFilter.setTransitionFilterProperties( xFilter );
589
55
            }
590
591
2.08k
            std::for_each(
592
2.08k
                maChildren.begin(), maChildren.end(),
593
2.08k
                [&rFilter, &xNode, &pSlide] (TimeNodePtr const & child) {
594
1.27k
                    child->addNode(rFilter, xNode, pSlide);
595
1.27k
                } );
596
597
2.08k
            switch( mnNodeType )
598
2.08k
            {
599
708
            case AnimationNodeType::SEQ:
600
708
            {
601
708
                sal_Int16 nEnum = 0;
602
708
                if( maUserData[ u"node-type"_ustr ] >>= nEnum )
603
708
                {
604
708
                    if( nEnum == EffectNodeType::MAIN_SEQUENCE )
605
708
                    {
606
708
                        fixMainSequenceTiming( xNode );
607
708
                    }
608
0
                    else if( nEnum ==  EffectNodeType::INTERACTIVE_SEQUENCE )
609
0
                    {
610
0
                        fixInteractiveSequenceTiming( xNode );
611
0
                    }
612
708
                }
613
708
                break;
614
0
            }
615
1.03k
            case AnimationNodeType::PAR:
616
                // some other cut&paste... from AnimationImporter::importAnimationContainer()
617
1.03k
                break;
618
2.08k
            }
619
2.08k
        }
620
2.08k
        catch( const Exception& )
621
2.08k
        {
622
0
            TOOLS_INFO_EXCEPTION("oox.ppt","OOX: exception raised in TimeNode::setNode()");
623
0
        }
624
2.08k
    }
625
626
    Reference< XAnimationNode > TimeNode::createAndInsert(
627
            const XmlFilterBase& rFilter,
628
            const OUString& rServiceName,
629
            const Reference< XAnimationNode >& rxNode )
630
1.27k
    {
631
1.27k
        try {
632
1.27k
            Reference< XAnimationNode > xNode( Reference<css::lang::XMultiServiceFactory>(rFilter.getComponentContext()->getServiceManager(), UNO_QUERY_THROW)->createInstance( rServiceName ), UNO_QUERY_THROW );
633
1.27k
            Reference< XTimeContainer > xParentContainer( rxNode, UNO_QUERY_THROW );
634
635
1.27k
            xParentContainer->appendChild( xNode );
636
1.27k
            return xNode;
637
1.27k
        }
638
1.27k
        catch( const Exception& )
639
1.27k
        {
640
0
            TOOLS_INFO_EXCEPTION("oox.ppt", "OOX: exception raised in TimeNode::createAndInsert() trying to create a service " << rServiceName);
641
0
        }
642
643
0
        return Reference< XAnimationNode >();
644
1.27k
    }
645
646
    void    TimeNode::setId( sal_Int32 nId )
647
2.08k
    {
648
2.08k
        msId = OUString::number(nId);
649
2.08k
    }
650
651
    void TimeNode::setTo( const Any & aTo )
652
267
    {
653
267
        maNodeProperties[ NP_TO ] = aTo;
654
267
    }
655
656
    void TimeNode::setFrom( const Any & aFrom )
657
108
    {
658
108
        maNodeProperties[ NP_FROM ] = aFrom;
659
108
    }
660
661
    void TimeNode::setBy( const Any & aBy )
662
7
    {
663
7
        maNodeProperties[ NP_BY ] = aBy;
664
7
    }
665
666
}
667
668
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */