[PATCH] richedit: (4/4) Do not read actual scrollbar state for scrollbar update, use internal state instead

Alex Villacís Lasso alex at karlalex.palosanto.com
Sun Jul 20 11:29:19 CDT 2008


As shown by previous patches, reliance on the actual scroll state causes problems with misbehaving applications that force visibility of scroll bars on the richedit control. So rely on an cached state instead of reading the actual scrollbar state. Fixes a bunch of todo_wine's introduced by previous test patches.
---
 dlls/riched20/editor.c       |   21 +++++++++++
 dlls/riched20/editstr.h      |    3 ++
 dlls/riched20/paint.c        |   36 ++++++++++++++-----
 dlls/riched20/tests/editor.c |   77 +++++++----------------------------------
 4 files changed, 63 insertions(+), 74 deletions(-)

diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c
index 2dd758a..a801ee2 100644
--- a/dlls/riched20/editor.c
+++ b/dlls/riched20/editor.c
@@ -1807,6 +1807,13 @@ ME_TextEditor *ME_MakeEditor(HWND hWnd) {
   
   ed->notified_cr.cpMin = ed->notified_cr.cpMax = 0;
 
+  /* Default vertical scrollbar information */
+  ed->vert_si.cbSize = sizeof(SCROLLINFO);
+  ed->vert_si.nMin = 0;
+  ed->vert_si.nMax = 0;
+  ed->vert_si.nPage = 0;
+  ed->vert_si.nPos = 0;
+
   return ed;
 }
 
@@ -3055,15 +3062,29 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam,
     return (wParam >= 0x40000) ? 0 : MAKELONG( pt.x, pt.y );
   }
   case WM_CREATE:
+  {
+    SCROLLINFO si;
+
     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);
     }
+
+    si.cbSize = sizeof(si);
+    si.fMask = SIF_PAGE | SIF_RANGE;
+    if (GetWindowLongW(hWnd, GWL_STYLE) & ES_DISABLENOSCROLL)
+      si.fMask |= SIF_DISABLENOSCROLL;
+    si.nMax = (si.fMask & SIF_DISABLENOSCROLL) ? 1 : 0;
+    si.nMin = 0;
+    si.nPage = 0;
+    SetScrollInfo(hWnd, SB_VERT, &si, TRUE);
+
     ME_CommitUndo(editor);
     ME_WrapMarkedParagraphs(editor);
     ME_MoveCaret(editor);
     return 0;
+  }
   case WM_DESTROY:
     ME_DestroyEditor(editor);
     SetWindowLongPtrW(hWnd, 0, 0);
diff --git a/dlls/riched20/editstr.h b/dlls/riched20/editstr.h
index 81f4cc3..6dc0184 100644
--- a/dlls/riched20/editstr.h
+++ b/dlls/riched20/editstr.h
@@ -343,6 +343,9 @@ typedef struct tagME_TextEditor
 
   /* Track previous notified selection */
   CHARRANGE notified_cr;
+  
+  /* Cache previously set vertical scrollbar info */
+  SCROLLINFO vert_si;
 } ME_TextEditor;
 
 typedef struct tagME_Context
diff --git a/dlls/riched20/paint.c b/dlls/riched20/paint.c
index a6e86b3..c5c938c 100644
--- a/dlls/riched20/paint.c
+++ b/dlls/riched20/paint.c
@@ -784,6 +784,7 @@ void ME_Scroll(ME_TextEditor *editor, int value, int type)
     ME_Repaint(editor);
   }
   
+  editor->vert_si.nMax = 0;
   ME_UpdateScrollBar(editor);
 }
 
@@ -806,6 +807,14 @@ void ME_Scroll(ME_TextEditor *editor, int value, int type)
   bScrollBarWasVisible = ME_GetYScrollVisible(editor);
   bScrollBarWillBeVisible = editor->nHeight > editor->sizeWindow.cy;
   
+  si.fMask = SIF_PAGE | SIF_RANGE;
+  if (GetWindowLongW(hWnd, GWL_STYLE) & ES_DISABLENOSCROLL)
+    si.fMask |= SIF_DISABLENOSCROLL;
+  if ((si.fMask & SIF_DISABLENOSCROLL)) 
+  {
+    bScrollBarWillBeVisible = TRUE;
+  }
+
   if (bScrollBarWasVisible != bScrollBarWillBeVisible)
   {
     ShowScrollBar(hWnd, SB_VERT, bScrollBarWillBeVisible);
@@ -813,17 +822,27 @@ void ME_Scroll(ME_TextEditor *editor, int value, int type)
     ME_WrapMarkedParagraphs(editor);
   }
   
-  si.fMask = SIF_PAGE | SIF_RANGE;
-  if (GetWindowLongW(hWnd, GWL_STYLE) & ES_DISABLENOSCROLL)
-    si.fMask |= SIF_DISABLENOSCROLL;
-  
   si.nMin = 0;  
   si.nMax = editor->nTotalLength;
 
   si.nPage = editor->sizeWindow.cy;
      
-  TRACE("min=%d max=%d page=%d\n", si.nMin, si.nMax, si.nPage);
-  SetScrollInfo(hWnd, SB_VERT, &si, TRUE);
+  if (!(si.nMin == editor->vert_si.nMin && si.nMax == editor->vert_si.nMax && si.nPage == editor->vert_si.nPage))
+  {
+    TRACE("min=%d max=%d page=%d\n", si.nMin, si.nMax, si.nPage);
+    editor->vert_si.nMin = si.nMin;
+    editor->vert_si.nMax = si.nMax;
+    editor->vert_si.nPage = si.nPage;
+    if (bScrollBarWillBeVisible)
+    {
+      SetScrollInfo(hWnd, SB_VERT, &si, TRUE);
+    }
+    else
+    {
+      if (bScrollBarWasVisible && !(si.fMask & SIF_DISABLENOSCROLL))
+        ShowScrollBar(hWnd, SB_VERT, FALSE);
+    }
+  }
 }
 
 int ME_GetYScrollPos(ME_TextEditor *editor)
@@ -836,10 +855,7 @@ int ME_GetYScrollPos(ME_TextEditor *editor)
 
 BOOL ME_GetYScrollVisible(ME_TextEditor *editor)
 { /* Returns true if the scrollbar is visible */
-  SCROLLBARINFO sbi;
-  sbi.cbSize = sizeof(sbi);
-  GetScrollBarInfo(editor->hWnd, OBJID_VSCROLL, &sbi);
-  return ((sbi.rgstate[0] & STATE_SYSTEM_INVISIBLE) == 0);
+  return (editor->vert_si.nMax - editor->vert_si.nMin >= max(editor->vert_si.nPage - 1, 0));
 }
 
 void ME_EnsureVisible(ME_TextEditor *editor, ME_DisplayItem *pRun)
diff --git a/dlls/riched20/tests/editor.c b/dlls/riched20/tests/editor.c
index e7e25ab..49b13e8 100644
--- a/dlls/riched20/tests/editor.c
+++ b/dlls/riched20/tests/editor.c
@@ -2280,11 +2280,9 @@ static void test_scrollbar_visibility(void)
   GetScrollInfo(hwndRichEdit, SB_VERT, &si);
   ok (((GetWindowLongA(hwndRichEdit, GWL_STYLE) & WS_VSCROLL) == 0),
     "Vertical scrollbar is visible, should be invisible.\n");
-  todo_wine {
   ok(si.nPage == 0 && si.nMin == 0 && si.nMax == 0,
         "reported page/range is %d (%d..%d) expected all 0\n",
         si.nPage, si.nMin, si.nMax);
-  }
 
   SendMessage(hwndRichEdit, WM_SETTEXT, 0, 0);
   memset(&si, 0, sizeof(si));
@@ -2293,11 +2291,9 @@ static void test_scrollbar_visibility(void)
   GetScrollInfo(hwndRichEdit, SB_VERT, &si);
   ok (((GetWindowLongA(hwndRichEdit, GWL_STYLE) & WS_VSCROLL) == 0), 
     "Vertical scrollbar is visible, should be invisible.\n");
-  todo_wine {
   ok(si.nPage == 0 && si.nMin == 0 && si.nMax == 0,
         "reported page/range is %d (%d..%d) expected all 0\n",
         si.nPage, si.nMin, si.nMax);
-  }
 
   SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)text);
   memset(&si, 0, sizeof(si));
