Commit 55a3dfe3 authored by Alex Henrie's avatar Alex Henrie Committed by Alexandre Julliard

riched20: Turn several constants and variables into static constants.

parent 235063d8
...@@ -2520,11 +2520,11 @@ ME_KeyDown(ME_TextEditor *editor, WORD nKey) ...@@ -2520,11 +2520,11 @@ ME_KeyDown(ME_TextEditor *editor, WORD nKey)
if (editor->styleFlags & ES_MULTILINE) if (editor->styleFlags & ES_MULTILINE)
{ {
static const WCHAR endl = '\r';
static const WCHAR endlv10[] = {'\r','\n'};
ME_Cursor cursor = editor->pCursors[0]; ME_Cursor cursor = editor->pCursors[0];
ME_DisplayItem *para = cursor.pPara; ME_DisplayItem *para = cursor.pPara;
int from, to; int from, to;
const WCHAR endl = '\r';
const WCHAR endlv10[] = {'\r','\n'};
ME_Style *style, *eop_style; ME_Style *style, *eop_style;
if (editor->styleFlags & ES_READONLY) { if (editor->styleFlags & ES_READONLY) {
......
...@@ -989,7 +989,7 @@ static void ME_DrawParagraph(ME_Context *c, ME_DisplayItem *paragraph) ...@@ -989,7 +989,7 @@ static void ME_DrawParagraph(ME_Context *c, ME_DisplayItem *paragraph)
} }
if (me_debug) if (me_debug)
{ {
const WCHAR wszRowDebug[] = {'r','o','w','[','%','d',']',0}; static const WCHAR wszRowDebug[] = {'r','o','w','[','%','d',']',0};
WCHAR buf[128]; WCHAR buf[128];
POINT pt = c->pt; POINT pt = c->pt;
wsprintfW(buf, wszRowDebug, no); wsprintfW(buf, wszRowDebug, no);
...@@ -1017,7 +1017,7 @@ static void ME_DrawParagraph(ME_Context *c, ME_DisplayItem *paragraph) ...@@ -1017,7 +1017,7 @@ static void ME_DrawParagraph(ME_Context *c, ME_DisplayItem *paragraph)
c->pt.y + para->pt.y + run->pt.y + baseline, p, para); c->pt.y + para->pt.y + run->pt.y + baseline, p, para);
if (me_debug) if (me_debug)
{ {
const WCHAR wszRunDebug[] = {'[','%','d',':','%','x',']',' ','%','l','s',0}; static const WCHAR wszRunDebug[] = {'[','%','d',':','%','x',']',' ','%','l','s',0};
WCHAR buf[2560]; WCHAR buf[2560];
POINT pt; POINT pt;
pt.x = c->pt.x + run->pt.x; pt.x = c->pt.x + run->pt.x;
......
...@@ -152,6 +152,7 @@ void add_marked_para(ME_TextEditor *editor, ME_DisplayItem *di) ...@@ -152,6 +152,7 @@ void add_marked_para(ME_TextEditor *editor, ME_DisplayItem *di)
void ME_MakeFirstParagraph(ME_TextEditor *editor) void ME_MakeFirstParagraph(ME_TextEditor *editor)
{ {
static const WCHAR cr_lf[] = {'\r','\n',0};
ME_Context c; ME_Context c;
CHARFORMAT2W cf; CHARFORMAT2W cf;
const CHARFORMATW *host_cf; const CHARFORMATW *host_cf;
...@@ -162,7 +163,6 @@ void ME_MakeFirstParagraph(ME_TextEditor *editor) ...@@ -162,7 +163,6 @@ void ME_MakeFirstParagraph(ME_TextEditor *editor)
ME_DisplayItem *run; ME_DisplayItem *run;
ME_Style *style; ME_Style *style;
int eol_len; int eol_len;
WCHAR cr_lf[] = {'\r','\n',0};
ME_InitContext(&c, editor, ITextHost_TxGetDC(editor->texthost)); ME_InitContext(&c, editor, ITextHost_TxGetDC(editor->texthost));
......
...@@ -612,8 +612,8 @@ int ME_PointFromChar(ME_TextEditor *editor, ME_Run *pRun, int nOffset, BOOL visu ...@@ -612,8 +612,8 @@ int ME_PointFromChar(ME_TextEditor *editor, ME_Run *pRun, int nOffset, BOOL visu
SIZE ME_GetRunSizeCommon(ME_Context *c, const ME_Paragraph *para, ME_Run *run, int nLen, SIZE ME_GetRunSizeCommon(ME_Context *c, const ME_Paragraph *para, ME_Run *run, int nLen,
int startx, int *pAscent, int *pDescent) int startx, int *pAscent, int *pDescent)
{ {
static const WCHAR spaceW[] = {' ',0};
SIZE size; SIZE size;
WCHAR spaceW[] = {' ',0};
nLen = min( nLen, run->len ); nLen = min( nLen, run->len );
......
...@@ -56,6 +56,8 @@ ...@@ -56,6 +56,8 @@
WINE_DEFAULT_DEBUG_CHANNEL(richedit_lists); WINE_DEFAULT_DEBUG_CHANNEL(richedit_lists);
static const WCHAR cr_lf[] = {'\r', '\n', 0};
static ME_DisplayItem* ME_InsertEndParaFromCursor(ME_TextEditor *editor, static ME_DisplayItem* ME_InsertEndParaFromCursor(ME_TextEditor *editor,
int nCursor, int nCursor,
const WCHAR *eol_str, int eol_len, const WCHAR *eol_str, int eol_len,
...@@ -77,7 +79,6 @@ static ME_DisplayItem* ME_InsertEndParaFromCursor(ME_TextEditor *editor, ...@@ -77,7 +79,6 @@ static ME_DisplayItem* ME_InsertEndParaFromCursor(ME_TextEditor *editor,
ME_DisplayItem* ME_InsertTableRowStartFromCursor(ME_TextEditor *editor) ME_DisplayItem* ME_InsertTableRowStartFromCursor(ME_TextEditor *editor)
{ {
ME_DisplayItem *para; ME_DisplayItem *para;
WCHAR cr_lf[] = {'\r', '\n', 0};
para = ME_InsertEndParaFromCursor(editor, 0, cr_lf, 2, MEPF_ROWSTART); para = ME_InsertEndParaFromCursor(editor, 0, cr_lf, 2, MEPF_ROWSTART);
return para->member.para.prev_para; return para->member.para.prev_para;
} }
...@@ -128,7 +129,6 @@ ME_DisplayItem* ME_InsertTableCellFromCursor(ME_TextEditor *editor) ...@@ -128,7 +129,6 @@ ME_DisplayItem* ME_InsertTableCellFromCursor(ME_TextEditor *editor)
ME_DisplayItem* ME_InsertTableRowEndFromCursor(ME_TextEditor *editor) ME_DisplayItem* ME_InsertTableRowEndFromCursor(ME_TextEditor *editor)
{ {
ME_DisplayItem *para; ME_DisplayItem *para;
WCHAR cr_lf[] = {'\r', '\n', 0};
para = ME_InsertEndParaFromCursor(editor, 0, cr_lf, 2, MEPF_ROWEND); para = ME_InsertEndParaFromCursor(editor, 0, cr_lf, 2, MEPF_ROWEND);
return para->member.para.prev_para; return para->member.para.prev_para;
} }
......
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