slideshow/source/engine/effectrewinder.cxx | 42 +++++++++-------------------- 1 file changed, 14 insertions(+), 28 deletions(-)
New commits: commit 182bc52b79750afd52b5eb940f1f9261dc5c9c0e Author: shlok3640 <[email protected]> AuthorDate: Sat Dec 6 18:27:34 2025 +0000 Commit: Mike Kaganski <[email protected]> CommitDate: Sat Dec 13 08:35:22 2025 +0100 tdf#165233 Replace std::bind with lambda in EffectRewinder Replaces the legacy std::bind usages with modern C++ lambdas in EffectRewinder. This improves readability and avoids the need for std::bind and std::placeholders. Change-Id: If0f0f52d02a3b89327feaf01cd0f7f0f3d290501 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195174 Tested-by: Jenkins Reviewed-by: Mike Kaganski <[email protected]> diff --git a/slideshow/source/engine/effectrewinder.cxx b/slideshow/source/engine/effectrewinder.cxx index 4bfc8990673b..25db18b3e7e5 100644 --- a/slideshow/source/engine/effectrewinder.cxx +++ b/slideshow/source/engine/effectrewinder.cxx @@ -201,25 +201,19 @@ bool EffectRewinder::rewind ( // No main sequence effects to rewind on the current slide. // Go back to the previous slide. - mpAsynchronousRewindEvent = makeEvent( - ::std::bind( - &EffectRewinder::asynchronousRewindToPreviousSlide, - this, - rPreviousSlideFunctor), - u"EffectRewinder::asynchronousRewindToPreviousSlide"_ustr); + mpAsynchronousRewindEvent + = makeEvent(([this, rPreviousSlideFunctor]() + { asynchronousRewindToPreviousSlide(rPreviousSlideFunctor); }), + u"EffectRewinder::asynchronousRewindToPreviousSlide"_ustr); } else { // The actual rewinding is done asynchronously so that we can safely // call other methods. - mpAsynchronousRewindEvent = makeEvent( - ::std::bind( - &EffectRewinder::asynchronousRewind, - this, - nSkipCount, - true, - rSlideRewindFunctor), - u"EffectRewinder::asynchronousRewind"_ustr); + mpAsynchronousRewindEvent + = makeEvent(([this, nSkipCount, rSlideRewindFunctor]() + { asynchronousRewind(nSkipCount, true, rSlideRewindFunctor); }), + u"EffectRewinder::asynchronousRewind"_ustr); } if (mpAsynchronousRewindEvent) @@ -240,12 +234,8 @@ void EffectRewinder::skipAllMainSequenceEffects() const int nTotalMainSequenceEffectCount (countMainSequenceEffects()); mpAsynchronousRewindEvent = makeEvent( - ::std::bind( - &EffectRewinder::asynchronousRewind, - this, - nTotalMainSequenceEffectCount, - false, - ::std::function<void ()>()), + ([this, nTotalMainSequenceEffectCount]() + { asynchronousRewind(nTotalMainSequenceEffectCount, false, ::std::function<void()>()); }), u"EffectRewinder::asynchronousRewind"_ustr); mrEventQueue.addEvent(mpAsynchronousRewindEvent); } @@ -356,14 +346,10 @@ void EffectRewinder::asynchronousRewind ( // Re-display the current slide. if (rSlideRewindFunctor) rSlideRewindFunctor(); - mpAsynchronousRewindEvent = makeEvent( - ::std::bind( - &EffectRewinder::asynchronousRewind, - this, - nEffectCount, - false, - rSlideRewindFunctor), - u"EffectRewinder::asynchronousRewind"_ustr); + mpAsynchronousRewindEvent + = makeEvent(([this, nEffectCount, rSlideRewindFunctor]() + { asynchronousRewind(nEffectCount, false, rSlideRewindFunctor); }), + u"EffectRewinder::asynchronousRewind"_ustr); mrEventQueue.addEvent(mpAsynchronousRewindEvent); } else
