vcl/source/helper/canvasbitmap.cxx |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

New commits:
commit 4ddfdeefe78e725b8d28fd60dbe32e7f4f054724
Author:     Noel Grandin <noelgran...@gmail.com>
AuthorDate: Fri Jan 6 19:07:10 2023 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Sat Jan 7 11:29:52 2023 +0000

    remove dead code
    
    we already know the IsAlpha is true from the outer if condition
    
    Change-Id: I627a9b952cb63154baf773b6162b422de4f253bc
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145157
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/vcl/source/helper/canvasbitmap.cxx 
b/vcl/source/helper/canvasbitmap.cxx
index 3f8507178b4f..2e7a83bbb132 100644
--- a/vcl/source/helper/canvasbitmap.cxx
+++ b/vcl/source/helper/canvasbitmap.cxx
@@ -1099,7 +1099,6 @@ uno::Sequence<rendering::ARGBColor> SAL_CALL 
VclCanvasBitmap::convertIntegerToAR
     {
         const tools::Long      nNonAlphaBytes( (m_nBitsPerInputPixel+7)/8 );
         const sal_Int32 nBytesPerPixel((m_nBitsPerOutputPixel+7)/8);
-        const sal_uInt8 nAlphaFactor( m_aBmpEx.IsAlpha() ? 1 : 255 );
         for( std::size_t i=0; i<nLen; i+=nBytesPerPixel )
         {
             // if palette, index is guaranteed to be 8 bit
@@ -1109,7 +1108,7 @@ uno::Sequence<rendering::ARGBColor> SAL_CALL 
VclCanvasBitmap::convertIntegerToAR
                 pBmpAcc->GetPixelFromData(pIn,0);
 
             // TODO(F3): Convert result to sRGB color space
-            *pOut++ = rendering::ARGBColor(1.0 - 
toDoubleColor(nAlphaFactor*pIn[nNonAlphaBytes]),
+            *pOut++ = rendering::ARGBColor(1.0 - 
toDoubleColor(pIn[nNonAlphaBytes]),
                                            toDoubleColor(aCol.GetRed()),
                                            toDoubleColor(aCol.GetGreen()),
                                            toDoubleColor(aCol.GetBlue()));
@@ -1155,7 +1154,6 @@ uno::Sequence<rendering::ARGBColor> SAL_CALL 
VclCanvasBitmap::convertIntegerToPA
     {
         const tools::Long      nNonAlphaBytes( (m_nBitsPerInputPixel+7)/8 );
         const sal_Int32 nBytesPerPixel((m_nBitsPerOutputPixel+7)/8);
-        const sal_uInt8 nAlphaFactor( m_aBmpEx.IsAlpha() ? 1 : 255 );
         for( std::size_t i=0; i<nLen; i+=nBytesPerPixel )
         {
             // if palette, index is guaranteed to be 8 bit
@@ -1165,7 +1163,7 @@ uno::Sequence<rendering::ARGBColor> SAL_CALL 
VclCanvasBitmap::convertIntegerToPA
                 pBmpAcc->GetPixelFromData(pIn,0);
 
             // TODO(F3): Convert result to sRGB color space
-            const double nAlpha( 1.0 - 
toDoubleColor(nAlphaFactor*pIn[nNonAlphaBytes]) );
+            const double nAlpha( 1.0 - toDoubleColor(pIn[nNonAlphaBytes]) );
             *pOut++ = rendering::ARGBColor(nAlpha,
                                            nAlpha*toDoubleColor(aCol.GetRed()),
                                            
nAlpha*toDoubleColor(aCol.GetGreen()),

Reply via email to