From c2e57626e5f6e59767032a1a2ebf7fd4cfdbcc54 Mon Sep 17 00:00:00 2001 From: Jan Holesovsky Date: Sat, 24 Nov 2012 18:37:39 +0100 Subject: Apply Style: Preview the text color too. Change-Id: Id9429b058842b1437e3d3cad171181ea604cc7fa --- svx/source/tbxctrls/tbcontrl.cxx | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'svx') 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 -- cgit v1.2.3