[PATCH 1/2] riched20: Stub for ITextFont interface and implement ITextRange::GetFont. (try 2)

Huw Davies huw at codeweavers.com
Fri Sep 19 06:34:36 CDT 2014


On Thu, Sep 18, 2014 at 09:15:11PM +0800, Jactry Zeng wrote:
> +static IRichEditOleImpl *get_reOle(ITextFontImpl *txtFont)
> +{
> +  if (txtFont->txtRge)
> +    return txtFont->txtRge->reOle;
> +  else
> +    return txtFont->txtSel->reOle;
> +}

You're using two-space indents here, while the rest is four-space.
A couple of these have sneaked in in earlier patches too - make
sure your editor is set up correctly!

> +static HRESULT CreateITextFont(ITextFontImpl **ptxtFont)
> +{
> +    ITextFontImpl *txtFont = NULL;

This initialization isn't very useful.

> +    txtFont = heap_alloc(sizeof(ITextFontImpl));
> +    if (!txtFont)
> +        return E_OUTOFMEMORY;
> +
> +    txtFont->ITextFont_iface.lpVtbl = &tfvt;
> +    txtFont->ref = 1;
> +    *ptxtFont = txtFont;
> +    return S_OK;
> +}

It would make more sense to initialize txtSel and txtRge to NULL
here - the caller then only needs to touch the one it needs.

Otherwise, this one and the next one look good to me.

Huw.



More information about the wine-devel mailing list