riched20: Implement EM_SETREADONLY using EM_SETOPTIONS.

Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Huw Davies 2021-03-15 10:03:20 +00:00 committed by Alexandre Julliard
parent b456420096
commit 5d75cac480
2 changed files with 4 additions and 15 deletions

View File

@ -3779,14 +3779,6 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam,
return 0;
}
case EM_SETREADONLY:
{
if (wParam)
editor->styleFlags |= ES_READONLY;
else
editor->styleFlags &= ~ES_READONLY;
return 1;
}
case EM_SETEVENTMASK:
{
DWORD nOldMask = editor->nEventMask;

View File

@ -1002,14 +1002,11 @@ static LRESULT RichEditWndProc_common( HWND hwnd, UINT msg, WPARAM wparam,
}
case EM_SETREADONLY:
{
DWORD style;
DWORD op = wparam ? ECOOP_OR : ECOOP_AND;
DWORD mask = wparam ? ECO_READONLY : ~ECO_READONLY;
res = ME_HandleMessage( editor, msg, wparam, lparam, unicode, &hr );
style = GetWindowLongW( hwnd, GWL_STYLE );
style &= ~ES_READONLY;
if (wparam) style |= ES_READONLY;
SetWindowLongW( hwnd, GWL_STYLE, style );
return res;
SendMessageW( hwnd, EM_SETOPTIONS, op, mask );
return 1;
}
case WM_SETTEXT:
{