svx/source/tbxctrls/tbcontrl.cxx | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
New commits: commit d44914633ac1b52691cf7c33d1dea2115df6e109 Author: Jan Holesovsky <ke...@suse.cz> Date: Sun Nov 25 15:02:05 2012 +0100 Apply Style: Support styles with background. Change-Id: Iff3e3c4f3bd2ea09c39db80ed5400efadeafee30 diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index b0b4d29..3e0ed94 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -616,6 +616,7 @@ void SvxStyleBox_Impl::UserDraw( const UserDrawEvent& rUDEvt ) // setup the device & draw Font aOldFont( pDevice->GetFont() ); Color aOldColor( pDevice->GetTextColor() ); + Color aOldFillColor( pDevice->GetFillColor() ); pDevice->SetFont( aFont ); @@ -628,6 +629,18 @@ void SvxStyleBox_Impl::UserDraw( const UserDrawEvent& rUDEvt ) pDevice->SetTextColor( aColor ); } + // background color + pItem = aItemSet.GetItem( SID_ATTR_BRUSH ); + if ( pItem && rUDEvt.GetItemId() != GetSelectEntryPos() ) + { + Color aColor( static_cast< const SvxBrushItem* >( pItem )->GetColor() ); + if ( aColor != COL_AUTO ) + { + pDevice->SetFillColor( aColor ); + pDevice->DrawRect( rUDEvt.GetRect() ); + } + } + // IMG_TXT_DISTANCE in ilstbox.hxx is 6, then 1 is added as // nBorder, and we are adding 1 in order to look better when // italics is present @@ -652,6 +665,7 @@ void SvxStyleBox_Impl::UserDraw( const UserDrawEvent& rUDEvt ) pDevice->DrawText( aPos, aStyleName ); + pDevice->SetFillColor( aOldFillColor ); pDevice->SetTextColor( aOldColor ); pDevice->SetFont( aOldFont ); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits