Commit 2d23a95c authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

riched20: Add support for the \shppict destination.

parent cfc89142
......@@ -1236,6 +1236,35 @@ static BOOL ME_RTFInsertOleObject(RTF_Info *info, HENHMETAFILE hemf, HBITMAP hbm
return ret;
}
static void ME_RTFReadShpPictGroup( RTF_Info *info )
{
int level = 1;
for (;;)
{
RTFGetToken (info);
if (info->rtfClass == rtfEOF) return;
if (RTFCheckCM( info, rtfGroup, rtfEndGroup ))
{
if (--level == 0) break;
}
else if (RTFCheckCM( info, rtfGroup, rtfBeginGroup ))
{
level++;
}
else
{
RTFRouteToken( info );
if (RTFCheckCM( info, rtfGroup, rtfEndGroup ))
level--;
}
}
RTFRouteToken( info ); /* feed "}" back to router */
return;
}
static DWORD read_hex_data( RTF_Info *info, BYTE **out )
{
DWORD read = 0, size = 1024;
......@@ -1579,6 +1608,7 @@ static LRESULT ME_StreamIn(ME_TextEditor *editor, DWORD format, EDITSTREAM *stre
WriterInit(&parser);
RTFInit(&parser);
RTFSetReadHook(&parser, ME_RTFReadHook);
RTFSetDestinationCallback(&parser, rtfShpPict, ME_RTFReadShpPictGroup);
RTFSetDestinationCallback(&parser, rtfPict, ME_RTFReadPictGroup);
RTFSetDestinationCallback(&parser, rtfObject, ME_RTFReadObjectGroup);
if (!parser.editor->bEmulateVersion10) /* v4.1 */
......
......@@ -1808,6 +1808,8 @@ static RTFKey rtfKey[] =
{ rtfDestination, rtfNeXTGraphic, "NeXTGraphic", 0 },
{ rtfDestination, rtfNestTableProps, "nesttableprops", 0 },
{ rtfDestination, rtfNoNestTables, "nonesttables", 0 },
{ rtfDestination, rtfShpPict, "shppict", 0 },
{ rtfDestination, rtfNonShpPict, "nonshppict", 0 },
/*
* Font families
......
......@@ -184,7 +184,9 @@
# define rtfGenerator 74
# define rtfNestTableProps 75
# define rtfNoNestTables 76
# define rtfMaxDestination 77 /* highest dest + 1 */
# define rtfShpPict 77
# define rtfNonShpPict 78
# define rtfMaxDestination 79 /* highest dest + 1 */
# define rtfFontFamily 4
# define rtfFFNil 0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment