Dylan Smith : richedit: Enter inserts newline before table at start of document.
Alexandre Julliard
julliard at winehq.org
Fri Sep 12 07:01:40 CDT 2008
Module: wine
Branch: master
Commit: d7ff24378a187a7d10080184727feaf0e586177a
URL: http://source.winehq.org/git/wine.git/?a=commit;h=d7ff24378a187a7d10080184727feaf0e586177a
Author: Dylan Smith <dylan.ah.smith at gmail.com>
Date: Thu Sep 11 12:45:58 2008 -0400
richedit: Enter inserts newline before table at start of document.
---
dlls/riched20/editor.c | 19 ++++++++++++++++++-
1 files changed, 18 insertions(+), 1 deletions(-)
diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c
index 14c7256..0ae8844 100644
--- a/dlls/riched20/editor.c
+++ b/dlls/riched20/editor.c
@@ -3725,7 +3725,24 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam,
para->member.para.prev_para->member.para.nFlags & MEPF_ROWSTART &&
!para->member.para.prev_para->member.para.nCharOfs)
{
- /* FIXME: Insert a newline before the table. */
+ /* Insert a newline before the table. */
+ WCHAR endl = '\r';
+ para = para->member.para.prev_para;
+ para->member.para.nFlags &= ~MEPF_ROWSTART;
+ editor->pCursors[0].pRun = ME_FindItemFwd(para, diRun);
+ editor->pCursors[1] = editor->pCursors[0];
+ ME_InsertTextFromCursor(editor, 0, &endl, 1,
+ editor->pCursors[0].pRun->member.run.style);
+ para = editor->pBuffer->pFirst->member.para.next_para;
+ ME_SetDefaultParaFormat(para->member.para.pFmt);
+ para->member.para.nFlags = MEPF_REWRAP;
+ editor->pCursors[0].pRun = ME_FindItemFwd(para, diRun);
+ editor->pCursors[1] = editor->pCursors[0];
+ para->member.para.next_para->member.para.nFlags |= MEPF_ROWSTART;
+ ME_CommitCoalescingUndo(editor);
+ ME_CheckTablesForCorruption(editor);
+ ME_UpdateRepaint(editor);
+ return 0;
}
} else { /* v1.0 - 3.0 */
ME_DisplayItem *para = ME_GetParagraph(cursor.pRun);
More information about the wine-cvs
mailing list