Commit 3dbd4671 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

riched20: Don't allow negative margins in ME_WrapTextParagraph.

parent d11c758f
......@@ -732,7 +732,7 @@ static void test_EM_POSFROMCHAR(void)
SendMessageA(hwndRichEdit, WM_SETTEXT, 0,
(LPARAM)"{\\rtf1\\pard\\fi-200\\li-200\\f1 TestSomeText\\par}");
SendMessageA(hwndRichEdit, EM_POSFROMCHAR, (WPARAM)&pt, 0);
todo_wine ok(pt.x == 1, "pt.x = %d\n", pt.x);
ok(pt.x == 1, "pt.x = %d\n", pt.x);
fmt.cbSize = sizeof(fmt);
SendMessageA(hwndRichEdit, EM_GETPARAFORMAT, 0, (LPARAM)&fmt);
......
......@@ -879,6 +879,11 @@ static void ME_WrapTextParagraph(ME_Context *c, ME_DisplayItem *tp) {
wc.nFirstMargin = ME_twips2pointsX(c, dxStartIndent);
wc.nLeftMargin = wc.nFirstMargin + ME_twips2pointsX(c, pFmt->dxOffset);
wc.nRightMargin = ME_twips2pointsX(c, pFmt->dxRightIndent);
if (wc.nFirstMargin < 0)
wc.nFirstMargin = 0;
if (wc.nLeftMargin < 0)
wc.nLeftMargin = 0;
}
if (c->editor->bEmulateVersion10 && /* v1.0 - 3.0 */
pFmt->dwMask & PFM_TABLE && pFmt->wEffects & PFE_TABLE)
......
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