diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c index 31d134f97f2..98c7414a5b3 100644 --- a/dlls/riched20/editor.c +++ b/dlls/riched20/editor.c @@ -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 */ diff --git a/dlls/riched20/reader.c b/dlls/riched20/reader.c index e5202aabe4b..0972911d9bb 100644 --- a/dlls/riched20/reader.c +++ b/dlls/riched20/reader.c @@ -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 diff --git a/dlls/riched20/rtf.h b/dlls/riched20/rtf.h index 064ba603e68..335d098f6e8 100644 --- a/dlls/riched20/rtf.h +++ b/dlls/riched20/rtf.h @@ -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