From a7c3107148b9fd14d3c029e7e771e00de02bf2f6 Mon Sep 17 00:00:00 2001 From: Krishna Murthy Date: Fri, 7 May 2004 00:40:18 +0000 Subject: [PATCH] EM_UNDO should always return TRUE for single line edit. --- controls/edit.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/controls/edit.c b/controls/edit.c index b206821ec3..1a73ae4ae0 100644 --- a/controls/edit.c +++ b/controls/edit.c @@ -3534,11 +3534,15 @@ static BOOL EDIT_EM_Undo(EDITSTATE *es) INT ulength; LPWSTR utext; - /* Protect read-only edit control from modification */ - if(es->style & ES_READONLY) - return FALSE; + /* As per MSDN spec, for a single-line edit control, + the return value is always TRUE */ + if( es->style & ES_READONLY ) + return !(es->style & ES_MULTILINE); ulength = strlenW(es->undo_text); + if( ulength == 0 ) + return !(es->style & ES_MULTILINE); + utext = HeapAlloc(GetProcessHeap(), 0, (ulength + 1) * sizeof(WCHAR)); strcpyW(utext, es->undo_text); -- 2.32.0.93.g670b81a890