Commit 9a7d475d authored by Dylan Smith's avatar Dylan Smith Committed by Alexandre Julliard

richedit: Avoid acting on control words in skipped RTF groups.

Previously the control words in skipped groups were being processed by the read hook on the RTF parser. By moving this code into the class callbacks for the parser, the skipped groups actually remain skipped.
parent fc2404bc
......@@ -346,7 +346,7 @@ static void ME_ApplyBorderProperties(RTF_Info *info,
}
}
static void ME_RTFCharAttrHook(RTF_Info *info)
void ME_RTFCharAttrHook(RTF_Info *info)
{
CHARFORMAT2W fmt;
fmt.cbSize = sizeof(fmt);
......@@ -468,7 +468,7 @@ static void ME_RTFCharAttrHook(RTF_Info *info)
/* FIXME this function doesn't get any information about context of the RTF tag, which is very bad,
the same tags mean different things in different contexts */
static void ME_RTFParAttrHook(RTF_Info *info)
void ME_RTFParAttrHook(RTF_Info *info)
{
PARAFORMAT2 fmt;
fmt.cbSize = sizeof(fmt);
......@@ -825,7 +825,7 @@ static void ME_RTFParAttrHook(RTF_Info *info)
}
}
static void ME_RTFTblAttrHook(RTF_Info *info)
void ME_RTFTblAttrHook(RTF_Info *info)
{
switch (info->rtfMinor)
{
......@@ -896,7 +896,7 @@ static void ME_RTFTblAttrHook(RTF_Info *info)
}
}
static void ME_RTFSpecialCharHook(RTF_Info *info)
void ME_RTFSpecialCharHook(RTF_Info *info)
{
RTFTable *tableDef = info->tableDef;
switch (info->rtfMinor)
......@@ -1325,7 +1325,8 @@ static void ME_RTFReadObjectGroup(RTF_Info *info)
RTFRouteToken(info); /* feed "}" back to router */
}
static void ME_RTFReadHook(RTF_Info *info) {
static void ME_RTFReadHook(RTF_Info *info)
{
switch(info->rtfClass)
{
case rtfGroup:
......@@ -1363,23 +1364,6 @@ static void ME_RTFReadHook(RTF_Info *info) {
}
}
break;
case rtfControl:
switch(info->rtfMajor)
{
case rtfCharAttr:
ME_RTFCharAttrHook(info);
break;
case rtfParAttr:
ME_RTFParAttrHook(info);
break;
case rtfTblAttr:
ME_RTFTblAttrHook(info);
break;
case rtfSpecialChar:
ME_RTFSpecialCharHook(info);
break;
}
break;
}
}
......
......@@ -21,6 +21,8 @@
#include "editstr.h"
#include "wine/unicode.h"
struct _RTF_Info;
extern HANDLE me_heap;
static inline void __WINE_ALLOC_SIZE(1) *heap_alloc( size_t len )
......@@ -275,6 +277,10 @@ void ME_SendOldNotify(ME_TextEditor *editor, int nCode);
void ME_LinkNotify(ME_TextEditor *editor, UINT msg, WPARAM wParam, LPARAM lParam);
int ME_GetTextW(ME_TextEditor *editor, WCHAR *buffer, int nStart, int nChars, BOOL bCRLF);
ME_DisplayItem *ME_FindItemAtOffset(ME_TextEditor *editor, ME_DIType nItemType, int nOffset, int *nItemOffset);
void ME_RTFCharAttrHook(struct _RTF_Info *info);
void ME_RTFParAttrHook(struct _RTF_Info *info);
void ME_RTFTblAttrHook(struct _RTF_Info *info);
void ME_RTFSpecialCharHook(struct _RTF_Info *info);
void ME_StreamInFill(ME_InStream *stream);
int ME_AutoURLDetect(ME_TextEditor *editor, WCHAR curChar);
extern int me_debug;
......
......@@ -2477,6 +2477,13 @@ ControlClass (RTF_Info *info)
{
case rtfCharAttr:
CharAttr(info);
ME_RTFCharAttrHook(info);
break;
case rtfParAttr:
ME_RTFParAttrHook(info);
break;
case rtfTblAttr:
ME_RTFTblAttrHook(info);
break;
case rtfCharSet:
CharSet(info);
......@@ -2492,6 +2499,7 @@ ControlClass (RTF_Info *info)
break;
case rtfSpecialChar:
SpecialChar (info);
ME_RTFSpecialCharHook(info);
break;
}
}
......
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