On Thu, May 20, 2021 at 03:56:15PM +0800, Jactry Zeng wrote:
@@ -4247,7 +4247,7 @@ LRESULT editor_handle_message( ME_TextEditor *editor, UINT msg, WPARAM wParam, */ int ME_GetTextW(ME_TextEditor *editor, WCHAR *buffer, int buflen, const ME_Cursor *start, int srcChars, BOOL bCRLF, - BOOL bEOP) + BOOL bEOP, BOOL object) {
Let's combine the last three params into a DWORD flags.
ME_Run *run, *next_run; const WCHAR *pStart = buffer; @@ -4275,6 +4275,11 @@ int ME_GetTextW(ME_TextEditor *editor, WCHAR *buffer, int buflen, nLen = 2; str = L"\r\n"; } + else if (object && run->nFlags & MERF_GRAPHICS) + { + srcChars--; + str = L"\xfffc"; + }
I think it would be cleaner to do the opposite. So have ME_InsertOLEFromCursor() insert a '\xfffc' and then return a space here if we explicitly don't want it (and similarly invert the meaning of the "object" flag so that it's set if we want to return a space). Huw.