[RICHED20] Sync with Wine Staging 2.9. CORE-13362

d4b1938 riched20: Only write out non-default pattern colours.
5f3772a riched20: Don't compare the colours if the old and new states are both auto.
6bcf4d6 riched20: Add linefeeds after the colortbl and generator groups.
8b79854 riched20: Remove a hack that should be longer be needed.
3d291dd riched20: Write the char format for the end-of-paragraph marker.

svn path=/trunk/; revision=74841
This commit is contained in:
Amine Khaldi 2017-06-03 22:36:44 +00:00
parent 35e1e225d6
commit 5c6a327cb8
2 changed files with 12 additions and 15 deletions

View file

@ -377,14 +377,6 @@ ME_StreamOutRTFFontAndColorTbl(ME_OutStream *pStream, ME_DisplayItem *pFirstRun,
if (!ME_StreamOutPrint(pStream, "}\r\n"))
return FALSE;
/* It seems like Open Office ignores \deff0 tag at RTF-header.
As result it can't correctly parse text before first \fN tag,
so we can put \f0 immediately after font table. This forces
parser to use the same font, that \deff0 specifies.
It makes OOffice happy */
if (!ME_StreamOutPrint(pStream, "\\f0"))
return FALSE;
/* Output the color table */
if (!ME_StreamOutPrint(pStream, "{\\colortbl;")) return FALSE; /* first entry is auto-color */
for (i = 1; i < pStream->nColorTblLen; i++)
@ -393,7 +385,7 @@ ME_StreamOutRTFFontAndColorTbl(ME_OutStream *pStream, ME_DisplayItem *pFirstRun,
(pStream->colortbl[i] >> 8) & 0xFF, (pStream->colortbl[i] >> 16) & 0xFF))
return FALSE;
}
if (!ME_StreamOutPrint(pStream, "}")) return FALSE;
if (!ME_StreamOutPrint(pStream, "}\r\n")) return FALSE;
return TRUE;
}
@ -726,8 +718,10 @@ ME_StreamOutRTFParaProps(ME_TextEditor *editor, ME_OutStream *pStream,
sprintf(props + strlen(props), "\\shading%d", fmt->wShadingWeight);
if (fmt->wShadingStyle & 0xF)
strcat(props, style[fmt->wShadingStyle & 0xF]);
sprintf(props + strlen(props), "\\cfpat%d\\cbpat%d",
(fmt->wShadingStyle >> 4) & 0xF, (fmt->wShadingStyle >> 8) & 0xF);
if ((fmt->wShadingStyle >> 4) & 0xf)
sprintf(props + strlen(props), "\\cfpat%d", (fmt->wShadingStyle >> 4) & 0xf);
if ((fmt->wShadingStyle >> 8) & 0xf)
sprintf(props + strlen(props), "\\cbpat%d", (fmt->wShadingStyle >> 8) & 0xf);
}
if (*props)
strcat(props, " ");
@ -772,14 +766,14 @@ ME_StreamOutRTFCharProps(ME_OutStream *pStream, CHARFORMAT2W *fmt)
}
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;
else find_color_in_colortbl( pStream, fmt->crBackColor, &i );
sprintf(props + strlen(props), "\\cb%u", i);
}
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;
else find_color_in_colortbl( pStream, fmt->crTextColor, &i );
@ -1020,7 +1014,7 @@ static BOOL ME_StreamOutRTF(ME_TextEditor *editor, ME_OutStream *pStream,
/* TODO: stylesheet table */
if (!ME_StreamOutPrint(pStream, "{\\*\\generator Wine Riched20 2.0;}"))
if (!ME_StreamOutPrint(pStream, "{\\*\\generator Wine Riched20 2.0;}\r\n"))
return FALSE;
/* TODO: information group */
@ -1069,6 +1063,9 @@ static BOOL ME_StreamOutRTF(ME_TextEditor *editor, ME_OutStream *pStream,
}
nChars--;
} else if (cursor.pRun->member.run.nFlags & MERF_ENDPARA) {
if (!ME_StreamOutRTFCharProps(pStream, &cursor.pRun->member.run.style->fmt))
return FALSE;
if (cursor.pPara->member.para.fmt.dwMask & PFM_TABLE &&
cursor.pPara->member.para.fmt.wEffects & PFE_TABLE &&
!(cursor.pPara->member.para.nFlags & (MEPF_ROWSTART|MEPF_ROWEND|MEPF_CELL)))

View file

@ -158,7 +158,7 @@ reactos/dll/win32/qmgrprxy # Synced to WineStaging-1.9.11
reactos/dll/win32/query # Synced to WineStaging-1.9.11
reactos/dll/win32/rasapi32 # Synced to WineStaging-1.9.11
reactos/dll/win32/resutils # Synced to WineStaging-1.9.11
reactos/dll/win32/riched20 # Synced to WineStaging-2.2
reactos/dll/win32/riched20 # Synced to WineStaging-2.9
reactos/dll/win32/riched32 # Synced to WineStaging-1.9.11
reactos/dll/win32/rpcrt4 # Synced to WineStaging-2.2
reactos/dll/win32/rsabase # Synced to WineStaging-1.9.11