Dylan Smith : richedit: Avoid unconditionally rewrapping text on scroll.

Alexandre Julliard julliard at winehq.org
Thu Sep 18 07:56:01 CDT 2008


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

Author: Dylan Smith <dylan.ah.smith at gmail.com>
Date:   Thu Sep 18 01:17:45 2008 -0400

richedit: Avoid unconditionally rewrapping text on scroll.

---

 dlls/riched20/paint.c |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/dlls/riched20/paint.c b/dlls/riched20/paint.c
index 2ea9689..fb50a89 100644
--- a/dlls/riched20/paint.c
+++ b/dlls/riched20/paint.c
@@ -1046,6 +1046,9 @@ void ME_Scroll(ME_TextEditor *editor, int value, int type)
 {
   SCROLLINFO si;
   int nOrigPos, nNewPos, nActualScroll;
+  HWND hWnd;
+  LONG winStyle;
+  BOOL bScrollBarIsVisible, bScrollBarWillBeVisible;
 
   nOrigPos = ME_GetYScrollPos(editor);
   
@@ -1083,7 +1086,15 @@ void ME_Scroll(ME_TextEditor *editor, int value, int type)
     ME_Repaint(editor);
   }
   
-  editor->vert_si.nMax = 0;
+  hWnd = editor->hWnd;
+  winStyle = GetWindowLongW(hWnd, GWL_STYLE);
+  bScrollBarIsVisible = (winStyle & WS_VSCROLL) != 0;
+  bScrollBarWillBeVisible = (editor->nHeight > editor->sizeWindow.cy)
+                            || (winStyle & ES_DISABLENOSCROLL);
+  if (bScrollBarIsVisible != bScrollBarWillBeVisible)
+  {
+    ShowScrollBar(hWnd, SB_VERT, bScrollBarWillBeVisible);
+  }
   ME_UpdateScrollBar(editor);
 }
 




More information about the wine-cvs mailing list