@@ -2378,26 +2374,22 @@ static void test_scrollbar_visibility(void)
   si.cbSize = sizeof(si);
   si.fMask = SIF_PAGE | SIF_RANGE;
   GetScrollInfo(hwndRichEdit, SB_VERT, &si);
-  todo_wine {
   ok (((GetWindowLongA(hwndRichEdit, GWL_STYLE) & WS_VSCROLL) != 0),
     "Vertical scrollbar is invisible, should be visible.\n");
   ok(si.nPage == 0 && si.nMin == 0 && si.nMax == 1,
         "reported page/range is %d (%d..%d) expected 0 (0..1)\n",
         si.nPage, si.nMin, si.nMax);
-  }
 
   SendMessage(hwndRichEdit, WM_SETTEXT, 0, 0);
   memset(&si, 0, sizeof(si));
   si.cbSize = sizeof(si);
   si.fMask = SIF_PAGE | SIF_RANGE;
   GetScrollInfo(hwndRichEdit, SB_VERT, &si);
-  todo_wine {
   ok (((GetWindowLongA(hwndRichEdit, GWL_STYLE) & WS_VSCROLL) != 0), 
     "Vertical scrollbar is invisible, should be visible.\n");
   ok(si.nPage == 0 && si.nMin == 0 && si.nMax == 1,
         "reported page/range is %d (%d..%d) expected 0 (0..1)\n",
         si.nPage, si.nMin, si.nMax);
-  }
 
   SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)text);
   memset(&si, 0, sizeof(si));
@@ -2416,10 +2408,8 @@ static void test_scrollbar_visibility(void)
   si.cbSize = sizeof(si);
   si.fMask = SIF_PAGE | SIF_RANGE;
   GetScrollInfo(hwndRichEdit, SB_VERT, &si);
-  todo_wine {
   ok (((GetWindowLongA(hwndRichEdit, GWL_STYLE) & WS_VSCROLL) != 0), 
     "Vertical scrollbar is invisible, should be visible.\n");
-  }
   ok(si.nPage != 0 && si.nMin == 0 && si.nMax > 1,
         "reported page/range is %d (%d..%d) expected nMax/nPage nonzero\n",
         si.nPage, si.nMin, si.nMax);
@@ -2430,10 +2420,8 @@ static void test_scrollbar_visibility(void)
   si.cbSize = sizeof(si);
   si.fMask = SIF_PAGE | SIF_RANGE;
   GetScrollInfo(hwndRichEdit, SB_VERT, &si);
-  todo_wine {
   ok (((GetWindowLongA(hwndRichEdit, GWL_STYLE) & WS_VSCROLL) != 0), 
     "Vertical scrollbar is invisible, should be visible.\n");
-  }
   ok(si.nPage != 0 && si.nMin == 0 && si.nMax > 1,
         "reported page/range is %d (%d..%d) expected nMax/nPage nonzero\n",
         si.nPage, si.nMin, si.nMax);
@@ -2443,10 +2431,8 @@ static void test_scrollbar_visibility(void)
   si.cbSize = sizeof(si);
   si.fMask = SIF_PAGE | SIF_RANGE;
   GetScrollInfo(hwndRichEdit, SB_VERT, &si);
-  todo_wine {
   ok (((GetWindowLongA(hwndRichEdit, GWL_STYLE) & WS_VSCROLL) != 0), 
     "Vertical scrollbar is invisible, should be visible.\n");
-  }
   ok(si.nPage != 0 && si.nMin == 0 && si.nMax > 1,
         "reported page/range is %d (%d..%d) expected nMax/nPage nonzero\n",
         si.nPage, si.nMin, si.nMax);
@@ -2456,10 +2442,8 @@ static void test_scrollbar_visibility(void)
   si.cbSize = sizeof(si);
   si.fMask = SIF_PAGE | SIF_RANGE;
   GetScrollInfo(hwndRichEdit, SB_VERT, &si);
