Commit 820de0bd authored by Alex Villacís Lasso's avatar Alex Villacís Lasso Committed by Alexandre Julliard

riched32: Implement a portion of suggested interpretation of CRLF handling for…

riched32: Implement a portion of suggested interpretation of CRLF handling for richedit 1.0 emulation. Fixes a few todos introduced by previous patch.
parent 17c437d4
......@@ -537,10 +537,25 @@ void ME_InsertTextFromCursor(ME_TextEditor *editor, int nCursor,
ME_ReleaseStyle(end_run->member.run.style);
end_run->member.run.style = tmp_style;
p->nOffset = 0;
if(pos-str < len && *pos =='\r')
pos++;
if(pos-str < len && *pos =='\n')
pos++;
if (editor->bEmulateVersion10) {
const WCHAR * tpos;
tpos = pos;
while (tpos-str < len && *tpos == '\r') {
tpos++;
}
if (tpos-str >= len) {
if (tpos != pos) pos++;
} else if (*tpos == '\n')
pos = tpos + 1;
else
pos++;
} else {
if(pos-str < len && *pos =='\r')
pos++;
if(pos-str < len && *pos =='\n')
pos++;
}
if(pos-str <= len) {
len -= pos - str;
str = pos;
......
......@@ -113,9 +113,9 @@ static void test_WM_SETTEXT()
TEST_SETTEXT(TestItem2, TestItem2, 1, 1, 1)
TEST_SETTEXT(TestItem3, TestItem3, 2, 1, 1)
TEST_SETTEXT(TestItem4, TestItem4, 3, 1, 0)
TEST_SETTEXT(TestItem5, TestItem5, 2, 1, 1)
TEST_SETTEXT(TestItem6, TestItem6, 3, 1, 1)
TEST_SETTEXT(TestItem7, TestItem7, 4, 1, 1)
TEST_SETTEXT(TestItem5, TestItem5, 2, 1, 0)
TEST_SETTEXT(TestItem6, TestItem6, 3, 1, 0)
TEST_SETTEXT(TestItem7, TestItem7, 4, 1, 0)
TEST_SETTEXT(TestItem8, TestItem8, 2, 0, 0)
TEST_SETTEXT(TestItem9, TestItem9, 3, 0, 0)
TEST_SETTEXT(TestItem10, TestItem10, 3, 0, 0)
......
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