summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2019-03-13 17:23:42 +0100
committerTomaž Vajngerl <quikee@gmail.com>2019-03-20 13:34:05 +0100
commit6cf42adde156ab9931641feacaa523c3d8991ac7 (patch)
tree0235f472f576b161af9aad8c7129e2e5200442fe
parent2761709acf77b1f64d76d5828d09ad9e7d9dc4cb (diff)
fix transparency handling in BitmapEx::GetPixelColor()
Apparently the Color class uses transparency as the opposite of the normally used meaning of opacity, so transparency 255 means transparent. Change-Id: I3a76c2c93d98ad3c850017d3fd569b04dc6c19c8 Reviewed-on: https://gerrit.libreoffice.org/69211 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport10.cxx2
-rw-r--r--vcl/source/gdi/bitmapex.cxx2
2 files changed, 2 insertions, 2 deletions
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx
index 254ae993d1bd..991ab0616cec 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx
@@ -585,7 +585,7 @@ DECLARE_OOXMLEXPORT_TEST(testMsoBrightnessContrast, "msobrightnesscontrast.docx"
CPPUNIT_ASSERT_EQUAL(58L, aBitmap.GetSizePixel().Width());
CPPUNIT_ASSERT_EQUAL(320L, aBitmap.GetSizePixel().Height());
Color aColor(aBitmap.GetPixelColor(20, 30));
- CPPUNIT_ASSERT_EQUAL(Color( 255, 0xce, 0xce, 0xce ), aColor);
+ CPPUNIT_ASSERT_EQUAL(Color( 0xce, 0xce, 0xce ), aColor);
}
DECLARE_OOXMLEXPORT_TEST(testChartSize, "chart-size.docx")
diff --git a/vcl/source/gdi/bitmapex.cxx b/vcl/source/gdi/bitmapex.cxx
index 519a7a385371..a6820872578e 100644
--- a/vcl/source/gdi/bitmapex.cxx
+++ b/vcl/source/gdi/bitmapex.cxx
@@ -758,7 +758,7 @@ Color BitmapEx::GetPixelColor(sal_Int32 nX, sal_Int32 nY) const
aColor.SetTransparency( pAlphaReadAccess->GetPixel( nY, nX ).GetIndex() );
}
else
- aColor.SetTransparency(255);
+ aColor.SetTransparency( 0 );
return aColor;
}