diff options
author | Katarina Behrens <Katarina.Behrens@cib.de> | 2015-06-09 11:53:12 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2015-06-10 14:29:09 +0000 |
commit | 321f4925a79b74cfd0aea2221a74dd2717e6b8b2 (patch) | |
tree | 6e11f9325ddfc5cfa624aea3ef234f8b92c33c42 /editeng/source/items | |
parent | 62751ab180bdebc0af03d114519cada7f0e7fd40 (diff) |
tdf#88055: 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,
xmloff needs it to be able to output 'transparent' string instead of
'#XXYYZZ' colour code in ODF format
Change-Id: Id830bd18fd6da5d9a46e2a94aa254d5d2a6b7ebb
Reviewed-on: https://gerrit.libreoffice.org/16182
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Tested-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'editeng/source/items')
-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 fa29b6a5c730..d031f10548ca 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()); + 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 ---------------------------------------------------- |