diff options
author | Jan Holesovsky <kendy@suse.cz> | 2012-11-24 18:37:39 +0100 |
---|---|---|
committer | Jan Holesovsky <kendy@suse.cz> | 2012-11-24 20:09:19 +0100 |
commit | c2e57626e5f6e59767032a1a2ebf7fd4cfdbcc54 (patch) | |
tree | a2ac818b8956cc8ba60940dd542400327755d25b /svx | |
parent | 7e862a2dff0941678cc57b9fe796803874096ba0 (diff) |
Apply Style: Preview the text color too.
Change-Id: Id9429b058842b1437e3d3cad171181ea604cc7fa
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/tbxctrls/tbcontrl.cxx | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index 08a7edb68d8a..7a0a974e6e5d 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -558,9 +558,6 @@ void SvxStyleBox_Impl::UserDraw( const UserDrawEvent& rUDEvt ) { const SfxItemSet& aItemSet = pStyle->GetItemSet(); - // all the font properties - //const SvxColorItem *pColorItem = static_cast< const SvxColorItem* >( aItemSet.GetItem( SID_ATTR_CHAR_COLOR ) ); - const SvxFontItem *pFontItem = static_cast< const SvxFontItem* >( aItemSet.GetItem( SID_ATTR_CHAR_FONT ) ); const SvxFontHeightItem *pFontHeightItem = static_cast< const SvxFontHeightItem* >( aItemSet.GetItem( SID_ATTR_CHAR_FONTHEIGHT ) ); @@ -585,10 +582,18 @@ void SvxStyleBox_Impl::UserDraw( const UserDrawEvent& rUDEvt ) // setup the device & draw Font aOldFont( pDevice->GetFont() ); - //Color aOldColor( pDevice->GetTextColor() ); + Color aOldColor( pDevice->GetTextColor() ); pDevice->SetFont( aFont ); - //pDevice->SetTextColor( pColorItem->GetValue() ); + + // text color, when we are not selected + pItem = aItemSet.GetItem( SID_ATTR_CHAR_COLOR ); + if ( pItem && rUDEvt.GetItemId() != GetSelectEntryPos() ) + { + Color aColor( static_cast< const SvxColorItem* >( pItem )->GetValue() ); + if ( aColor != COL_AUTO ) + pDevice->SetTextColor( aColor ); + } // 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 @@ -604,7 +609,7 @@ void SvxStyleBox_Impl::UserDraw( const UserDrawEvent& rUDEvt ) pDevice->DrawText( aPos, aStyleName ); - //pDevice->SetTextColor( aOldColor ); + pDevice->SetTextColor( aOldColor ); pDevice->SetFont( aOldFont ); // draw separator, if present |