diff --git a/dlls/riched20/editor.h b/dlls/riched20/editor.h index 8a5304baa01..89c18b74b40 100644 --- a/dlls/riched20/editor.h +++ b/dlls/riched20/editor.h @@ -230,7 +230,6 @@ void ME_UpdateScrollBar(ME_TextEditor *editor); /* other functions in paint.c */ int ME_GetParaBorderWidth(ME_TextEditor *editor, int); -int ME_GetParaLineSpace(ME_Context *c, ME_Paragraph*); /* richole.c */ LRESULT CreateIRichEditOle(ME_TextEditor *editor, LPVOID *); diff --git a/dlls/riched20/paint.c b/dlls/riched20/paint.c index 52127d7ed26..b0e6c1e5137 100644 --- a/dlls/riched20/paint.c +++ b/dlls/riched20/paint.c @@ -520,29 +520,6 @@ int ME_GetParaBorderWidth(ME_TextEditor* editor, int flags) return width; } -int ME_GetParaLineSpace(ME_Context* c, ME_Paragraph* para) -{ - int sp = 0, ls = 0; - if (!(para->pFmt->dwMask & PFM_LINESPACING)) return 0; - - /* FIXME: how to compute simply the line space in ls ??? */ - /* FIXME: does line spacing include the line itself ??? */ - switch (para->pFmt->bLineSpacingRule) - { - case 0: sp = ls; break; - case 1: sp = (3 * ls) / 2; break; - case 2: sp = 2 * ls; break; - case 3: sp = ME_twips2pointsY(c, para->pFmt->dyLineSpacing); if (sp < ls) sp = ls; break; - case 4: sp = ME_twips2pointsY(c, para->pFmt->dyLineSpacing); break; - case 5: sp = para->pFmt->dyLineSpacing / 20; break; - default: FIXME("Unsupported spacing rule value %d\n", para->pFmt->bLineSpacingRule); - } - if (c->editor->nZoomNumerator == 0) - return sp; - else - return sp * c->editor->nZoomNumerator / c->editor->nZoomDenominator; -} - static void ME_DrawParaDecoration(ME_Context* c, ME_Paragraph* para, int y, RECT* bounds) { int idx, border_width, top_border, bottom_border; diff --git a/dlls/riched20/wrap.c b/dlls/riched20/wrap.c index 75f47a29d0c..f567d40a885 100644 --- a/dlls/riched20/wrap.c +++ b/dlls/riched20/wrap.c @@ -456,6 +456,29 @@ static ME_DisplayItem *ME_WrapHandleRun(ME_WrapContext *wc, ME_DisplayItem *p) return p->next; } +static int ME_GetParaLineSpace(ME_Context* c, ME_Paragraph* para) +{ + int sp = 0, ls = 0; + if (!(para->pFmt->dwMask & PFM_LINESPACING)) return 0; + + /* FIXME: how to compute simply the line space in ls ??? */ + /* FIXME: does line spacing include the line itself ??? */ + switch (para->pFmt->bLineSpacingRule) + { + case 0: sp = ls; break; + case 1: sp = (3 * ls) / 2; break; + case 2: sp = 2 * ls; break; + case 3: sp = ME_twips2pointsY(c, para->pFmt->dyLineSpacing); if (sp < ls) sp = ls; break; + case 4: sp = ME_twips2pointsY(c, para->pFmt->dyLineSpacing); break; + case 5: sp = para->pFmt->dyLineSpacing / 20; break; + default: FIXME("Unsupported spacing rule value %d\n", para->pFmt->bLineSpacingRule); + } + if (c->editor->nZoomNumerator == 0) + return sp; + else + return sp * c->editor->nZoomNumerator / c->editor->nZoomDenominator; +} + static void ME_PrepareParagraphForWrapping(ME_Context *c, ME_DisplayItem *tp); static void ME_WrapTextParagraph(ME_Context *c, ME_DisplayItem *tp) {