tdf#136278 Follow-up Check when the eventqueue needs to be emptied.

Follow up commit a63caf4995

Change-Id: I90b94f6aee1e1fe62f61ca20a75fd59e2a12d5da
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108559
Tested-by: Jenkins
Reviewed-by: Gülşah Köse <gulsah.kose@collabora.com>
This commit is contained in:
Gülşah Köse
2021-01-01 18:09:29 +03:00
parent 61d9a4a244
commit b83c168347
2 changed files with 16 additions and 8 deletions

View File

@@ -84,7 +84,8 @@ EffectRewinder::EffectRewinder (
mpAsynchronousRewindEvent(), mpAsynchronousRewindEvent(),
mxCurrentAnimationRootNode(), mxCurrentAnimationRootNode(),
mxCurrentSlide(), mxCurrentSlide(),
mbNonUserTriggeredMainSequenceEffectSeen(false) mbNonUserTriggeredMainSequenceEffectSeen(false),
mbHasAdvancedTimeSetting(false)
{ {
initialize(); initialize();
} }
@@ -160,6 +161,15 @@ void EffectRewinder::setCurrentSlide (
const uno::Reference<drawing::XDrawPage>& xSlide) const uno::Reference<drawing::XDrawPage>& xSlide)
{ {
mxCurrentSlide = xSlide; mxCurrentSlide = xSlide;
// Check if the current slide has advance time setting or not
uno::Reference< beans::XPropertySet > xPropSet( mxCurrentSlide, uno::UNO_QUERY );
sal_Int32 nChange(0);
if( xPropSet.is())
getPropertyValue( nChange, xPropSet, "Change");
mbHasAdvancedTimeSetting = nChange;
} }
bool EffectRewinder::rewind ( bool EffectRewinder::rewind (
@@ -179,6 +189,9 @@ bool EffectRewinder::rewind (
// Abort (and skip over the rest of) any currently active animation. // Abort (and skip over the rest of) any currently active animation.
mrUserEventQueue.callSkipEffectEventHandler(); mrUserEventQueue.callSkipEffectEventHandler();
if (!mbHasAdvancedTimeSetting)
mrEventQueue.forceEmpty();
const int nSkipCount (mnMainSequenceEffectCount - 1); const int nSkipCount (mnMainSequenceEffectCount - 1);
if (nSkipCount < 0) if (nSkipCount < 0)
{ {
@@ -417,13 +430,7 @@ void EffectRewinder::asynchronousRewind (
// when the slide is shown. // when the slide is shown.
mbNonUserTriggeredMainSequenceEffectSeen = false; mbNonUserTriggeredMainSequenceEffectSeen = false;
uno::Reference< beans::XPropertySet > xPropSet( mxCurrentSlide, uno::UNO_QUERY ); if (!mbHasAdvancedTimeSetting)
sal_Int32 nChange(0);
if( xPropSet.is())
getPropertyValue( nChange, xPropSet, "Change");
if (!nChange)
mrEventQueue.forceEmpty(); mrEventQueue.forceEmpty();
if (mbNonUserTriggeredMainSequenceEffectSeen) if (mbNonUserTriggeredMainSequenceEffectSeen)

View File

@@ -129,6 +129,7 @@ private:
::std::shared_ptr<ScreenUpdater::UpdateLock> mpPaintLock; ::std::shared_ptr<ScreenUpdater::UpdateLock> mpPaintLock;
bool mbNonUserTriggeredMainSequenceEffectSeen; bool mbNonUserTriggeredMainSequenceEffectSeen;
bool mbHasAdvancedTimeSetting; // Slide has advanced time setting or not.
void initialize(); void initialize();