Kaydet (Commit) d83b1383 authored tarafından Adrien Ollier's avatar Adrien Ollier Kaydeden (comit) Noel Grandin

using an algorithm of the STL

makes the function shorter

Change-Id: I22118d9b86e5497cb9b566efe9151f2da646cb16
Signed-off-by: 's avatarAdrien Ollier <adr.ollier@hotmail.fr>
Reviewed-on: https://gerrit.libreoffice.org/71806
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 007d6b5b
......@@ -17,6 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <algorithm>
#include <sal/config.h>
#include <tools/stream.hxx>
......@@ -107,28 +108,20 @@ void Animation::Clear()
bool Animation::IsTransparent() const
{
tools::Rectangle aRect(Point(), maGlobalSize);
bool bRet = false;
tools::Rectangle aRect{ Point(), maGlobalSize };
// If some small bitmap needs to be replaced by the background,
// we need to be transparent, in order to be displayed correctly
// as the application (?) does not invalidate on non-transparent
// graphics due to performance reasons.
for (auto const& pAnimationBitmap : maList)
{
if (Disposal::Back == pAnimationBitmap->meDisposal
&& tools::Rectangle(pAnimationBitmap->maPositionPixel, pAnimationBitmap->maSizePixel)
!= aRect)
{
bRet = true;
break;
}
}
if (!bRet)
bRet = maBitmapEx.IsTransparent();
return bRet;
return std::any_of(maList.begin(), maList.end(),
[&aRect](const std::unique_ptr<AnimationBitmap>& pAnim) -> bool {
return pAnim->meDisposal == Disposal::Back
&& tools::Rectangle{ pAnim->maPositionPixel, pAnim->maSizePixel }
!= aRect;
})
|| maBitmapEx.IsTransparent();
}
sal_uLong Animation::GetSizeBytes() const
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment