summaryrefslogtreecommitdiff
path: root/svx/source
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@suse.cz>2012-11-25 15:02:05 +0100
committerJan Holesovsky <kendy@suse.cz>2012-11-25 15:02:54 +0100
commitd44914633ac1b52691cf7c33d1dea2115df6e109 (patch)
tree0cba80161d9dadc010b6e3e34e0e5085b4249b76 /svx/source
parentd02dc1da4a3cff852b4f29bef2fb8ce88140ef7b (diff)
Apply Style: Support styles with background.
Change-Id: Iff3e3c4f3bd2ea09c39db80ed5400efadeafee30
Diffstat (limited to 'svx/source')
-rw-r--r--svx/source/tbxctrls/tbcontrl.cxx14
1 files changed, 14 insertions, 0 deletions
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index b0b4d29e9b90..3e0ed94b970e 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 );