comctl32: [Bug 17251] cchTextMax needs to be set for LVS_OWNERDATA as it uses LVN_GETDISPINFO notifications
Jeff Latimer
lats at yless4u.com.au
Mon Mar 15 07:08:56 CDT 2010
On 13/03/10 20:30, Nikolay Sivov wrote:
> On 3/13/2010 06:35, Jeff Latimer wrote:
>>
>> If not set then no value is returned and in the case of uTorrent the
>> next entry selected is renamed.
>> http://bugs.winehq.org/show_bug.cgi?id=17251
> No value returned from what?
LISTVIEW_GetItemW
>> dispInfo.item.iItem = editedItem;
>> dispInfo.item.iSubItem = 0;
>> dispInfo.item.stateMask = ~0;
>> + dispInfo.item.cchTextMax = textlenT(pszText, isW)+2;
>> if (!LISTVIEW_GetItemW(infoPtr,&dispInfo.item))
> Could you explain what this change fixes exactly? As I remember
> uTorrent uses an LVS_OWNERDATA listview, so this cchTextMax isn't
> processed in LISTVIEW_GetItemW.
I have added some traces and a code fragment to
http://bugs.winehq.org/show_bug.cgi?id=17251 showing the before and
after inserting dispInfo.item.cchTextMax = textlenT(pszText, isW)+2;
into LISTVIEW_EndEditLabelT
>
> Also I'm not sure what you mean here
> ---
> textlenT(pszText, isW)+2
> ---
> pszText is Edit control text at this point (or NULL). How it's related
> to LISTVIEW_GetItemW? And what this +2 adding mean?
Yes pszText is Edit control text or NULL. textLenT returns the length
of the without the trailing Null. What's required here is a buffer at
least 1 character longer than pszText+Null so that when
LISTVIEW_GetItemW returns dispInfo.item.pszText we can determine whether
it is longer than pszText. We need +2 at least for this.
More information about the wine-devel
mailing list