vcl/source/gdi/metaact.cxx |   15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

New commits:
commit 0b32055f17391ce238c157c5dc322407e76c0f06
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Tue Sep 2 14:03:01 2025 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Tue Sep 2 15:46:12 2025 +0200

    add some assert to MetaBmp*
    
    just in case my BitmapEx->Bitmap work ends up sending a Bitmap with alpha 
to the wrong place
    
    Change-Id: I08bd8a78c88b59b7b5728e0a411b6135b681ea00
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190524
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>
    Tested-by: Jenkins

diff --git a/vcl/source/gdi/metaact.cxx b/vcl/source/gdi/metaact.cxx
index 6f7858ea8f82..ea527fa8c89a 100644
--- a/vcl/source/gdi/metaact.cxx
+++ b/vcl/source/gdi/metaact.cxx
@@ -910,10 +910,13 @@ MetaBmpAction::MetaBmpAction( const Point& rPt, const 
Bitmap& rBmp ) :
     MetaAction  ( MetaActionType::BMP ),
     maBmp       ( rBmp ),
     maPt        ( rPt )
-{}
+{
+    assert(!rBmp.HasAlpha() && "caller should be using MetaBmpExAction");
+}
 
 void MetaBmpAction::Execute( OutputDevice* pOut )
 {
+    assert(!maBmp.HasAlpha() && "caller should be using MetaBmpExAction");
     pOut->DrawBitmap( maPt, maBmp );
 }
 
@@ -945,7 +948,9 @@ MetaBmpScaleAction::MetaBmpScaleAction( const Point& rPt, 
const Size& rSz,
     maBmp       ( rBmp ),
     maPt        ( rPt ),
     maSz        ( rSz )
-{}
+{
+    assert(!rBmp.HasAlpha() && "caller should be using MetaBmpExScaleAction");
+}
 
 static bool AllowScale(const Size& rSource, const Size& rDest)
 {
@@ -988,6 +993,7 @@ static bool AllowScale(const Size& rSource, const Size& 
rDest)
 
 void MetaBmpScaleAction::Execute( OutputDevice* pOut )
 {
+    assert(!maBmp.HasAlpha() && "caller should be using MetaBmpExScaleAction");
     Size aPixelSize(pOut->LogicToPixel(maSz));
     if (!AllowRect(tools::Rectangle(pOut->LogicToPixel(maPt), aPixelSize)) ||
         !AllowScale(maBmp.GetSizePixel(), aPixelSize))
@@ -1032,10 +1038,13 @@ MetaBmpScalePartAction::MetaBmpScalePartAction( const 
Point& rDstPt, const Size&
     maDstSz     ( rDstSz ),
     maSrcPt     ( rSrcPt ),
     maSrcSz     ( rSrcSz )
-{}
+{
+    assert(!rBmp.HasAlpha() && "caller should be using 
MetaBmpExScalePartAction");
+}
 
 void MetaBmpScalePartAction::Execute( OutputDevice* pOut )
 {
+    assert(!maBmp.HasAlpha() && "caller should be using 
MetaBmpExScalePartAction");
     if (!AllowRect(pOut->LogicToPixel(tools::Rectangle(maDstPt, maDstSz))))
         return;
 

Reply via email to