Rob Shearman : comctl32: Fix use of arithmetic operator on Boolean type in TREEVIEW_ComputeItemInternalMetrics .

Alexandre Julliard julliard at winehq.org
Mon Aug 18 10:47:18 CDT 2008


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

Author: Rob Shearman <robertshearman at gmail.com>
Date:   Sun Aug 17 18:28:46 2008 +0100

comctl32: Fix use of arithmetic operator on Boolean type in TREEVIEW_ComputeItemInternalMetrics.

Use a conditional operator to get the same result, but improving
readability of the code.

---

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

diff --git a/dlls/comctl32/treeview.c b/dlls/comctl32/treeview.c
index 51e11bf..a77792d 100644
--- a/dlls/comctl32/treeview.c
+++ b/dlls/comctl32/treeview.c
@@ -859,7 +859,7 @@ TREEVIEW_ComputeItemInternalMetrics(const TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM
 		> TVS_LINESATROOT);
 #endif
 
-    item->linesOffset = infoPtr->uIndent * (item->iLevel + lar - 1)
+    item->linesOffset = infoPtr->uIndent * (lar ? item->iLevel : item->iLevel - 1)
 	- infoPtr->scrollX;
     item->stateOffset = item->linesOffset + infoPtr->uIndent;
     item->imageOffset = item->stateOffset




More information about the wine-cvs mailing list