From 520ab5c261706f6118a85a82ba84213932ba76e7 Mon Sep 17 00:00:00 2001 From: "Kirill K. Smirnov" Date: Mon, 4 Aug 2008 03:50:39 +0400 Subject: [PATCH] winhlp32: Clear richedit area before setting text. --- programs/winhlp32/winhelp.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/programs/winhlp32/winhelp.c b/programs/winhlp32/winhelp.c index d3f4d1405a5..34f93eedf49 100644 --- a/programs/winhlp32/winhelp.c +++ b/programs/winhlp32/winhelp.c @@ -5,6 +5,7 @@ * 2002 Sylvain Petreolle * 2002, 2008 Eric Pouech * 2004 Ken Belleau + * 2008 Kirill K. Smirnov * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -1101,6 +1102,8 @@ static DWORD CALLBACK WINHELP_RtfStreamIn(DWORD_PTR cookie, BYTE* buff, static void WINHELP_SetupText(HWND hTextWnd, WINHELP_WINDOW* win, ULONG relative) { + /* At first clear area - needed by EM_POSFROMCHAR/EM_SETSCROLLPOS */ + SendMessage(hTextWnd, WM_SETTEXT, 0, (LPARAM)""); SendMessage(hTextWnd, WM_SETREDRAW, FALSE, 0); SendMessage(hTextWnd, EM_SETBKGNDCOLOR, 0, (LPARAM)win->info->sr_color); /* set word-wrap to window size (undocumented) */ @@ -1130,10 +1133,6 @@ static void WINHELP_SetupText(HWND hTextWnd, WINHELP_WINDOW* win, ULONG relative pt.x = 0; pt.y = ptl.y; SendMessage(hTextWnd, EM_SETSCROLLPOS, 0, (LPARAM)&pt); } - else - { - SendMessage(hTextWnd, WM_SETTEXT, 0, (LPARAM)""); - } SendMessage(hTextWnd, WM_SETREDRAW, TRUE, 0); InvalidateRect(hTextWnd, NULL, TRUE); } -- 2.11.4.GIT