-  todo_wine {
   ok (((GetWindowLongA(hwndRichEdit, GWL_STYLE) & WS_VSCROLL) != 0), 
     "Vertical scrollbar is invisible, should be visible.\n");
-  }
   ok(si.nPage != 0 && si.nMin == 0 && si.nMax > 1,
         "reported page/range is %d (%d..%d) expected nMax/nPage nonzero\n",
         si.nPage, si.nMin, si.nMax);
@@ -2469,10 +2453,8 @@ static void test_scrollbar_visibility(void)
   si.cbSize = sizeof(si);
   si.fMask = SIF_PAGE | SIF_RANGE;
   GetScrollInfo(hwndRichEdit, SB_VERT, &si);
-  todo_wine {
   ok (((GetWindowLongA(hwndRichEdit, GWL_STYLE) & WS_VSCROLL) != 0), 
     "Vertical scrollbar is invisible, should be visible.\n");
-  }
   ok(si.nPage != 0 && si.nMin == 0 && si.nMax > 1,
         "reported page/range is %d (%d..%d) expected nMax/nPage nonzero\n",
         si.nPage, si.nMin, si.nMax);
@@ -2488,10 +2470,8 @@ static void test_scrollbar_visibility(void)
   si.cbSize = sizeof(si);
   si.fMask = SIF_PAGE | SIF_RANGE;
   GetScrollInfo(hwndRichEdit, SB_VERT, &si);
