Commit 7153b559 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

riched20: Get rid of the FREE_OBJ() macro.

parent f9016830
......@@ -2147,7 +2147,7 @@ static int ME_GetTextRange(ME_TextEditor *editor, WCHAR *strText,
nChars = ME_GetTextW(editor, p, nLen, start, nLen, FALSE, FALSE);
WideCharToMultiByte(CP_ACP, 0, p, nChars+1, (char *)strText,
nLen+1, NULL, NULL);
FREE_OBJ(p);
heap_free(p);
return nChars;
}
}
......@@ -3160,10 +3160,9 @@ void ME_DestroyEditor(ME_TextEditor *editor)
}
OleUninitialize();
FREE_OBJ(editor->pBuffer);
FREE_OBJ(editor->pCursors);
FREE_OBJ(editor);
heap_free(editor->pBuffer);
heap_free(editor->pCursors);
heap_free(editor);
}
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
......@@ -4305,7 +4304,7 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam,
if ((tmp = ALLOC_N_OBJ(WCHAR, nChars)) != NULL)
MultiByteToWideChar(CP_ACP, 0, ft->lpstrText, -1, tmp, nChars);
r = ME_FindText(editor, wParam, &ft->chrg, tmp, NULL);
FREE_OBJ( tmp );
heap_free(tmp);
}else{
FINDTEXTW *ft = (FINDTEXTW *)lParam;
r = ME_FindText(editor, wParam, &ft->chrg, ft->lpstrText, NULL);
......@@ -4323,7 +4322,7 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam,
if ((tmp = ALLOC_N_OBJ(WCHAR, nChars)) != NULL)
MultiByteToWideChar(CP_ACP, 0, ex->lpstrText, -1, tmp, nChars);
r = ME_FindText(editor, wParam, &ex->chrg, tmp, &ex->chrgText);
FREE_OBJ( tmp );
heap_free(tmp);
}else{
FINDTEXTEXW *ex = (FINDTEXTEXW *)lParam;
r = ME_FindText(editor, wParam, &ex->chrg, ex->lpstrText, &ex->chrgText);
......
......@@ -27,7 +27,6 @@ extern HANDLE me_heap DECLSPEC_HIDDEN;
#define ALLOC_OBJ(type) heap_alloc(sizeof(type))
#define ALLOC_N_OBJ(type, count) heap_alloc((count)*sizeof(type))
#define FREE_OBJ(ptr) heap_free(ptr)
#define RUN_IS_HIDDEN(run) ((run)->style->fmt.dwMask & CFM_HIDDEN \
&& (run)->style->fmt.dwEffects & CFE_HIDDEN)
......
......@@ -174,7 +174,7 @@ void ME_DestroyDisplayItem(ME_DisplayItem *item)
heap_free( item->member.run.clusters );
ME_ReleaseStyle(item->member.run.style);
}
FREE_OBJ(item);
heap_free(item);
}
ME_DisplayItem *ME_MakeDI(ME_DIType type)
......
......@@ -5383,7 +5383,7 @@ void ME_DeleteReObject(REOBJECT* reo)
if (reo->poleobj) IOleObject_Release(reo->poleobj);
if (reo->pstg) IStorage_Release(reo->pstg);
if (reo->polesite) IOleClientSite_Release(reo->polesite);
FREE_OBJ(reo);
heap_free(reo);
}
void ME_CopyReObject(REOBJECT* dst, const REOBJECT* src)
......
......@@ -425,7 +425,7 @@ void ME_DestroyStyle(ME_Style *s)
s->font_cache = NULL;
}
ScriptFreeCache( &s->script_cache );
FREE_OBJ(s);
heap_free(s);
}
void ME_AddRefStyle(ME_Style *s)
......
......@@ -101,7 +101,7 @@ ME_StreamOutFree(ME_OutStream *pStream)
LONG written = pStream->written;
TRACE("total length = %u\n", written);
FREE_OBJ(pStream);
heap_free(pStream);
return written;
}
......@@ -1148,8 +1148,7 @@ static BOOL ME_StreamOutText(ME_TextEditor *editor, ME_OutStream *pStream,
nSize = WideCharToMultiByte(nCodePage, 0, get_text( &cursor.pRun->member.run, cursor.nOffset ),
nLen, NULL, 0, NULL, NULL);
if (nSize > nBufLen) {
FREE_OBJ(buffer);
buffer = ALLOC_N_OBJ(char, nSize);
buffer = heap_realloc(buffer, nSize);
nBufLen = nSize;
}
WideCharToMultiByte(nCodePage, 0, get_text( &cursor.pRun->member.run, cursor.nOffset ),
......@@ -1163,7 +1162,7 @@ static BOOL ME_StreamOutText(ME_TextEditor *editor, ME_OutStream *pStream,
cursor.pRun = ME_FindItemFwd(cursor.pRun, diRun);
}
FREE_OBJ(buffer);
heap_free(buffer);
return success;
}
......
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