riched20: Get rid of the ALLOC_N_OBJ macro.

Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Michael Stefaniuc 2018-02-03 23:59:48 +01:00 committed by Alexandre Julliard
parent 965dc38175
commit c03b41c896
2 changed files with 4 additions and 6 deletions

View File

@ -2136,7 +2136,7 @@ static int ME_GetTextRange(ME_TextEditor *editor, WCHAR *strText,
return ME_GetTextW(editor, strText, INT_MAX, start, nLen, FALSE, FALSE);
} else {
int nChars;
WCHAR *p = ALLOC_N_OBJ(WCHAR, nLen+1);
WCHAR *p = heap_alloc((nLen+1) * sizeof(*p));
if (!p) return 0;
nChars = ME_GetTextW(editor, p, nLen, start, nLen, FALSE, FALSE);
WideCharToMultiByte(CP_ACP, 0, p, nChars+1, (char *)strText,
@ -3021,7 +3021,7 @@ ME_TextEditor *ME_MakeEditor(ITextHost *texthost, BOOL bEmulateVersion10)
* or paragraph selection.
*/
ed->nCursors = 4;
ed->pCursors = ALLOC_N_OBJ(ME_Cursor, ed->nCursors);
ed->pCursors = heap_alloc(ed->nCursors * sizeof(*ed->pCursors));
ME_SetCursorToStart(ed, &ed->pCursors[0]);
ed->pCursors[1] = ed->pCursors[0];
ed->pCursors[2] = ed->pCursors[0];
@ -4295,7 +4295,7 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam,
int nChars = MultiByteToWideChar(CP_ACP, 0, ft->lpstrText, -1, NULL, 0);
WCHAR *tmp;
if ((tmp = ALLOC_N_OBJ(WCHAR, nChars)) != NULL)
if ((tmp = heap_alloc(nChars * sizeof(*tmp))) != NULL)
MultiByteToWideChar(CP_ACP, 0, ft->lpstrText, -1, tmp, nChars);
r = ME_FindText(editor, wParam, &ft->chrg, tmp, NULL);
heap_free(tmp);
@ -4313,7 +4313,7 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam,
int nChars = MultiByteToWideChar(CP_ACP, 0, ex->lpstrText, -1, NULL, 0);
WCHAR *tmp;
if ((tmp = ALLOC_N_OBJ(WCHAR, nChars)) != NULL)
if ((tmp = heap_alloc(nChars * sizeof(*tmp))) != NULL)
MultiByteToWideChar(CP_ACP, 0, ex->lpstrText, -1, tmp, nChars);
r = ME_FindText(editor, wParam, &ex->chrg, tmp, &ex->chrgText);
heap_free(tmp);

View File

@ -25,8 +25,6 @@ struct _RTF_Info;
extern HANDLE me_heap DECLSPEC_HIDDEN;
#define ALLOC_N_OBJ(type, count) heap_alloc((count)*sizeof(type))
#define RUN_IS_HIDDEN(run) ((run)->style->fmt.dwMask & CFM_HIDDEN \
&& (run)->style->fmt.dwEffects & CFE_HIDDEN)