-  todo_wine {
   ok (((GetWindowLongA(hwndRichEdit, GWL_STYLE) & WS_VSCROLL) != 0), 
     "Vertical scrollbar is invisible, should be visible.\n");
-  }
   todo_wine {
   ok(si.nPage == 0 && si.nMin == 0 && si.nMax == 100,
         "reported page/range is %d (%d..%d) expected 0 (0..100)\n",
@@ -2504,10 +2484,8 @@ static void test_scrollbar_visibility(void)
   si.cbSize = sizeof(si);
   si.fMask = SIF_PAGE | SIF_RANGE;
   GetScrollInfo(hwndRichEdit, SB_VERT, &si);
-  todo_wine {
   ok (((GetWindowLongA(hwndRichEdit, GWL_STYLE) & WS_VSCROLL) != 0), 
     "Vertical scrollbar is invisible, should be visible.\n");
-  }
   todo_wine {
   ok(si.nPage == 0 && si.nMin == 0 && si.nMax == 100,
         "reported page/range is %d (%d..%d) expected 0 (0..100)\n",
@@ -2520,10 +2498,8 @@ static void test_scrollbar_visibility(void)
   si.cbSize = sizeof(si);
   si.fMask = SIF_PAGE | SIF_RANGE;
   GetScrollInfo(hwndRichEdit, SB_VERT, &si);
-  todo_wine {
   ok (((GetWindowLongA(hwndRichEdit, GWL_STYLE) & WS_VSCROLL) != 0), 
     "Vertical scrollbar is invisible, should be visible.\n");
-  }
   todo_wine {
   ok(si.nPage == 0 && si.nMin == 0 && si.nMax == 100,
         "reported page/range is %d (%d..%d) expected 0 (0..100)\n",
@@ -2536,10 +2512,8 @@ static void test_scrollbar_visibility(void)
   si.cbSize = sizeof(si);
   si.fMask = SIF_PAGE | SIF_RANGE;
   GetScrollInfo(hwndRichEdit, SB_VERT, &si);
-  todo_wine {
   ok (((GetWindowLongA(hwndRichEdit, GWL_STYLE) & WS_VSCROLL) != 0), 
     "Vertical scrollbar is invisible, should be visible.\n");
-  }
   todo_wine {
   ok(si.nPage == 0 && si.nMin == 0 && si.nMax == 100,
         "reported page/range is %d (%d..%d) expected 0 (0..100)\n",
@@ -2552,10 +2526,8 @@ static void test_scrollbar_visibility(void)
   si.cbSize = sizeof(si);
   si.fMask = SIF_PAGE | SIF_RANGE;
   GetScrollInfo(hwndRichEdit, SB_VERT, &si);
-  todo_wine {
   ok (((GetWindowLongA(hwndRichEdit, GWL_STYLE) & WS_VSCROLL) != 0), 
     "Vertical scrollbar is invisible, should be visible.\n");
-  }
   todo_wine {
   ok(si.nPage == 0 && si.nMin == 0 && si.nMax == 100,
         "reported page/range is %d (%d..%d) expected 0 (0..100)\n",
@@ -2585,11 +2557,10 @@ static void test_scrollbar_visibility(void)
   GetScrollInfo(hwndRichEdit, SB_VERT, &si);
   ok (((GetWindowLongA(hwndRichEdit, GWL_STYLE) & WS_VSCROLL) == 0), 
     "Vertical scrollbar is visible, should be invisible.\n");
-  todo_wine {
   ok(si.nPage == 0 && si.nMin == 0 && si.nMax == 0,
         "reported page/range is %d (%d..%d) expected all 0\n",
         si.nPage, si.nMin, si.nMax);
-  }
+
   SendMessage(hwndRichEdit, WM_SETTEXT, 0, 0);
   memset(&si, 0, sizeof(si));
   si.cbSize = sizeof(si);
@@ -2597,11 +2568,10 @@ static void test_scrollbar_visibility(void)
   GetScrollInfo(hwndRichEdit, SB_VERT, &si);
   ok (((GetWindowLongA(hwndRichEdit, GWL_STYLE) & WS_VSCROLL) == 0), 
     "Vertical scrollbar is visible, should be invisible.\n");
-  todo_wine {
   ok(si.nPage == 0 && si.nMin == 0 && si.nMax == 0,
         "reported page/range is %d (%d..%d) expected all 0\n",
         si.nPage, si.nMin, si.nMax);
-  }
+
   SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)"a");
   memset(&si, 0, sizeof(si));
   si.cbSize = sizeof(si);
@@ -2609,11 +2579,10 @@ static void test_scrollbar_visibility(void)
   GetScrollInfo(hwndRichEdit, SB_VERT, &si);
   ok (((GetWindowLongA(hwndRichEdit, GWL_STYLE) & WS_VSCROLL) == 0), 
     "Vertical scrollbar is visible, should be invisible.\n");
-  todo_wine {
   ok(si.nPage == 0 && si.nMin == 0 && si.nMax == 0,
         "reported page/range is %d (%d..%d) expected all 0\n",
         si.nPage, si.nMin, si.nMax);
-  }
+
   SendMessage(hwndRichEdit, WM_SETTEXT, 0, 0);
   memset(&si, 0, sizeof(si));
   si.cbSize = sizeof(si);
@@ -2621,11 +2590,10 @@ static void test_scrollbar_visibility(void)
   GetScrollInfo(hwndRichEdit, SB_VERT, &si);
   ok (((GetWindowLongA(hwndRichEdit, GWL_STYLE) & WS_VSCROLL) == 0), 
     "Vertical scrollbar is visible, should be invisible.\n");
-  todo_wine {
   ok(si.nPage == 0 && si.nMin == 0 && si.nMax == 0,
         "reported page/range is %d (%d..%d) expected all 0\n",
         si.nPage, si.nMin, si.nMax);
-  }
+
   SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)text);
   memset(&si, 0, sizeof(si));
   si.cbSize = sizeof(si);
@@ -2643,10 +2611,8 @@ static void test_scrollbar_visibility(void)
   si.cbSize = sizeof(si);
   si.fMask = SIF_PAGE | SIF_RANGE;
   GetScrollInfo(hwndRichEdit, SB_VERT, &si);
-  todo_wine {
   ok (((GetWindowLongA(hwndRichEdit, GWL_STYLE) & WS_VSCROLL) == 0), 
     "Vertical scrollbar is visible, should be invisible.\n");
-  }
   ok(si.nPage != 0 && si.nMin == 0 && si.nMax != 0,
         "reported page/range is %d (%d..%d)\n",
         si.nPage, si.nMin, si.nMax);
@@ -2656,10 +2622,8 @@ static void test_scrollbar_visibility(void)
   si.cbSize = sizeof(si);
   si.fMask = SIF_PAGE | SIF_RANGE;
   GetScrollInfo(hwndRichEdit, SB_VERT, &si);
-  todo_wine {
   ok (((GetWindowLongA(hwndRichEdit, GWL_STYLE) & WS_VSCROLL) == 0), 
     "Vertical scrollbar is visible, should be invisible.\n");
-  }
   ok(si.nPage != 0 && si.nMin == 0 && si.nMax != 0,
         "reported page/range is %d (%d..%d)\n",
         si.nPage, si.nMin, si.nMax);
@@ -2682,10 +2646,8 @@ static void test_scrollbar_visibility(void)
   si.cbSize = sizeof(si);
   si.fMask = SIF_PAGE | SIF_RANGE;
   GetScrollInfo(hwndRichEdit, SB_VERT, &si);
-  todo_wine {
   ok (((GetWindowLongA(hwndRichEdit, GWL_STYLE) & WS_VSCROLL) == 0), 
     "Vertical scrollbar is visible, should be invisible.\n");
-  }
   ok(si.nPage != 0 && si.nMin == 0 && si.nMax != 0,
         "reported page/range is %d (%d..%d)\n",
         si.nPage, si.nMin, si.nMax);
@@ -2743,11 +2705,10 @@ static void test_scrollbar_visibility(void)
   GetScrollInfo(hwndRichEdit, SB_VERT, &si);
   ok (((GetWindowLongA(hwndRichEdit, GWL_STYLE) & WS_VSCROLL) != 0), 
     "Vertical scrollbar is invisible, should be visible.\n");
-  todo_wine {
   ok(si.nPage == 0 && si.nMin == 0 && si.nMax == 0,
         "reported page/range is %d (%d..%d) expected all 0\n",
         si.nPage, si.nMin, si.nMax);
-  }
+
   /* Ditto, see above */
   SendMessage(hwndRichEdit, WM_SETTEXT, 0, 0);
   memset(&si, 0, sizeof(si));
@@ -2756,50 +2717,46 @@ static void test_scrollbar_visibility(void)
   GetScrollInfo(hwndRichEdit, SB_VERT, &si);
   ok (((GetWindowLongA(hwndRichEdit, GWL_STYLE) & WS_VSCROLL) != 0), 
     "Vertical scrollbar is invisible, should be visible.\n");
-  todo_wine {
   ok(si.nPage == 0 && si.nMin == 0 && si.nMax == 0,
         "reported page/range is %d (%d..%d) expected all 0\n",
         si.nPage, si.nMin, si.nMax);
-  }
+
   /* Ditto, see above */
   SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)"a");
   memset(&si, 0, sizeof(si));
   si.cbSize = sizeof(si);
   si.fMask = SIF_PAGE | SIF_RANGE;
   GetScrollInfo(hwndRichEdit, SB_VERT, &si);
-  todo_wine {
   ok (((GetWindowLongA(hwndRichEdit, GWL_STYLE) & WS_VSCROLL) != 0), 
     "Vertical scrollbar is invisible, should be visible.\n");
   ok(si.nPage == 0 && si.nMin == 0 && si.nMax == 0,
         "reported page/range is %d (%d..%d) expected all 0\n",
         si.nPage, si.nMin, si.nMax);
-  }
+
   /* Ditto, see above */
   SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)"a\na");
   memset(&si, 0, sizeof(si));
   si.cbSize = sizeof(si);
   si.fMask = SIF_PAGE | SIF_RANGE;
   GetScrollInfo(hwndRichEdit, SB_VERT, &si);
-  todo_wine {
   ok (((GetWindowLongA(hwndRichEdit, GWL_STYLE) & WS_VSCROLL) != 0), 
     "Vertical scrollbar is invisible, should be visible.\n");
   ok(si.nPage == 0 && si.nMin == 0 && si.nMax == 0,
         "reported page/range is %d (%d..%d) expected all 0\n",
         si.nPage, si.nMin, si.nMax);
-  }
+
   /* Ditto, see above */
   SendMessage(hwndRichEdit, WM_SETTEXT, 0, 0);
   memset(&si, 0, sizeof(si));
   si.cbSize = sizeof(si);
   si.fMask = SIF_PAGE | SIF_RANGE;
   GetScrollInfo(hwndRichEdit, SB_VERT, &si);
-  todo_wine {
   ok (((GetWindowLongA(hwndRichEdit, GWL_STYLE) & WS_VSCROLL) != 0), 
     "Vertical scrollbar is invisible, should be visible.\n");
   ok(si.nPage == 0 && si.nMin == 0 && si.nMax == 0,
         "reported page/range is %d (%d..%d) expected all 0\n",
         si.nPage, si.nMin, si.nMax);
-  }
+
   SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)text);
   SendMessage(hwndRichEdit, WM_SETTEXT, 0, 0);
   memset(&si, 0, sizeof(si));
