[PATCH 1/2] riched20: Implement ITextSelection::GetText.

Nikolay Sivov bunglehead at gmail.com
Wed May 21 01:56:05 CDT 2014


> +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().



More information about the wine-devel mailing list