Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using isFiltered in InitNode leads to integer overflows or bogus rendering when reiniting #603

Closed
obones opened this issue Jan 8, 2016 · 1 comment

Comments

@obones
Copy link
Contributor

obones commented Jan 8, 2016

Hello,

Issue #557 dealt with a totally similar situation where using isFiltered in InitNode lead to bogus rendering. While this has been solved, the issue still exists when reiniting a tree and some nodes are no longer filtered.
The following sample shows the issue:

http://obones.free.fr/vtv/multiple_isFiltered.zip

Initially all nodes are filtered out.
Pressing the first button makes them all unfiltered during the ReinitNode call
Pressing the second button filters out some of them.

Once you have pressed that second button, you will notice that the scrollbar on the right is absent when clearly there is a need for it.
In extreme cases, this leads to FRoot.TotalHeight being negative (well, if cast to an integer) which gives range checks errors inside SetNodeCount if activated.

This is because AdjustTotalHeight is called inside TBaseVirtualTree.SetFiltered with an absolute value of 0 if the node is being initialized. This, however, means that we remove the node children's height twice when the node has already been initialized once.

A pull request will be made shortly to address the issue.

obones added a commit to obones/Virtual-TreeView that referenced this issue Jan 8, 2016
… must not remove its total height, but rather its height. (Issue JAM-Software#603)
@joachimmarder
Copy link
Contributor

Thanks for the pull request!

ValtsS pushed a commit to ValtsS/Virtual-TreeView that referenced this issue Jan 25, 2019
… must not remove its total height, but rather its height. (Issue JAM-Software#603)

# Conflicts:
#	Source/VirtualTrees.pas
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants