Commit 535afbd3 authored by Dylan Smith's avatar Dylan Smith Committed by Alexandre Julliard

richedit: Move function ME_GetParaLineSpace to make it static.

parent 28a4a7bd
......@@ -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 *);
......
......@@ -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;
......
......@@ -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) {
......
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