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

riched20: Constify some variables.

parent 106b9001
...@@ -71,8 +71,8 @@ CHARFORMAT2W *ME_ToCF2W(CHARFORMAT2W *to, CHARFORMAT2W *from); ...@@ -71,8 +71,8 @@ CHARFORMAT2W *ME_ToCF2W(CHARFORMAT2W *to, CHARFORMAT2W *from);
void ME_CopyToCF2W(CHARFORMAT2W *to, CHARFORMAT2W *from); void ME_CopyToCF2W(CHARFORMAT2W *to, CHARFORMAT2W *from);
CHARFORMAT2W *ME_ToCFAny(CHARFORMAT2W *to, CHARFORMAT2W *from); CHARFORMAT2W *ME_ToCFAny(CHARFORMAT2W *to, CHARFORMAT2W *from);
void ME_CopyToCFAny(CHARFORMAT2W *to, CHARFORMAT2W *from); void ME_CopyToCFAny(CHARFORMAT2W *to, CHARFORMAT2W *from);
void ME_CopyCharFormat(CHARFORMAT2W *pDest, CHARFORMAT2W *pSrc); /* only works with 2W structs */ void ME_CopyCharFormat(CHARFORMAT2W *pDest, const CHARFORMAT2W *pSrc); /* only works with 2W structs */
void ME_CharFormatFromLogFont(HDC hDC, LOGFONTW *lf, CHARFORMAT2W *fmt); /* ditto */ void ME_CharFormatFromLogFont(HDC hDC, const LOGFONTW *lf, CHARFORMAT2W *fmt); /* ditto */
/* list.c */ /* list.c */
void ME_InsertBefore(ME_DisplayItem *diWhere, ME_DisplayItem *diWhat); void ME_InsertBefore(ME_DisplayItem *diWhere, ME_DisplayItem *diWhat);
...@@ -213,7 +213,7 @@ BOOL ME_UpdateSelection(ME_TextEditor *editor, const ME_Cursor *pTempCursor); ...@@ -213,7 +213,7 @@ BOOL ME_UpdateSelection(ME_TextEditor *editor, const ME_Cursor *pTempCursor);
/* wrap.c */ /* wrap.c */
void ME_PrepareParagraphForWrapping(ME_Context *c, ME_DisplayItem *tp); void ME_PrepareParagraphForWrapping(ME_Context *c, ME_DisplayItem *tp);
ME_DisplayItem *ME_MakeRow(int height, int baseline, int width); ME_DisplayItem *ME_MakeRow(int height, int baseline, int width);
void ME_InsertRowStart(ME_WrapContext *wc, ME_DisplayItem *pEnd); void ME_InsertRowStart(ME_WrapContext *wc, const ME_DisplayItem *pEnd);
void ME_WrapTextParagraph(ME_Context *c, ME_DisplayItem *tp); void ME_WrapTextParagraph(ME_Context *c, ME_DisplayItem *tp);
BOOL ME_WrapMarkedParagraphs(ME_TextEditor *editor); BOOL ME_WrapMarkedParagraphs(ME_TextEditor *editor);
void ME_InvalidateMarkedParagraphs(ME_TextEditor *editor); void ME_InvalidateMarkedParagraphs(ME_TextEditor *editor);
...@@ -268,7 +268,7 @@ ME_TextEditor *ME_MakeEditor(HWND hWnd); ...@@ -268,7 +268,7 @@ ME_TextEditor *ME_MakeEditor(HWND hWnd);
void ME_DestroyEditor(ME_TextEditor *editor); void ME_DestroyEditor(ME_TextEditor *editor);
void ME_SendOldNotify(ME_TextEditor *editor, int nCode); void ME_SendOldNotify(ME_TextEditor *editor, int nCode);
void ME_LinkNotify(ME_TextEditor *editor, UINT msg, WPARAM wParam, LPARAM lParam); void ME_LinkNotify(ME_TextEditor *editor, UINT msg, WPARAM wParam, LPARAM lParam);
ME_UndoItem *ME_AddUndoItem(ME_TextEditor *editor, ME_DIType type, ME_DisplayItem *di); ME_UndoItem *ME_AddUndoItem(ME_TextEditor *editor, ME_DIType type, const ME_DisplayItem *pdi);
void ME_CommitUndo(ME_TextEditor *editor); void ME_CommitUndo(ME_TextEditor *editor);
void ME_Undo(ME_TextEditor *editor); void ME_Undo(ME_TextEditor *editor);
void ME_Redo(ME_TextEditor *editor); void ME_Redo(ME_TextEditor *editor);
......
...@@ -181,7 +181,7 @@ ME_Style *ME_ApplyStyle(ME_Style *sSrc, CHARFORMAT2W *style) ...@@ -181,7 +181,7 @@ ME_Style *ME_ApplyStyle(ME_Style *sSrc, CHARFORMAT2W *style)
return s; return s;
} }
void ME_CopyCharFormat(CHARFORMAT2W *pDest, CHARFORMAT2W *pSrc) void ME_CopyCharFormat(CHARFORMAT2W *pDest, const CHARFORMAT2W *pSrc)
{ {
/* using this with non-2W structs is forbidden */ /* using this with non-2W structs is forbidden */
assert(pSrc->cbSize == sizeof(CHARFORMAT2W)); assert(pSrc->cbSize == sizeof(CHARFORMAT2W));
...@@ -189,7 +189,7 @@ void ME_CopyCharFormat(CHARFORMAT2W *pDest, CHARFORMAT2W *pSrc) ...@@ -189,7 +189,7 @@ void ME_CopyCharFormat(CHARFORMAT2W *pDest, CHARFORMAT2W *pSrc)
CopyMemory(pDest, pSrc, sizeof(CHARFORMAT2W)); CopyMemory(pDest, pSrc, sizeof(CHARFORMAT2W));
} }
static void ME_DumpStyleEffect(char **p, const char *name, CHARFORMAT2W *fmt, int mask) static void ME_DumpStyleEffect(char **p, const char *name, const CHARFORMAT2W *fmt, int mask)
{ {
*p += sprintf(*p, "%-22s%s\n", name, (fmt->dwMask & mask) ? ((fmt->dwEffects & mask) ? "YES" : "no") : "N/A"); *p += sprintf(*p, "%-22s%s\n", name, (fmt->dwMask & mask) ? ((fmt->dwEffects & mask) ? "YES" : "no") : "N/A");
} }
...@@ -253,7 +253,7 @@ void ME_DumpStyleToBuf(CHARFORMAT2W *pFmt, char buf[2048]) ...@@ -253,7 +253,7 @@ void ME_DumpStyleToBuf(CHARFORMAT2W *pFmt, char buf[2048])
static void static void
ME_LogFontFromStyle(HDC hDC, LOGFONTW *lf, ME_Style *s, int nZoomNumerator, int nZoomDenominator) ME_LogFontFromStyle(HDC hDC, LOGFONTW *lf, const ME_Style *s, int nZoomNumerator, int nZoomDenominator)
{ {
int rx, ry; int rx, ry;
rx = GetDeviceCaps(hDC, LOGPIXELSX); rx = GetDeviceCaps(hDC, LOGPIXELSX);
...@@ -286,10 +286,10 @@ ME_LogFontFromStyle(HDC hDC, LOGFONTW *lf, ME_Style *s, int nZoomNumerator, int ...@@ -286,10 +286,10 @@ ME_LogFontFromStyle(HDC hDC, LOGFONTW *lf, ME_Style *s, int nZoomNumerator, int
lf->lfCharSet = s->fmt.bCharSet; lf->lfCharSet = s->fmt.bCharSet;
} }
void ME_CharFormatFromLogFont(HDC hDC, LOGFONTW *lf, CHARFORMAT2W *fmt) void ME_CharFormatFromLogFont(HDC hDC, const LOGFONTW *lf, CHARFORMAT2W *fmt)
{ {
int rx, ry; int rx, ry;
ME_InitCharFormat2W(fmt); ME_InitCharFormat2W(fmt);
rx = GetDeviceCaps(hDC, LOGPIXELSX); rx = GetDeviceCaps(hDC, LOGPIXELSX);
ry = GetDeviceCaps(hDC, LOGPIXELSY); ry = GetDeviceCaps(hDC, LOGPIXELSY);
...@@ -308,7 +308,7 @@ void ME_CharFormatFromLogFont(HDC hDC, LOGFONTW *lf, CHARFORMAT2W *fmt) ...@@ -308,7 +308,7 @@ void ME_CharFormatFromLogFont(HDC hDC, LOGFONTW *lf, CHARFORMAT2W *fmt)
fmt->bCharSet = lf->lfCharSet; fmt->bCharSet = lf->lfCharSet;
} }
static BOOL ME_IsFontEqual(LOGFONTW *p1, LOGFONTW *p2) static BOOL ME_IsFontEqual(const LOGFONTW *p1, const LOGFONTW *p2)
{ {
if (memcmp(p1, p2, sizeof(LOGFONTW)-sizeof(p1->lfFaceName))) if (memcmp(p1, p2, sizeof(LOGFONTW)-sizeof(p1->lfFaceName)))
return FALSE; return FALSE;
......
...@@ -48,7 +48,7 @@ void ME_EmptyUndoStack(ME_TextEditor *editor) ...@@ -48,7 +48,7 @@ void ME_EmptyUndoStack(ME_TextEditor *editor)
} }
} }
ME_UndoItem *ME_AddUndoItem(ME_TextEditor *editor, ME_DIType type, ME_DisplayItem *pdi) { ME_UndoItem *ME_AddUndoItem(ME_TextEditor *editor, ME_DIType type, const ME_DisplayItem *pdi) {
if (editor->nUndoMode == umIgnore) if (editor->nUndoMode == umIgnore)
return NULL; return NULL;
else if (editor->nUndoLimit == 0) else if (editor->nUndoLimit == 0)
......
...@@ -51,7 +51,7 @@ static void ME_BeginRow(ME_WrapContext *wc) ...@@ -51,7 +51,7 @@ static void ME_BeginRow(ME_WrapContext *wc)
wc->pt.x = 0; wc->pt.x = 0;
} }
void ME_InsertRowStart(ME_WrapContext *wc, ME_DisplayItem *pEnd) void ME_InsertRowStart(ME_WrapContext *wc, const ME_DisplayItem *pEnd)
{ {
ME_DisplayItem *p, *row, *para; ME_DisplayItem *p, *row, *para;
int ascent = 0, descent = 0, width=0, shift = 0, align = 0; int ascent = 0, descent = 0, width=0, shift = 0, align = 0;
......
...@@ -25,7 +25,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(richedit); ...@@ -25,7 +25,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(richedit);
static BOOL static BOOL
ME_StreamOutRTFText(ME_OutStream *pStream, WCHAR *text, LONG nChars); ME_StreamOutRTFText(ME_OutStream *pStream, const WCHAR *text, LONG nChars);
static ME_OutStream* static ME_OutStream*
...@@ -192,7 +192,7 @@ ME_StreamOutRTFHeader(ME_OutStream *pStream, int dwFormat) ...@@ -192,7 +192,7 @@ ME_StreamOutRTFHeader(ME_OutStream *pStream, int dwFormat)
static BOOL static BOOL
ME_StreamOutRTFFontAndColorTbl(ME_OutStream *pStream, ME_DisplayItem *pFirstRun, ME_DisplayItem *pLastRun) ME_StreamOutRTFFontAndColorTbl(ME_OutStream *pStream, ME_DisplayItem *pFirstRun, const ME_DisplayItem *pLastRun)
{ {
ME_DisplayItem *item = pFirstRun; ME_DisplayItem *item = pFirstRun;
ME_FontTableItem *table = pStream->fonttbl; ME_FontTableItem *table = pStream->fonttbl;
...@@ -282,7 +282,7 @@ ME_StreamOutRTFFontAndColorTbl(ME_OutStream *pStream, ME_DisplayItem *pFirstRun, ...@@ -282,7 +282,7 @@ ME_StreamOutRTFFontAndColorTbl(ME_OutStream *pStream, ME_DisplayItem *pFirstRun,
static BOOL static BOOL
ME_StreamOutRTFParaProps(ME_OutStream *pStream, ME_DisplayItem *para) ME_StreamOutRTFParaProps(ME_OutStream *pStream, const ME_DisplayItem *para)
{ {
PARAFORMAT2 *fmt = para->member.para.pFmt; PARAFORMAT2 *fmt = para->member.para.pFmt;
char props[STREAMOUT_BUFFER_SIZE] = ""; char props[STREAMOUT_BUFFER_SIZE] = "";
...@@ -579,7 +579,7 @@ ME_StreamOutRTFCharProps(ME_OutStream *pStream, CHARFORMAT2W *fmt) ...@@ -579,7 +579,7 @@ ME_StreamOutRTFCharProps(ME_OutStream *pStream, CHARFORMAT2W *fmt)
static BOOL static BOOL
ME_StreamOutRTFText(ME_OutStream *pStream, WCHAR *text, LONG nChars) ME_StreamOutRTFText(ME_OutStream *pStream, const WCHAR *text, LONG nChars)
{ {
char buffer[STREAMOUT_BUFFER_SIZE]; char buffer[STREAMOUT_BUFFER_SIZE];
int pos = 0; int pos = 0;
......
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