Commit 5d75cac4 authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

riched20: Implement EM_SETREADONLY using EM_SETOPTIONS.

parent b4564200
...@@ -3779,14 +3779,6 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam, ...@@ -3779,14 +3779,6 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam,
return 0; return 0;
} }
case EM_SETREADONLY:
{
if (wParam)
editor->styleFlags |= ES_READONLY;
else
editor->styleFlags &= ~ES_READONLY;
return 1;
}
case EM_SETEVENTMASK: case EM_SETEVENTMASK:
{ {
DWORD nOldMask = editor->nEventMask; DWORD nOldMask = editor->nEventMask;
......
...@@ -1002,14 +1002,11 @@ static LRESULT RichEditWndProc_common( HWND hwnd, UINT msg, WPARAM wparam, ...@@ -1002,14 +1002,11 @@ static LRESULT RichEditWndProc_common( HWND hwnd, UINT msg, WPARAM wparam,
} }
case EM_SETREADONLY: 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 ); SendMessageW( hwnd, EM_SETOPTIONS, op, mask );
style = GetWindowLongW( hwnd, GWL_STYLE ); return 1;
style &= ~ES_READONLY;
if (wparam) style |= ES_READONLY;
SetWindowLongW( hwnd, GWL_STYLE, style );
return res;
} }
case WM_SETTEXT: case WM_SETTEXT:
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment