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++)
(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;
}
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, " ");
}
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 );
/* 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 */
}
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)))