Commit ed93ed9a authored by Andrew Talbot's avatar Andrew Talbot Committed by Alexandre Julliard

riched20: Constify some variables.

parent 216c3b0d
...@@ -226,24 +226,24 @@ void ME_MakeFirstParagraph(HDC hDC, ME_TextBuffer *editor); ...@@ -226,24 +226,24 @@ void ME_MakeFirstParagraph(HDC hDC, ME_TextBuffer *editor);
ME_DisplayItem *ME_SplitParagraph(ME_TextEditor *editor, ME_DisplayItem *rp, ME_Style *style); ME_DisplayItem *ME_SplitParagraph(ME_TextEditor *editor, ME_DisplayItem *rp, ME_Style *style);
ME_DisplayItem *ME_JoinParagraphs(ME_TextEditor *editor, ME_DisplayItem *tp); ME_DisplayItem *ME_JoinParagraphs(ME_TextEditor *editor, ME_DisplayItem *tp);
void ME_DumpParaStyle(ME_Paragraph *s); void ME_DumpParaStyle(ME_Paragraph *s);
void ME_DumpParaStyleToBuf(PARAFORMAT2 *pFmt, char buf[2048]); void ME_DumpParaStyleToBuf(const PARAFORMAT2 *pFmt, char buf[2048]);
void ME_SetParaFormat(ME_TextEditor *editor, ME_DisplayItem *para, PARAFORMAT2 *pFmt); void ME_SetParaFormat(ME_TextEditor *editor, ME_DisplayItem *para, const PARAFORMAT2 *pFmt);
void ME_SetSelectionParaFormat(ME_TextEditor *editor, PARAFORMAT2 *pFmt); void ME_SetSelectionParaFormat(ME_TextEditor *editor, const PARAFORMAT2 *pFmt);
void ME_GetParaFormat(ME_TextEditor *editor, ME_DisplayItem *para, PARAFORMAT2 *pFmt); void ME_GetParaFormat(ME_TextEditor *editor, const ME_DisplayItem *para, PARAFORMAT2 *pFmt);
void ME_GetSelectionParaFormat(ME_TextEditor *editor, PARAFORMAT2 *pFmt); void ME_GetSelectionParaFormat(ME_TextEditor *editor, PARAFORMAT2 *pFmt);
/* marks from first up to (but not including) last */ /* marks from first up to (but not including) last */
void ME_MarkForWrapping(ME_TextEditor *editor, ME_DisplayItem *first, ME_DisplayItem *last); void ME_MarkForWrapping(ME_TextEditor *editor, ME_DisplayItem *first, const ME_DisplayItem *last);
void ME_MarkForPainting(ME_TextEditor *editor, ME_DisplayItem *first, ME_DisplayItem *last); void ME_MarkForPainting(ME_TextEditor *editor, ME_DisplayItem *first, const ME_DisplayItem *last);
void ME_MarkAllForWrapping(ME_TextEditor *editor); void ME_MarkAllForWrapping(ME_TextEditor *editor);
/* paint.c */ /* paint.c */
void ME_PaintContent(ME_TextEditor *editor, HDC hDC, BOOL bOnlyNew, RECT *rcUpdate); void ME_PaintContent(ME_TextEditor *editor, HDC hDC, BOOL bOnlyNew, const RECT *rcUpdate);
void ME_Repaint(ME_TextEditor *editor); void ME_Repaint(ME_TextEditor *editor);
void ME_RewrapRepaint(ME_TextEditor *editor); void ME_RewrapRepaint(ME_TextEditor *editor);
void ME_UpdateRepaint(ME_TextEditor *editor); void ME_UpdateRepaint(ME_TextEditor *editor);
void ME_DrawParagraph(ME_Context *c, ME_DisplayItem *paragraph); void ME_DrawParagraph(ME_Context *c, ME_DisplayItem *paragraph);
void ME_EnsureVisible(ME_TextEditor *editor, ME_DisplayItem *pRun); void ME_EnsureVisible(ME_TextEditor *editor, ME_DisplayItem *pRun);
COLORREF ME_GetBackColor(ME_TextEditor *editor); COLORREF ME_GetBackColor(const ME_TextEditor *editor);
void ME_InvalidateSelection(ME_TextEditor *editor); void ME_InvalidateSelection(ME_TextEditor *editor);
void ME_QueueInvalidateFromCursor(ME_TextEditor *editor, int nCursor); void ME_QueueInvalidateFromCursor(ME_TextEditor *editor, int nCursor);
BOOL ME_SetZoom(ME_TextEditor *editor, int numerator, int denominator); BOOL ME_SetZoom(ME_TextEditor *editor, int numerator, int denominator);
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
WINE_DEFAULT_DEBUG_CHANNEL(richedit); WINE_DEFAULT_DEBUG_CHANNEL(richedit);
void ME_PaintContent(ME_TextEditor *editor, HDC hDC, BOOL bOnlyNew, RECT *rcUpdate) { void ME_PaintContent(ME_TextEditor *editor, HDC hDC, BOOL bOnlyNew, const RECT *rcUpdate) {
ME_DisplayItem *item; ME_DisplayItem *item;
ME_Context c; ME_Context c;
int yoffset; int yoffset;
...@@ -196,7 +196,7 @@ static void ME_DrawTextWithStyle(ME_Context *c, int x, int y, LPCWSTR szText, in ...@@ -196,7 +196,7 @@ static void ME_DrawTextWithStyle(ME_Context *c, int x, int y, LPCWSTR szText, in
ME_UnselectStyleFont(c->editor, hDC, s, hOldFont); ME_UnselectStyleFont(c->editor, hDC, s, hOldFont);
} }
static void ME_DebugWrite(HDC hDC, POINT *pt, WCHAR *szText) { static void ME_DebugWrite(HDC hDC, const POINT *pt, LPCWSTR szText) {
int align = SetTextAlign(hDC, TA_LEFT|TA_TOP); int align = SetTextAlign(hDC, TA_LEFT|TA_TOP);
HGDIOBJ hFont = SelectObject(hDC, GetStockObject(DEFAULT_GUI_FONT)); HGDIOBJ hFont = SelectObject(hDC, GetStockObject(DEFAULT_GUI_FONT));
COLORREF color = SetTextColor(hDC, RGB(128,128,128)); COLORREF color = SetTextColor(hDC, RGB(128,128,128));
...@@ -276,7 +276,7 @@ static void ME_DrawRun(ME_Context *c, int x, int y, ME_DisplayItem *rundi, ME_Pa ...@@ -276,7 +276,7 @@ static void ME_DrawRun(ME_Context *c, int x, int y, ME_DisplayItem *rundi, ME_Pa
} }
} }
COLORREF ME_GetBackColor(ME_TextEditor *editor) COLORREF ME_GetBackColor(const ME_TextEditor *editor)
{ {
/* Looks like I was seriously confused /* Looks like I was seriously confused
return GetSysColor((GetWindowLong(editor->hWnd, GWL_STYLE) & ES_READONLY) ? COLOR_3DFACE: COLOR_WINDOW); return GetSysColor((GetWindowLong(editor->hWnd, GWL_STYLE) & ES_READONLY) ? COLOR_3DFACE: COLOR_WINDOW);
......
...@@ -83,7 +83,7 @@ void ME_MarkAllForWrapping(ME_TextEditor *editor) ...@@ -83,7 +83,7 @@ void ME_MarkAllForWrapping(ME_TextEditor *editor)
ME_MarkForWrapping(editor, editor->pBuffer->pFirst->member.para.next_para, editor->pBuffer->pLast); ME_MarkForWrapping(editor, editor->pBuffer->pFirst->member.para.next_para, editor->pBuffer->pLast);
} }
void ME_MarkForWrapping(ME_TextEditor *editor, ME_DisplayItem *first, ME_DisplayItem *last) void ME_MarkForWrapping(ME_TextEditor *editor, ME_DisplayItem *first, const ME_DisplayItem *last)
{ {
while(first != last) while(first != last)
{ {
...@@ -92,7 +92,7 @@ void ME_MarkForWrapping(ME_TextEditor *editor, ME_DisplayItem *first, ME_Display ...@@ -92,7 +92,7 @@ void ME_MarkForWrapping(ME_TextEditor *editor, ME_DisplayItem *first, ME_Display
} }
} }
void ME_MarkForPainting(ME_TextEditor *editor, ME_DisplayItem *first, ME_DisplayItem *last) void ME_MarkForPainting(ME_TextEditor *editor, ME_DisplayItem *first, const ME_DisplayItem *last)
{ {
while(first != last) while(first != last)
{ {
...@@ -277,12 +277,12 @@ ME_DisplayItem *ME_GetParagraph(ME_DisplayItem *item) { ...@@ -277,12 +277,12 @@ ME_DisplayItem *ME_GetParagraph(ME_DisplayItem *item) {
return ME_FindItemBackOrHere(item, diParagraph); return ME_FindItemBackOrHere(item, diParagraph);
} }
static void ME_DumpStyleEffect(char **p, const char *name, PARAFORMAT2 *fmt, int mask) static void ME_DumpStyleEffect(char **p, const char *name, const PARAFORMAT2 *fmt, int mask)
{ {
*p += sprintf(*p, "%-22s%s\n", name, (fmt->dwMask & mask) ? ((fmt->wEffects & mask) ? "yes" : "no") : "N/A"); *p += sprintf(*p, "%-22s%s\n", name, (fmt->dwMask & mask) ? ((fmt->wEffects & mask) ? "yes" : "no") : "N/A");
} }
void ME_DumpParaStyleToBuf(PARAFORMAT2 *pFmt, char buf[2048]) void ME_DumpParaStyleToBuf(const PARAFORMAT2 *pFmt, char buf[2048])
{ {
/* FIXME only PARAFORMAT styles implemented */ /* FIXME only PARAFORMAT styles implemented */
char *p; char *p;
...@@ -318,7 +318,7 @@ void ME_DumpParaStyleToBuf(PARAFORMAT2 *pFmt, char buf[2048]) ...@@ -318,7 +318,7 @@ void ME_DumpParaStyleToBuf(PARAFORMAT2 *pFmt, char buf[2048])
ME_DumpStyleEffect(&p, "Page break before:", pFmt, PFM_PAGEBREAKBEFORE); ME_DumpStyleEffect(&p, "Page break before:", pFmt, PFM_PAGEBREAKBEFORE);
} }
void ME_SetParaFormat(ME_TextEditor *editor, ME_DisplayItem *para, PARAFORMAT2 *pFmt) void ME_SetParaFormat(ME_TextEditor *editor, ME_DisplayItem *para, const PARAFORMAT2 *pFmt)
{ {
PARAFORMAT2 copy; PARAFORMAT2 copy;
assert(sizeof(*para->member.para.pFmt) == sizeof(PARAFORMAT2)); assert(sizeof(*para->member.para.pFmt) == sizeof(PARAFORMAT2));
...@@ -372,7 +372,7 @@ ME_GetSelectionParas(ME_TextEditor *editor, ME_DisplayItem **para, ME_DisplayIte ...@@ -372,7 +372,7 @@ ME_GetSelectionParas(ME_TextEditor *editor, ME_DisplayItem **para, ME_DisplayIte
} }
void ME_SetSelectionParaFormat(ME_TextEditor *editor, PARAFORMAT2 *pFmt) void ME_SetSelectionParaFormat(ME_TextEditor *editor, const PARAFORMAT2 *pFmt)
{ {
ME_DisplayItem *para, *para_end; ME_DisplayItem *para, *para_end;
...@@ -386,7 +386,7 @@ void ME_SetSelectionParaFormat(ME_TextEditor *editor, PARAFORMAT2 *pFmt) ...@@ -386,7 +386,7 @@ void ME_SetSelectionParaFormat(ME_TextEditor *editor, PARAFORMAT2 *pFmt)
} while(1); } while(1);
} }
void ME_GetParaFormat(ME_TextEditor *editor, ME_DisplayItem *para, PARAFORMAT2 *pFmt) void ME_GetParaFormat(ME_TextEditor *editor, const ME_DisplayItem *para, PARAFORMAT2 *pFmt)
{ {
if (pFmt->cbSize >= sizeof(PARAFORMAT2)) if (pFmt->cbSize >= sizeof(PARAFORMAT2))
{ {
......
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