summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorMuthu Subramanian <sumuthu@collabora.com>2013-10-10 18:03:51 +0530
committerMuthu Subramanian <sumuthu@collabora.com>2013-10-10 18:05:36 +0530
commitefbf0b412bc76149b410d0cd17c7040513d4c203 (patch)
tree698daf422384bddf97e457abb44ac4ef822d3991 /svtools
parent215269e3031e31fd64e3aa38167875a042b8c80c (diff)
n#812793: clrChange applying for EMFs
Also fixed alpha clrChanges.
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/graphic/transformer.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/svtools/source/graphic/transformer.cxx b/svtools/source/graphic/transformer.cxx
index 0b0381b517fd..30f07c7af197 100644
--- a/svtools/source/graphic/transformer.cxx
+++ b/svtools/source/graphic/transformer.cxx
@@ -86,7 +86,7 @@ uno::Reference< graphic::XGraphic > SAL_CALL GraphicTransformer::colorChange(
BitmapColor aColorTo( static_cast< sal_uInt8 >( nColorTo ), static_cast< sal_uInt8 >( nColorTo >> 8 ), static_cast< sal_uInt8 >( nColorTo >> 16 ) );
const sal_uInt8 cIndexFrom = aColorFrom.GetBlueOrIndex();
- if ( aGraphic.GetType() == GRAPHIC_BITMAP )
+ if ( aGraphic.GetType() == GRAPHIC_BITMAP || aGraphic.GetType() == GRAPHIC_GDIMETAFILE )
{
BitmapEx aBitmapEx( aGraphic.GetBitmapEx() );
Bitmap aBitmap( aBitmapEx.GetBitmap() );
@@ -100,7 +100,7 @@ uno::Reference< graphic::XGraphic > SAL_CALL GraphicTransformer::colorChange(
}
else if ( aBitmapEx.IsTransparent() )
{
- if ( ( nAlphaTo == 0 ) || ( nAlphaTo == sal::static_int_cast<sal_Int8>(0xff) ) )
+ if ( nAlphaTo == sal::static_int_cast<sal_Int8>(0xff) )
{
Bitmap aMask( aBitmapEx.GetMask() );
Bitmap aMask2( aBitmap.CreateMask( aColorFrom, nTolerance ) );
@@ -111,7 +111,7 @@ uno::Reference< graphic::XGraphic > SAL_CALL GraphicTransformer::colorChange(
else
{
AlphaMask aAlphaMask( aBitmapEx.GetMask() );
- setAlpha( aBitmap, aAlphaMask, cIndexFrom, nAlphaTo );
+ setAlpha( aBitmap, aAlphaMask, cIndexFrom, 0xff - nAlphaTo );
aBitmap.Replace( aColorFrom, aColorTo, nTolerance );
aGraphic = ::Graphic( BitmapEx( aBitmap, aAlphaMask ) );
}