vcl/source/gdi/bitmapex.cxx                  |    1 +
 vcl/source/graphic/UnoGraphicTransformer.cxx |    3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 560f8935c3b9d854128d414753f871fa38c6da2a
Author:     Bartosz Kosiorek <gan...@poczta.onet.pl>
AuthorDate: Tue Nov 3 16:48:08 2020 +0100
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Thu Nov 19 12:41:06 2020 +0100

    tdf#113163 OOXML Fix transparency and alpha channel support
    
    In OOXML specification there is a:clrChange tag,
    which change color from image, to another colour and transparency:
    
https://docs.microsoft.com/en-us/openspecs/office_standards/ms-oi29500/5860f816-13d3-4a83-9e63-bcd1e0808404
    Unfortunately It was not working correctly.
    
    This patch is resolving that issue
    
    Change-Id: I85e3790f86382dca2c4798346021f480e50db6e9
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105258
    Tested-by: Jenkins
    Reviewed-by: Bartosz Kosiorek <gan...@poczta.onet.pl>
    (cherry picked from commit 4a288c136c66b4dfbb75764602520d48c39fee81)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105990
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/vcl/source/gdi/bitmapex.cxx b/vcl/source/gdi/bitmapex.cxx
index 80c6879af00c..f7e80fd72a4b 100644
--- a/vcl/source/gdi/bitmapex.cxx
+++ b/vcl/source/gdi/bitmapex.cxx
@@ -1558,6 +1558,7 @@ void BitmapEx::setAlphaFrom( sal_uInt8 cIndexFrom, 
sal_Int8 nAlphaTo )
             }
         }
     }
+    *this = BitmapEx( GetBitmap(), aAlphaMask );
 }
 
 void BitmapEx::AdjustTransparency(sal_uInt8 cTrans)
diff --git a/vcl/source/graphic/UnoGraphicTransformer.cxx 
b/vcl/source/graphic/UnoGraphicTransformer.cxx
index 2a7f6eef5a42..100e37b29a92 100644
--- a/vcl/source/graphic/UnoGraphicTransformer.cxx
+++ b/vcl/source/graphic/UnoGraphicTransformer.cxx
@@ -54,6 +54,7 @@ uno::Reference< graphic::XGraphic > SAL_CALL 
GraphicTransformer::colorChange(
 
     const sal_uInt8 cIndexFrom = aBmpColorFrom.GetIndex();
 
+    //TODO This code convert GdiMetafile(vector graphic) to Bitmap, which 
cause to information lost
     if (aGraphic.GetType() == GraphicType::Bitmap ||
         aGraphic.GetType() == GraphicType::GdiMetafile)
     {
@@ -62,7 +63,7 @@ uno::Reference< graphic::XGraphic > SAL_CALL 
GraphicTransformer::colorChange(
 
         if (aBitmapEx.IsAlpha())
         {
-            aBitmapEx.setAlphaFrom( cIndexFrom, nAlphaTo );
+            aBitmapEx.setAlphaFrom( cIndexFrom, 0xff - nAlphaTo );
             aBitmapEx.Replace(aColorFrom, aColorTo, nTolerance);
             aReturnGraphic = ::Graphic(aBitmapEx);
         }
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to