Hello Daniel,
Daniel Watkins escribió:
Hello all,
Is there any way to find the number of effects that are on a slide?
well, you can try:
1. get the SlideShwo from the controller
css.presentation.XSlideShow
css.presentation.XSlideShowController.getSlideShow();
2. get the current slide from the SlideShow
css.drawing.XDrawPage css.presentation.XSlideShow.getCurrentSlide();
3. browse every XShape in the XDrawPage and get the property "Effect" to
check the css.presentation.AnimationEffect
Once you query every XShape in the XDrawPage, you'll know the number of
effects in this slide's shapes.
Or,
to put it a different way, is there a way to know how many times
XSlideShowController.gotoNextEffect can be called before it will be
equivalent to XSlideShowController.gotoNextSlide?
I think these are *different* things, or at least you should take some
other things into account (for example, the "Change" and "Duration"
properties of the css.presentation.DrawPage).
And for your scenario, a css.presentation.XSlideShowListener may be helpful.
Why are different things? For example, in slideTransitionStarted(), we
could count the effects on the shapes as follows:
public void slideTransitionStarted() {
System.out.printf("\n%s\n",
"XSlideShowListener::slideTransitionStarted()");
int nEffectsCount = 0;
XPresentation2 xPresentation2 = null;
synchronized (this) {
// m_xPresentation2 is a reference to the presentation
// held in a private member, as this listener methods
// get no event object struct passed
xPresentation2 = m_xPresentation2;
}
if (xPresentation2 == null)
return;
XSlideShowController xController = xPresentation2.getController();
if (xController == null)
return;
XDrawPage xDrawPage = xController.getCurrentSlide();
if (xDrawPage.hasElements()) {
int nCount = xDrawPage.getCount();
for (int i = 0; i < nCount; i++) {
try {
XPropertySet xShapeProps = (XPropertySet)
UnoRuntime.queryInterface(
XPropertySet.class,
xDrawPage.getByIndex(i));
AnimationEffect effect = (AnimationEffect)
AnyConverter.toObject(
AnimationEffect.class,
xShapeProps.getPropertyValue("Effect"));
if (effect != AnimationEffect.NONE) {
++nEffectsCount;
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
System.out.println(
"Effects count in this slide: " + nEffectsCount);
}
with the previous code you know the number of effects in the current
slide, but that's not the same as knowing that after some effect a new
slide will be displayed.
If this is not possible, where should I file a bug regarding it?
it seems to be possible, although I'm not sure if that's exactly what
you're looking for.
Regards
Ariel.
--
Ariel Constenla-Haile
La Plata, Argentina
[EMAIL PROTECTED]
http://www.ArielConstenlaHaile.com.ar/ooo/
"Aus der Kriegsschule des Lebens
- Was mich nicht umbringt,
macht mich härter."
Nietzsche Götzendämmerung, Sprüche und Pfeile, 8.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]