Commit 08e69396 authored by Aric Stewart's avatar Aric Stewart Committed by Alexandre Julliard

Support large edit buffers for richedit control.

parent 472a5e52
...@@ -1843,11 +1843,11 @@ static BOOL EDIT_MakeFit(HWND hwnd, EDITSTATE *es, UINT size) ...@@ -1843,11 +1843,11 @@ static BOOL EDIT_MakeFit(HWND hwnd, EDITSTATE *es, UINT size)
if (size <= es->buffer_size) if (size <= es->buffer_size)
return TRUE; 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"); EDIT_NOTIFY_PARENT(hwnd, es, EN_MAXTEXT, "EN_MAXTEXT");
return FALSE; return FALSE;
} }
if (size > es->buffer_limit) if ((es->buffer_limit > 0) && (size > es->buffer_limit))
size = es->buffer_limit; size = es->buffer_limit;
TRACE("trying to ReAlloc to %d+1 characters\n", size); 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) ...@@ -3413,10 +3413,14 @@ static void EDIT_EM_SetHandle16(HWND hwnd, EDITSTATE *es, HLOCAL16 hloc)
* FIXME: in WinNT maxsize is 0x7FFFFFFF / 0xFFFFFFFF * FIXME: in WinNT maxsize is 0x7FFFFFFF / 0xFFFFFFFF
* However, the windows version is not complied to yet in all of edit.c * 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) 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) if (limit)
es->buffer_limit = min(limit, BUFLIMIT_MULTI); es->buffer_limit = min(limit, BUFLIMIT_MULTI);
else else
......
...@@ -222,8 +222,15 @@ static LRESULT WINAPI RICHED32_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, ...@@ -222,8 +222,15 @@ static LRESULT WINAPI RICHED32_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam,
return 0; return 0;
case EM_EXLIMITTEXT: 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: case EM_EXLINEFROMCHAR:
DPRINTF_EDIT_MSG32("EM_EXLINEFROMCHAR -> LINEFROMCHAR"); DPRINTF_EDIT_MSG32("EM_EXLINEFROMCHAR -> LINEFROMCHAR");
...@@ -293,7 +300,7 @@ static LRESULT WINAPI RICHED32_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, ...@@ -293,7 +300,7 @@ static LRESULT WINAPI RICHED32_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam,
return 0; return 0;
case EM_GETLANGOPTIONS: case EM_GETLANGOPTIONS:
DPRINTF_EDIT_MSG32("EM_GETLANGOPTIONS"); DPRINTF_EDIT_MSG32("STUB: EM_GETLANGOPTIONS");
return 0; return 0;
case EM_GETOLEINTERFACE: case EM_GETOLEINTERFACE:
...@@ -693,8 +700,20 @@ static LRESULT WINAPI RICHED32_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, ...@@ -693,8 +700,20 @@ static LRESULT WINAPI RICHED32_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam,
case WM_CLEAR: case WM_CLEAR:
DPRINTF_EDIT_MSG32("WM_CLEAR Passed to default"); DPRINTF_EDIT_MSG32("WM_CLEAR Passed to default");
return DefWindowProcA( hwnd,uMsg,wParam,lParam); 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", FIXME("Unknown message 0x%x Passed to default hwnd=%08x, wParam=%08x, lParam=%08x\n",
uMsg, hwnd, (UINT)wParam, (UINT)lParam); uMsg, hwnd, (UINT)wParam, (UINT)lParam);
......
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