diff options
author | Katarina Behrens <Katarina.Behrens@cib.de> | 2015-06-09 11:53:12 +0200 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2015-08-06 12:22:26 +0200 |
commit | f0e183707dd4edf3d4cc41f5e857044244973607 (patch) | |
tree | adf3fe21a3ad7722528b5050d4aa54377d8cca32 /editeng | |
parent | 30595fdd008228c4dbf64b46a59d59d53a1f2b21 (diff) |
tdf#88295: Don't export transparent background colour as white
The fix is twofold:
1. retrieve transparency from colour in SvxBackgroundColorItem
(add QueryValue, PutValue methods, use additional memberID to
retrieve alpha channel as a bool property)
2. add CharBackTransparent bool property to Draw [text] shapes
Change-Id: I6e14b81cc82f6b4d7fdd4756ff2e4f75e9270361
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/items/textitem.cxx | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/editeng/source/items/textitem.cxx b/editeng/source/items/textitem.cxx index dd7f4e0e2c65..40bf333bc7b3 100644 --- a/editeng/source/items/textitem.cxx +++ b/editeng/source/items/textitem.cxx @@ -1871,6 +1871,51 @@ SfxPoolItem* SvxBackgroundColorItem::Create(SvStream& rStrm, sal_uInt16 ) const return new SvxBackgroundColorItem( rStrm, Which() ); } +bool SvxBackgroundColorItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const +{ + nMemberId &= ~CONVERT_TWIPS; + Color aColor = SvxColorItem::GetValue(); + + switch( nMemberId ) + { + case MID_GRAPHIC_TRANSPARENT: + { + rVal <<= Bool2Any (aColor.GetTransparency() == 0xff); + break; + } + default: + { + rVal <<= (sal_Int32)(aColor.GetColor()); + break; + } + } + return true; +} + +bool SvxBackgroundColorItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) +{ + nMemberId &= ~CONVERT_TWIPS; + sal_Int32 nColor = 0; + Color aColor = SvxColorItem::GetValue(); + + switch( nMemberId ) + { + case MID_GRAPHIC_TRANSPARENT: + { + aColor.SetTransparency( Any2Bool( rVal ) ? 0xff : 0 ); + SvxColorItem::SetValue( aColor ); + break; + } + default: + { + if(!(rVal >>= nColor)) + return false; + SvxColorItem::SetValue( Color(nColor) ); + break; + } + } + return true; +} // class SvxColorItem ---------------------------------------------------- |