Support large edit buffers for richedit control.

This commit is contained in:
Aric Stewart 2002-08-16 01:41:32 +00:00 committed by Alexandre Julliard
parent 472a5e52eb
commit 08e693965d
2 changed files with 30 additions and 7 deletions

View file

@ -1843,11 +1843,11 @@ static BOOL EDIT_MakeFit(HWND hwnd, EDITSTATE *es, UINT size)
if (size <= es->buffer_size)
return TRUE;
if (size > es->buffer_limit) {
if ((es->buffer_limit > 0) && (size > es->buffer_limit)) {
EDIT_NOTIFY_PARENT(hwnd, es, EN_MAXTEXT, "EN_MAXTEXT");
return FALSE;
}
if (size > es->buffer_limit)
if ((es->buffer_limit > 0) && (size > es->buffer_limit))
size = es->buffer_limit;
TRACE("trying to ReAlloc to %d+1 characters\n", size);
@ -3413,10 +3413,14 @@ static void EDIT_EM_SetHandle16(HWND hwnd, EDITSTATE *es, HLOCAL16 hloc)
* FIXME: in WinNT maxsize is 0x7FFFFFFF / 0xFFFFFFFF
* However, the windows version is not complied to yet in all of edit.c
*
* Additionally as the wrapper for RichEdit controls we need larger buffers
* at present -1 will represent nolimit
*/
static void EDIT_EM_SetLimitText(EDITSTATE *es, INT limit)
{
if (es->style & ES_MULTILINE) {
if (limit == 0xFFFFFFFF)
es->buffer_limit = -1;
else if (es->style & ES_MULTILINE) {
if (limit)
es->buffer_limit = min(limit, BUFLIMIT_MULTI);
else

View file

@ -222,8 +222,15 @@ static LRESULT WINAPI RICHED32_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam,
return 0;
case EM_EXLIMITTEXT:
DPRINTF_EDIT_MSG32("EM_EXLIMITTEXT Ignored");
return 0;
{
DWORD limit = lParam;
DPRINTF_EDIT_MSG32("EM_EXLIMITTEXT");
if (limit > 65534)
{
limit = 0xFFFFFFFF;
}
return SendMessageA(hwndEdit,EM_SETLIMITTEXT,limit,0);
}
case EM_EXLINEFROMCHAR:
DPRINTF_EDIT_MSG32("EM_EXLINEFROMCHAR -> LINEFROMCHAR");
@ -293,7 +300,7 @@ static LRESULT WINAPI RICHED32_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam,
return 0;
case EM_GETLANGOPTIONS:
DPRINTF_EDIT_MSG32("EM_GETLANGOPTIONS");
DPRINTF_EDIT_MSG32("STUB: EM_GETLANGOPTIONS");
return 0;
case EM_GETOLEINTERFACE:
@ -693,8 +700,20 @@ static LRESULT WINAPI RICHED32_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam,
case WM_CLEAR:
DPRINTF_EDIT_MSG32("WM_CLEAR Passed to default");
return DefWindowProcA( hwnd,uMsg,wParam,lParam);
}
/*
* used by IE in the EULA box
*/
case WM_ALTTABACTIVE:
DPRINTF_EDIT_MSG32("WM_ALTTABACTIVE");
return DefWindowProcA( hwnd,uMsg,wParam,lParam);
case WM_GETDLGCODE:
DPRINTF_EDIT_MSG32("WM_GETDLGCODE");
return DefWindowProcA( hwnd,uMsg,wParam,lParam);
case WM_SETFONT:
DPRINTF_EDIT_MSG32("WM_SETFONT");
return DefWindowProcA( hwnd,uMsg,wParam,lParam);
}
FIXME("Unknown message 0x%x Passed to default hwnd=%08x, wParam=%08x, lParam=%08x\n",
uMsg, hwnd, (UINT)wParam, (UINT)lParam);