riched20: (updated) EM_GETLINE implementation and test

James Hawkins truiken at gmail.com
Thu Jun 22 16:03:30 CDT 2006


On 6/22/06, Krzysztof Foltman <wdev at foltman.com> wrote:
> This is the EM_GETLINE patch from Thomas Kho, updated to current git and
> with L"" replaced by proper WCHAR array.
>
> Krzysztof
>
> ======================================================
>
> Hi,
>
> The following patch implements EM_GETLINE. This feature was requested in
> bug #4305 <http://bugs.winehq.org/show_bug.cgi?id=4305> and also
> mentioned at
> <http://groups.google.com/group/comp.emulators.ms-windows.wine/msg/f897626539d4701c>
>
> Regards,
>
> Thomas Kho
>
>
> diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c
> index 9a2b966..23538ab 100644
> --- a/dlls/riched20/editor.c
> +++ b/dlls/riched20/editor.c

...

> @@ -2016,6 +2016,62 @@ LRESULT WINAPI RichEditANSIWndProc(HWND
>        return nChars;
>      }
>    }
> +  case EM_GETLINE:
> +  {
> +    ME_DisplayItem *run;
> +    ME_String *strText;
> +    int nMaxChars = (int) *(WORD *) lParam;
> +    int nBPC = 1; /* bytes per character */
> +    int nEndChars;
> +    char *dest = (char *) lParam;
> +
> +    TRACE("EM_GETLINE: row=%d, nMaxChars=%d (%s)\n", (int) wParam, nMaxChars,
> +          IsWindowUnicode(hWnd) ? "Unicode" : "Ansi");
> +

A case this long should be moved into its own function and called from
case EM_GETLINE.  In fact, most of these should probably be factored
into separated functions to reduce clutter.    As it stands,
RichEditANSIWndProc is a 1048 line function...yikes.

-- 
James Hawkins



More information about the wine-devel mailing list