Dylan Smith : richedit: Prevented an assertion error on startup when run on Windows.

Alexandre Julliard julliard at winehq.org
Thu Jun 26 14:50:40 CDT 2008


Module: wine
Branch: master
Commit: 67024f0f3448e970aaa75fa4de546cfd8aa0fc44
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=67024f0f3448e970aaa75fa4de546cfd8aa0fc44

Author: Dylan Smith <dylan.ah.smith at gmail.com>
Date:   Wed Jun 25 11:33:13 2008 -0400

richedit: Prevented an assertion error on startup when run on Windows.

The call to GetClientRect returns 0 values for the returned RECT when
called in WM_NCCREATE in on Windows, which ended up causing an assertion
error when Wine's riched20.dll replaces the native version. Moving the
call to WM_CREATE fixes this problem (probably because NCCALCSIZE is
called in between).

---

 dlls/riched20/editor.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c
index b9f41d2..e71c384 100644
--- a/dlls/riched20/editor.c
+++ b/dlls/riched20/editor.c
@@ -1666,7 +1666,6 @@ ME_TextEditor *ME_MakeEditor(HWND hWnd) {
   ed->mode = TM_RICHTEXT | TM_MULTILEVELUNDO | TM_MULTICODEPAGE;
   ed->AutoURLDetect_bEnable = FALSE;
   ed->bHaveFocus = FALSE;
-  GetClientRect(hWnd, &ed->rcFormat);
   for (i=0; i<HFONT_CACHE_SIZE; i++)
   {
     ed->pFontCache[i].nRefs = 0;
@@ -2934,6 +2933,7 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam,
     return (wParam >= 0x40000) ? 0 : MAKELONG( pt.x, pt.y );
   }
   case WM_CREATE:
+    GetClientRect(hWnd, &editor->rcFormat);
     if (GetWindowLongW(hWnd, GWL_STYLE) & WS_HSCROLL)
     { /* Squelch the default horizontal scrollbar it would make */
       ShowScrollBar(editor->hWnd, SB_HORZ, FALSE);




More information about the wine-cvs mailing list