diff options
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 b4f5303ff383..b55d9ad6e5c8 100644 --- a/editeng/source/items/textitem.cxx +++ b/editeng/source/items/textitem.cxx @@ -1830,6 +1830,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 ---------------------------------------------------- |