<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 10/19/2014 20:01, Dan Bassi wrote:<br>
</div>
<blockquote
cite="mid:CAHqLpArc+eLEr7hnG34Oe1=eQ8WdBzgVE4H4NdkQyzw8Mv7pfw@mail.gmail.com"
type="cite">
<div dir="ltr">Hi Nikolay. In uTorrent, the Treeview box on the
left doesn't update under Wine unless the box is clicked
(whereas under Windows, it updates automatically without
clicking).
<div><br>
</div>
<div>I later traced the error to the "item_changed()" function
in comctl32/treeview.c, which was (incorrectly) detecting the
text as never having changed. This patch seems to fix that
behaviour.</div>
<div><br>
</div>
<div>Please let me know your thoughts. Many thanks.</div>
</div>
</blockquote>
What I mean is that we need more tests in comctl32/tests/treeview.c
to prove that patch is correct. The fact that it fixes some case
with some application is not enough.<br>
<blockquote
cite="mid:CAHqLpArc+eLEr7hnG34Oe1=eQ8WdBzgVE4H4NdkQyzw8Mv7pfw@mail.gmail.com"
type="cite">
<div class="gmail_extra"><br>
<div class="gmail_quote">On Sun, Oct 19, 2014 at 4:49 PM,
Nikolay Sivov <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:bunglehead@gmail.com" target="_blank">bunglehead@gmail.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">On
10/19/2014 18:44, Dan Bassi wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
+ /* Old text is a null pointer due to HeapAlloc()
failing, therefore unable to perform strcmpW so assume
text has changed */<br>
+ if (!tiOld->pszText)<br>
+ return TRUE;<br>
+<br>
</blockquote>
I don't think you should necessary assume it's changed.<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
/* Text has changed and it's not a callback */<br>
- if ((tvChange->mask & TVIF_TEXT) &&
(tiOld->pszText != tiNew->pszText) &&<br>
+ if ((tvChange->mask & TVIF_TEXT) &&
(strcmpW(tiOld->pszText, tiNew->pszText) != 0)
&&<br>
tiNew->pszText != LPSTR_TEXTCALLBACKW)<br>
return TRUE;<br>
</blockquote>
This is wrong, you can't compare if it's a special callback
value.<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
+ originalItem.pszText = HeapAlloc(GetProcessHeap(), 0,
originalItem.cchTextMax * sizeof(WCHAR));<br>
</blockquote>
Normally comctl32 code uses Alloc()/Free() functions.<br>
<br>
This patch needs tests first, those tests should cover all
possible combinations regarding callback cases, different
pointers but same data,<br>
same data but different pointers, maybe something else.<br>
<br>
<br>
</blockquote>
</div>
<br>
</div>
</blockquote>
<br>
</body>
</html>