GetItemByRow() returned a valid row even for an item which was collapsed which is clearly inappropriate for its use in GetItemRect(), which is supposed return an invalid rectangle if the item is not visible. It also might be inappropriate in other cases, but this is not totally clear and it seems like it is supposed to return a valid row even for collapsed items at least sometimes, so just make its behaviour conditional by adding a new flags parameter to GetItemRect() and to Walker() helper used by it itself, so that it could skip over collapsed items. Update the test to show that it succeeds now even when the item is present in the tree, as it only passed before because the item had never been expanded at all, and so wasn't really present in the tree structure and the updated test would have failed without the changes to the code in this commit.
11 KiB
11 KiB