@@ -2823,11 +2780,10 @@ static void test_scrollbar_visibility(void)
   GetScrollInfo(hwndRichEdit, SB_VERT, &si);
   ok (((GetWindowLongA(hwndRichEdit, GWL_STYLE) & WS_VSCROLL) == 0), 
     "Vertical scrollbar is visible, should be invisible.\n");
-  todo_wine {
   ok(si.nPage == 0 && si.nMin == 0 && si.nMax == 0,
         "reported page/range is %d (%d..%d) expected all 0\n",
         si.nPage, si.nMin, si.nMax);
-  }
+
   SendMessage(hwndRichEdit, WM_SETTEXT, 0, 0);
   memset(&si, 0, sizeof(si));
   si.cbSize = sizeof(si);
@@ -2835,11 +2791,10 @@ static void test_scrollbar_visibility(void)
   GetScrollInfo(hwndRichEdit, SB_VERT, &si);
   ok (((GetWindowLongA(hwndRichEdit, GWL_STYLE) & WS_VSCROLL) == 0), 
     "Vertical scrollbar is visible, should be invisible.\n");
-  todo_wine {
   ok(si.nPage == 0 && si.nMin == 0 && si.nMax == 0,
         "reported page/range is %d (%d..%d) expected all 0\n",
         si.nPage, si.nMin, si.nMax);
-  }
+
   SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)"a");
   memset(&si, 0, sizeof(si));
   si.cbSize = sizeof(si);
