Dear Aspose Support Team,
We are upgrading our Aspose integration from version 18.2.1. to the most recent one and ran into an issue with animated object deletion that we hadn’t experienced before.
The issue seems to be present with every newer version of Aspose above 18.2.1.
Could you please help us resolving this issue?
What we experience is the following:
- we create an object on a slide
- add an animation to it
- remove the animation (this step seems to be a prerequisite that hasn’t been one previously, without it PowerPoint crashes even at this point!)
- remove the object (changing the order of step 3) and 4) doesn’t seem to matter)
- add another object
- add animation to that newly added object
-> at that point we got the attached error message from PowerPoint.
powerpoint_crash1.png (46.7 KB)
powerpoint_crash.png (43.2 KB)
I’m also copying a shortened example code that produces the issue below - it’s a refresh function, running it on an empty slide it runs properly, running it for the second time (since it had the animated object on it previously) it produces the issue:
animation_refresh.zip (642 Bytes)
public void Animation_CreateOrRefresh()
{
// Remove old shapes
var shapesToDelete = slide.Shapes.Where(s => s.Name?.Contains(“animation_group”) ?? false).ToArray();
foreach(var shape in shapesToDelete)
{
slide.Shapes.Remove(shape);
}
// Remove all sequences from the slide (skipping this step makes presentation corrupt as well)
slide.Timeline.InteractiveSequences.Clear();
// Add new shapes
var group1 = slide.Shapes.AddGroupShape();
var group2 = slide.Shapes.AddGroupShape();
group1.Shapes.AddAutoShape(ShapeType.Rectangle, 10, 10, 40, 40);
group1.Shapes.AddAutoShape(ShapeType.Rectangle, 10, 100, 40, 40);
group2.Shapes.AddAutoShape(ShapeType.Rectangle, 10, 200, 40, 40);
group2.Shapes.AddAutoShape(ShapeType.Rectangle, 10, 300, 40, 40);
group1.Name = "animation_group_1";
group2.Name = "animation_group_2";
// Add new sequence
var sequence = slide.Timeline.InteractiveSequences.Add(group1);
var effect = sequence.AddEffect(group2, EffectType.PathRight, EffectSubtype.None, EffectTriggerType.OnClick);
effect.Timing.Duration = 1f;
var behavior = effect.Behaviors[0] as IMotionEffect;
behavior.Path[1].Points[0].X = 1.2f;
behavior.Timing.Duration = 1f;
behavior.Timing.TriggerType = EffectTriggerType.OnClick;
}
Please let me know what we should do or how we should implement the order of actions/logic in order to avoid this issue!
Thanks for your help in advance!
Best,
Zoltan