From 47198579f52eea35d669b5c941966905619a4c1d Mon Sep 17 00:00:00 2001 From: Frank Meies Date: Thu, 20 Jun 2002 09:14:26 +0000 Subject: [PATCH] #100497# Use window text color if font color is set to auto color --- sw/source/core/txtnode/fntcache.cxx | 60 ++++++++++------------------- 1 file changed, 20 insertions(+), 40 deletions(-) diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx index c78317354324..da79732e43db 100644 --- a/sw/source/core/txtnode/fntcache.cxx +++ b/sw/source/core/txtnode/fntcache.cxx @@ -2,9 +2,9 @@ * * $RCSfile: fntcache.cxx,v $ * - * $Revision: 1.45 $ + * $Revision: 1.46 $ * - * last change: $Author: fme $ $Date: 2002-06-20 09:44:17 $ + * last change: $Author: fme $ $Date: 2002-06-20 10:14:26 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -2270,48 +2270,28 @@ sal_Bool SwDrawTextInfo::ApplyAutoColor( Font* pFnt ) pCol = NULL; } - // !!! EINSCHUB BEGIN if ( ! pCol ) - pCol = &aGlobalRetoucheColor; - - sal_Bool bDarkBack = DARK_COLOR > pCol->GetRed() + - pCol->GetGreen() + - pCol->GetBlue(); - - if( GetShell() && GetShell()->GetWin() ) { - const StyleSettings& rS = GetShell()->GetWin()-> - GetSettings().GetStyleSettings(); - nNewColor = bDarkBack ? - COL_WHITE : - rS.GetWindowTextColor().GetColor(); + // no user defined color at paragraph or font background + if( GetShell() && GetShell()->GetWin() ) + { + // we take the window text color for painting + nNewColor = GetShell()->GetWin()->GetSettings(). + GetStyleSettings().GetWindowTextColor(). + GetColor(); + } + else + pCol = &aGlobalRetoucheColor; } - else - nNewColor = bDarkBack ? COL_WHITE : COL_BLACK; - /// !!! EINSCHUB END -// if ( ! pCol ) -// { -// // no user defined color at paragraph or font background -// if( GetShell() && GetShell()->GetWin() ) -// { -// // we take the window text color for painting -// nNewColor = GetShell()->GetWin()->GetSettings(). -// GetStyleSettings().GetWindowTextColor(). -// GetColor(); -// } -// else -// pCol = &aGlobalRetoucheColor; -// } - -// if ( pCol ) -// { -// // we invert the color set at the background -// nNewColor = ( DARK_COLOR > pCol->GetRed() + -// pCol->GetGreen() + -// pCol->GetBlue() ) ? -// COL_WHITE : COL_BLACK; -// } + if ( pCol ) + { + // we invert the color set at the background + nNewColor = ( DARK_COLOR > pCol->GetRed() + + pCol->GetGreen() + + pCol->GetBlue() ) ? + COL_WHITE : COL_BLACK; + } } }