comctl32/listview: Move item position calculation out of subitem loop

Nikolay Sivov bunglehead at gmail.com
Tue May 26 17:09:41 CDT 2009


There's no need to recompute item position over and over again
for each column.

Changelog:
    - Move item position calculation out of subitem loop

>From 4442f2a57073c660800af58008a6c5138a891782 Mon Sep 17 00:00:00 2001
From: Nikolay Sivov <bunglehead at gmail.com>
Date: Wed, 27 May 2009 01:57:22 +0400
Subject: Move item position calculation out of subitem loop

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

diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c
index 0c53bc3..140f60d 100644
--- a/dlls/comctl32/listview.c
+++ b/dlls/comctl32/listview.c
@@ -4127,13 +4127,13 @@ static void LISTVIEW_RefreshReport(LISTVIEW_INFO *infoPtr, ITERATOR *i, HDC hdc,
     /* iterate through the invalidated rows */
     while(iterator_next(i))
     {
+	LISTVIEW_GetItemOrigin(infoPtr, i->nItem, &Position);
+	Position.x += Origin.x;
+	Position.y += Origin.y;
+
 	/* iterate through the invalidated columns */
 	while(iterator_next(&j))
 	{
-	    LISTVIEW_GetItemOrigin(infoPtr, i->nItem, &Position);
-	    Position.x += Origin.x;
-	    Position.y += Origin.y;
-
 	    if (rgntype == COMPLEXREGION && !((infoPtr->dwLvExStyle & LVS_EX_FULLROWSELECT) && j.nItem == 0))
 	    {
 		LISTVIEW_GetHeaderRect(infoPtr, j.nItem, &rcItem);
-- 
1.5.6.5





More information about the wine-patches mailing list