<div dir="auto"><div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Mar 28, 2022, 4:10 PM Huw Davies <<a href="mailto:huw@codeweavers.com">huw@codeweavers.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Mon, Mar 28, 2022 at 12:41:12AM +0900, Jinoh Kang wrote:<br>
> Signed-off-by: Jinoh Kang <<a href="mailto:jinoh.kang.kr@gmail.com" target="_blank" rel="noreferrer">jinoh.kang.kr@gmail.com</a>><br>
> ---<br>
>  dlls/riched20/editor.c        | 6 ++++++<br>
>  dlls/riched20/tests/richole.c | 4 ++--<br>
>  2 files changed, 8 insertions(+), 2 deletions(-)<br>
> <br>
> diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c<br>
> index 3d2d49af047..454a8bf5fc8 100644<br>
> --- a/dlls/riched20/editor.c<br>
> +++ b/dlls/riched20/editor.c<br>
> @@ -4271,6 +4271,12 @@ int ME_GetTextW(ME_TextEditor *editor, WCHAR *buffer, int buflen,<br>
>        nLen = 2;<br>
>        str = L"\r\n";<br>
>      }<br>
> +    else if (flags & GT_RAWTEXT && run->nFlags & MERF_GRAPHICS)<br>
> +    {<br>
> +      srcChars -= min(nLen, srcChars);<br>
> +      nLen = 1;<br>
> +      str = L"\xfffc";<br>
> +    }<br>
>      else<br>
>      {<br>
>        nLen = min(nLen, srcChars);<br>
> diff --git a/dlls/riched20/tests/richole.c b/dlls/riched20/tests/richole.c<br>
> index 24284a24484..dc0d7c4e1f1 100644<br>
> --- a/dlls/riched20/tests/richole.c<br>
> +++ b/dlls/riched20/tests/richole.c<br>
> @@ -3404,7 +3404,7 @@ static void test_InsertObject(void)<br>
>    memset(buffer, 0, sizeof(buffer));<br>
>    result = SendMessageW(hwnd, EM_GETTEXTEX, (WPARAM)&gettextex, (LPARAM)buffer);<br>
>    ok(result == lstrlenW(expected_string), "Got wrong length: %ld.\n", result);<br>
> -  todo_wine ok(!lstrcmpW(buffer, expected_string), "Got wrong content: %s.\n", debugstr_w(buffer));<br>
> +  ok(!lstrcmpW(buffer, expected_string), "Got wrong content: %s.\n", debugstr_w(buffer));<br>
<br>
The tests just before this show that GT_DEFAULT behaves in the same<br>
way (which conflicts with the docs).  Though it would be worth<br>
hacking new_richedit() to create a MSFTEDIT_CLASS window to see if<br>
that changes anything.<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Test results show the following:</div><div dir="auto"><br></div><div dir="auto">In riched20, U+FFFD is returned regardless of whether or not GT_RAWTEXT is specified. (maybe it didn't exist at all?)</div><div dir="auto">In msftedit, GT_RAWTEXT is honoured for objects (as specified in docs).</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
I think the right thing to do is to store 0xfffc in memory (see<br>
editor_insert_oleobj())</blockquote></div></div><div dir="auto"><br></div><div dir="auto">Great!</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">and fixup the other text getters that need to<br>
return a space (possibly introducing a custom GT_ flag so this can be<br>
done in ME_GetTextW()).<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">The question is: do other getters care at all? Perhaps we can leave GT_DEFAULT as-is, instead forcing GT_RAWTEXT in message handler if the control is in riched20 compatibility mode. This could use some more testing, though.</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Huw.<br>
</blockquote></div></div></div>