Skip to content

Commit

Permalink
Merge pull request lxn#711 from xoviat/bugfix/issue_710
Browse files Browse the repository at this point in the history
remove treeview condition check
  • Loading branch information
lxn authored Sep 2, 2020
2 parents df2b776 + d05a48f commit 5e32bf2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ Shawn Sun <datago@yeah.net>
Simon Rozman <simon@rozman.si>
Tim Dufrane <tim.dufrane@gmail.com>
Vincent Vanackere <vincent.vanackere@gmail.com>
xoviat <xoviat@gmail.com>
8 changes: 1 addition & 7 deletions treeview.go
Original file line number Diff line number Diff line change
Expand Up @@ -572,13 +572,7 @@ func (tv *TreeView) WndProc(hwnd win.HWND, msg uint32, wParam, lParam uintptr) u
item := tv.handle2Item[nmtvdi.Item.HItem]

if nmtvdi.Item.Mask&win.TVIF_TEXT != 0 {
var text string
rc := win.RECT{Left: int32(nmtvdi.Item.HItem)}
if 0 != tv.SendMessage(win.TVM_GETITEMRECT, 0, uintptr(unsafe.Pointer(&rc))) {
// Only retrieve text if the item is visible. Why isn't Windows doing this for us?
text = item.Text()
}

text := item.Text()
utf16 := syscall.StringToUTF16(text)
buf := (*[264]uint16)(unsafe.Pointer(nmtvdi.Item.PszText))
max := mini(len(utf16), int(nmtvdi.Item.CchTextMax))
Expand Down

0 comments on commit 5e32bf2

Please sign in to comment.