riched20: Don't compare the colours if the old and new states are both auto.

Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Huw Davies 2017-04-05 14:02:08 +01:00 committed by Alexandre Julliard
parent 71cc41b932
commit 5f3772a730
1 changed files with 2 additions and 2 deletions

View File

@ -769,14 +769,14 @@ ME_StreamOutRTFCharProps(ME_OutStream *pStream, CHARFORMAT2W *fmt)
} }
if ((old_fmt->dwEffects ^ fmt->dwEffects) & CFE_AUTOBACKCOLOR || if ((old_fmt->dwEffects ^ fmt->dwEffects) & CFE_AUTOBACKCOLOR ||
old_fmt->crBackColor != fmt->crBackColor) (!(fmt->dwEffects & CFE_AUTOBACKCOLOR) && old_fmt->crBackColor != fmt->crBackColor))
{ {
if (fmt->dwEffects & CFE_AUTOBACKCOLOR) i = 0; if (fmt->dwEffects & CFE_AUTOBACKCOLOR) i = 0;
else find_color_in_colortbl( pStream, fmt->crBackColor, &i ); else find_color_in_colortbl( pStream, fmt->crBackColor, &i );
sprintf(props + strlen(props), "\\cb%u", i); sprintf(props + strlen(props), "\\cb%u", i);
} }
if ((old_fmt->dwEffects ^ fmt->dwEffects) & CFE_AUTOCOLOR || if ((old_fmt->dwEffects ^ fmt->dwEffects) & CFE_AUTOCOLOR ||
old_fmt->crTextColor != fmt->crTextColor) (!(fmt->dwEffects & CFE_AUTOCOLOR) && old_fmt->crTextColor != fmt->crTextColor))
{ {
if (fmt->dwEffects & CFE_AUTOCOLOR) i = 0; if (fmt->dwEffects & CFE_AUTOCOLOR) i = 0;
else find_color_in_colortbl( pStream, fmt->crTextColor, &i ); else find_color_in_colortbl( pStream, fmt->crTextColor, &i );