@@ -2847,11 +2802,10 @@ static void test_scrollbar_visibility(void)
   GetScrollInfo(hwndRichEdit, SB_VERT, &si);
   ok (((GetWindowLongA(hwndRichEdit, GWL_STYLE) & WS_VSCROLL) == 0), 
     "Vertical scrollbar is visible, should be invisible.\n");
-  todo_wine {
   ok(si.nPage == 0 && si.nMin == 0 && si.nMax == 0,
         "reported page/range is %d (%d..%d) expected all 0\n",
         si.nPage, si.nMin, si.nMax);
-  }
+
   SendMessage(hwndRichEdit, WM_SETTEXT, 0, 0);
   memset(&si, 0, sizeof(si));
   si.cbSize = sizeof(si);
@@ -2859,11 +2813,10 @@ static void test_scrollbar_visibility(void)
   GetScrollInfo(hwndRichEdit, SB_VERT, &si);
   ok (((GetWindowLongA(hwndRichEdit, GWL_STYLE) & WS_VSCROLL) == 0), 
     "Vertical scrollbar is visible, should be invisible.\n");
-  todo_wine {
   ok(si.nPage == 0 && si.nMin == 0 && si.nMax == 0,
         "reported page/range is %d (%d..%d) expected all 0\n",
         si.nPage, si.nMin, si.nMax);
-  }
+
   SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)text);
   memset(&si, 0, sizeof(si));
   si.cbSize = sizeof(si);
@@ -2974,19 +2927,15 @@ static void test_scrollbar_visibility(void)
     WM_SIZE_recursionLevel = 0;
     bailedOutOfRecursion = FALSE;
     hwndRichEdit = new_window(cls.lpszClassName, ES_MULTILINE, NULL);
-    todo_wine {
     ok(!bailedOutOfRecursion,
         "WM_SIZE/scrollbar mutual recursion detected, expected none!\n");
-    }
 
     recursionLevel = 0;
     WM_SIZE_recursionLevel = 0;
     bailedOutOfRecursion = FALSE;
     MoveWindow(hwndRichEdit, 0, 0, 250, 100, TRUE);
-    todo_wine {
     ok(!bailedOutOfRecursion,
         "WM_SIZE/scrollbar mutual recursion detected, expected none!\n");
-    }
     
     /* Unblock window in order to process WM_DESTROY */
     recursionLevel = 0;
-- 
1.5.4.1


--------------030201090003020005060506--



More information about the wine-patches mailing list