From fe1a24ff88d641b63ffa1d85b46846fba01cd8be Mon Sep 17 00:00:00 2001 From: Dylan Smith Date: Tue, 12 Aug 2008 23:15:21 -0400 Subject: [PATCH] richedit: Substitute space for \tab and \par control words for simple tables. For simple tables cells are represented with tabs, and a table row is ended at the end of the paragraph, so native richedit controls substitute spaces for \tab and \par rich text format control words. --- dlls/riched20/editor.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c index 8c235a8e734..15ad39f24b2 100644 --- a/dlls/riched20/editor.c +++ b/dlls/riched20/editor.c @@ -936,9 +936,23 @@ static void ME_RTFSpecialCharHook(RTF_Info *info) } break; } + case rtfTab: case rtfPar: - if (tableDef) - tableDef->numCellsInserted = 0; + if (info->editor->bEmulateVersion10) { /* v1.0 - 3.0 */ + ME_DisplayItem *para; + PARAFORMAT2 *pFmt; + RTFFlushOutputBuffer(info); + para = ME_GetParagraph(info->editor->pCursors[0].pRun); + pFmt = para->member.para.pFmt; + if (pFmt->dwMask & PFM_TABLE && pFmt->wEffects & PFE_TABLE) + { + /* rtfPar is treated like a space within a table. */ + info->rtfClass = rtfText; + info->rtfMajor = ' '; + } + else if (info->rtfMinor == rtfPar && tableDef) + tableDef->numCellsInserted = 0; + } break; } }