Owen Rudge : comctl32: Ensure coordinates are valid during listview marquee selection.

Alexandre Julliard julliard at winehq.org
Tue Oct 6 10:35:47 CDT 2009


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

Author: Owen Rudge <orudge at codeweavers.com>
Date:   Mon Oct  5 18:07:45 2009 +0100

comctl32: Ensure coordinates are valid during listview marquee selection.

---

 dlls/comctl32/listview.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c
index e1e51e7..2f30e9a 100644
--- a/dlls/comctl32/listview.c
+++ b/dlls/comctl32/listview.c
@@ -3607,6 +3607,19 @@ static LRESULT LISTVIEW_MouseMove(LISTVIEW_INFO *infoPtr, WORD fwKeys, INT x, IN
         WORD wDragWidth = GetSystemMetrics(SM_CXDRAG);
         WORD wDragHeight= GetSystemMetrics(SM_CYDRAG);
 
+        /* Ensure coordinates are within client bounds */
+        if (x < 0)
+            x = 0;
+
+        if (y < 0)
+            y = 0;
+
+        if (x > infoPtr->rcList.right)
+            x = infoPtr->rcList.right;
+
+        if (y > infoPtr->rcList.bottom)
+            y = infoPtr->rcList.bottom;
+
         tmp.x = x;
         tmp.y = y;
 




More information about the wine-cvs mailing list