From 30559d9cdb0196066adda528a86ae851dceb0356 Mon Sep 17 00:00:00 2001 From: "Marat Zakiyanov (Mario79)" Date: Sun, 19 Jan 2014 22:06:48 +0000 Subject: [PATCH] Tinypad - fix r.4487 for popup window. git-svn-id: svn://kolibrios.org@4489 a494cfbc-eb01-0410-851d-a64ba20cac60 --- .../develop/tinypad/trunk/data/tp-udata.inc | 2 + .../develop/tinypad/trunk/tp-clipboard.asm | 49 +++++++++++++++++++ programs/develop/tinypad/trunk/tp-popup.asm | 3 +- 3 files changed, 53 insertions(+), 1 deletion(-) diff --git a/programs/develop/tinypad/trunk/data/tp-udata.inc b/programs/develop/tinypad/trunk/data/tp-udata.inc index 8efe9fbf44..587db212b4 100644 --- a/programs/develop/tinypad/trunk/data/tp-udata.inc +++ b/programs/develop/tinypad/trunk/data/tp-udata.inc @@ -96,6 +96,8 @@ just_from_popup db ? bot_mode db ? bot_mode2 db ? +popup_valid_text db ? + align 4 bot_dlg_height dd ? diff --git a/programs/develop/tinypad/trunk/tp-clipboard.asm b/programs/develop/tinypad/trunk/tp-clipboard.asm index 4a1f7981f7..525ca238c4 100644 --- a/programs/develop/tinypad/trunk/tp-clipboard.asm +++ b/programs/develop/tinypad/trunk/tp-clipboard.asm @@ -123,6 +123,55 @@ get_from_clipboard: popad ret ;----------------------------------------------------------------------------- +check_clipboard_for_popup: + pushad + mov [popup_valid_text],0 + mcall 54,0 +; no slots of clipboard ? + test eax,eax + jz .exit +; main list area not found ? + inc eax + test eax,eax + jz .exit + + sub eax,2 + mov ecx,eax + mcall 54,1 +; main list area not found ? + inc eax + test eax,eax + jz .exit +; error ? + sub eax,2 + test eax,eax + jz .exit + + inc eax + mov [clipboard_buf],eax +; check contents of container + mov ebx,[eax+4] +; check for text + test ebx,ebx + jnz .remove_area + + mov ebx,[eax+8] +; check for cp866 + cmp bl,1 + jnz .remove_area + +.yes_valid_text: + mov [popup_valid_text],1 +; remove unnecessary memory area +.remove_area: + xor eax,eax + stdcall mem.ReAlloc,[clipboard_buf],eax + mov [clipboard_buf],eax +;-------------------------------------- +.exit: + popad + ret +;----------------------------------------------------------------------------- convert_clipboard_buf_to_copy_buf: mov edi,[copy_buf] mov ebx,edi diff --git a/programs/develop/tinypad/trunk/tp-popup.asm b/programs/develop/tinypad/trunk/tp-popup.asm index d7fb2bbf53..b14342a21b 100644 --- a/programs/develop/tinypad/trunk/tp-popup.asm +++ b/programs/develop/tinypad/trunk/tp-popup.asm @@ -240,7 +240,8 @@ onshow: .edit: or byte[mm.Edit+2],0x01 - cmp [copy_size],0 + call check_clipboard_for_popup + cmp [popup_valid_text],0 jne @f and byte[mm.Edit+2],0xFE @@: or dword[mm.Edit+0],0x01000101