Module: wine Branch: master Commit: fe1a24ff88d641b63ffa1d85b46846fba01cd8be URL: http://source.winehq.org/git/wine.git/?a=commit;h=fe1a24ff88d641b63ffa1d85b4...
Author: Dylan Smith dylan.ah.smith@gmail.com Date: Tue Aug 12 23:15:21 2008 -0400
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 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c index 8c235a8..15ad39f 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; } }