diff --git a/dlls/riched20/list.c b/dlls/riched20/list.c index 10732e523dd..c57e5264f2e 100644 --- a/dlls/riched20/list.c +++ b/dlls/riched20/list.c @@ -179,13 +179,6 @@ ME_DisplayItem *ME_MakeDI(ME_DIType type) ZeroMemory(item, sizeof(ME_DisplayItem)); item->type = type; item->prev = item->next = NULL; - if (type == diParagraph) - { - item->member.para.pFmt = ALLOC_OBJ(PARAFORMAT2); - ME_SetDefaultParaFormat(item->member.para.pFmt); - item->member.para.nFlags = MEPF_REWRAP; - } - return item; } diff --git a/dlls/riched20/para.c b/dlls/riched20/para.c index 8cf3d241594..c068d845687 100644 --- a/dlls/riched20/para.c +++ b/dlls/riched20/para.c @@ -23,6 +23,16 @@ WINE_DEFAULT_DEBUG_CHANNEL(richedit); +static ME_DisplayItem *make_para(ME_TextEditor *editor) +{ + ME_DisplayItem *item = ME_MakeDI(diParagraph); + + item->member.para.pFmt = ALLOC_OBJ(PARAFORMAT2); + ME_SetDefaultParaFormat(item->member.para.pFmt); + item->member.para.nFlags = MEPF_REWRAP; + return item; +} + void ME_MakeFirstParagraph(ME_TextEditor *editor) { ME_Context c; @@ -30,7 +40,7 @@ void ME_MakeFirstParagraph(ME_TextEditor *editor) LOGFONTW lf; HFONT hf; ME_TextBuffer *text = editor->pBuffer; - ME_DisplayItem *para = ME_MakeDI(diParagraph); + ME_DisplayItem *para = make_para(editor); ME_DisplayItem *run; ME_Style *style; int eol_len; @@ -196,7 +206,7 @@ ME_DisplayItem *ME_SplitParagraph(ME_TextEditor *editor, ME_DisplayItem *run, { ME_DisplayItem *next_para = NULL; ME_DisplayItem *run_para = NULL; - ME_DisplayItem *new_para = ME_MakeDI(diParagraph); + ME_DisplayItem *new_para = make_para(editor); ME_DisplayItem *end_run; int ofs, i; ME_DisplayItem *pp;