+HRESULT ME_ITextGetText(ME_TextEditor *editor, ME_Cursor *start, ME_Cursor *end, BSTR *pb) DECLSPEC_HIDDEN;
Is this really needed?
- buffer = heap_alloc((nChars + 1) * sizeof(WCHAR));
- if (!buffer)
return E_OUTOFMEMORY;
- ME_GetTextW(editor, buffer, nChars, start, nChars, 0);
- buffer[nChars] = 0;
- /* FIXME: a '\r' should be appended at the end of a story */
- *pb = SysAllocString(buffer);
- heap_free(buffer);
This could be simplified with SysAllocStringLen().