https://bugs.documentfoundation.org/show_bug.cgi?id=151456

            Bug ID: 151456
           Summary: AnimatedImages in Basic Dialog : StepTime is ignored
           Product: LibreOffice
           Version: 7.3.6.2 release
          Hardware: x86-64 (AMD64)
                OS: Windows (All)
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: BASIC
          Assignee: [email protected]
          Reporter: [email protected]

Description:
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 10.
Attachment is a zip containing AnimatedProblems.odt and 6 png images. Unzip all
in the same folder. Click the button to run the macro BASIC and open the dialog
with animation.
StepTime should be 2000ms between two images.

Steps to Reproduce:
1.Setting (c.s.s.awt.XAnimatedImages) StepTime does not change the rate of
images display.
2.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.


Actual Results:
StepTime seems to be 100ms

Expected Results:
StepTime should be 2000ms 


Reproducible: Always


User Profile Reset: No



Additional Info:
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) ....

solution to be tested : 
in the file vcl/source/control/throbber.cxx  change the start method like this: 
void Throbber::start()
{
    maWaitTimer.SetTimeout( mnStepTime );
    maWaitTimer.Start();
}

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to