Issue 121164 - AnimatedImages : StepTime is ignored
Summary: AnimatedImages : StepTime is ignored
Status: CONFIRMED
Alias: None
Product: App Dev
Classification: Unclassified
Component: api (show other issues)
Version: 3.3.0 or older (OOo)
Hardware: PC Windows XP
: P3 Normal
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-05 07:13 UTC by bmarcelly
Modified: 2017-05-20 11:27 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
Zip containing a Writer document and 6 images (88.05 KB, application/zip)
2012-10-05 07:13 UTC, bmarcelly
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description bmarcelly 2012-10-05 07:13:10 UTC
Created attachment 79734 [details]
Zip containing a Writer document and 6 images

Setting (c.s.s.awt.XAnimatedImages) StepTime does not change the rate of images display, at least on Windows XP.
Perhaps a consequence of Bug 121161

Attachment is a zip containing AnimatedProblems.odt and 6 png images. Unzip all in the same folder. 
Run the macro : StepTime should be 2000ms between two images.
Comment 1 Ariel Constenla-Haile 2012-10-05 09:35:34 UTC
Confirmed.

I was about to upload my test macros. The implementation has several bugs.
Comment 2 Ariel Constenla-Haile 2012-10-05 09:54:54 UTC
(In reply to comment #1)
> Confirmed.
> 
> I was about to upload my test macros. The implementation has several bugs.

Did you try playing with changing the image sets?
Attachment 77599 [details] seems to work fine, as long as you don't mess with attributes, in the later case strange bugs happen...
Comment 3 Ariel Constenla-Haile 2012-10-05 10:46:08 UTC
It turns out that the control peer actually calls the respective VCL class (Throbber) to change the step time:

AnimatedImagesPeer::setProperty()

case BASEPROPERTY_STEP_TIME:
{
    sal_Int32 nStepTime( 0 );
    if ( i_value >>= nStepTime )
         pThrobber->setStepTime( nStepTime );
    break;
}

Unfortunately, Throbber::setStepTime() simply stores that value in a member variable 

void  setStepTime( sal_Int32 nStepTime )  { mnStepTime = nStepTime; }

that member variable is never used to actually set the AutoTimer timeout: the timeout is only set on the Throbber constructor, where the timeout value is set to a default value of 100:

Throbber::Throbber( Window* i_parentWindow, WinBits i_style, const ImageSet i_imageSet )
    :ImageControl( i_parentWindow, i_style )
    ,mbRepeat( sal_True )
    ,mnStepTime( 100 )
    ,mnCurStep( 0 )
    ,mnStepCount( 0 )
    ,meImageSet( i_imageSet )
{
    maWaitTimer.SetTimeout( mnStepTime );
    maWaitTimer.SetTimeoutHdl( LINK( this, Throbber, TimeOutHdl ) );

    SetScaleMode( ImageScaleMode::None );
    initImages();
}

Possible solutions:

a) make Throbber::setStepTime() update the AutoTimer's timeout, but what if the Throbber is running (== the timer is active)?
b) reset the AutoTimer's timeout in Throbber::start(), that is, when the animation is started; this will have the effect that setting the step time while the animation is running will only take effect after it restarts
c) ....
Comment 4 Marcus 2017-05-20 11:27:29 UTC
Reset assigne to the default "issues@openoffice.apache.org".