Commit e2d5373
refix methods 'GetLastVisibleNoInit' (and 'GetLastVisible') to return correct results even if some ancestor of the last visible node is effectively not visible itself
Changes from commit 8df8d6 for issue #725 performance reintroduced a regression, that prevents method 'TBaseVirtualTree.GetLastVisibleNoInit' from returning a visible node if some of its ancestors are hidden. That is because methods 'TBaseVirtualTree.GetLastVisibleChildNoInit' and 'GetPreviousVisibleSiblingNoInit' both only consider direct children of given 'Node' but ignore other descendant nodes' visibility.
- completely revised method 'TBaseVirtualTree.GetLastVisibleNoInit'
- kept the top-down-traversal algorithm of commit 8df8d6 in particular for optimal performance
- iteratively checked expansion state (but not visibility) of every ancestor of given 'Node' in the first place to prevent a false-positive result in an effectively collapsed subtree
- added conditional recursion for expanded nodes having some visible children (i.e. using fast 'vsAllChildrenHidden' state) as a local function 'IterateChildren'
- apply 'ChildrenAbove' option on the conditions' precedence:
- for top-down trees prefer visible children over their visible parent
- for bottom-up trees prefer a visible node over its visible children
- therefore extracted main condition as a local function 'GetNodeIsVisible' and recursion condition as a local function 'GetNodeHasVisibleChildren'
! thus a visible subnode under some effectively invisible but expanded ancestor will be found again1 parent 63e73ef commit e2d5373
1 file changed
+63
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28067 | 28067 | | |
28068 | 28068 | | |
28069 | 28069 | | |
| 28070 | + | |
28070 | 28071 | | |
28071 | | - | |
28072 | | - | |
28073 | 28072 | | |
28074 | | - | |
28075 | | - | |
28076 | | - | |
28077 | | - | |
| 28073 | + | |
| 28074 | + | |
| 28075 | + | |
| 28076 | + | |
| 28077 | + | |
| 28078 | + | |
| 28079 | + | |
| 28080 | + | |
| 28081 | + | |
| 28082 | + | |
| 28083 | + | |
| 28084 | + | |
| 28085 | + | |
| 28086 | + | |
| 28087 | + | |
| 28088 | + | |
| 28089 | + | |
| 28090 | + | |
| 28091 | + | |
| 28092 | + | |
| 28093 | + | |
| 28094 | + | |
| 28095 | + | |
28078 | 28096 | | |
28079 | | - | |
28080 | | - | |
28081 | | - | |
28082 | | - | |
28083 | | - | |
28084 | | - | |
28085 | | - | |
28086 | | - | |
28087 | | - | |
| 28097 | + | |
| 28098 | + | |
| 28099 | + | |
| 28100 | + | |
| 28101 | + | |
| 28102 | + | |
| 28103 | + | |
| 28104 | + | |
| 28105 | + | |
| 28106 | + | |
| 28107 | + | |
| 28108 | + | |
| 28109 | + | |
| 28110 | + | |
| 28111 | + | |
| 28112 | + | |
| 28113 | + | |
| 28114 | + | |
28088 | 28115 | | |
| 28116 | + | |
| 28117 | + | |
| 28118 | + | |
| 28119 | + | |
| 28120 | + | |
| 28121 | + | |
| 28122 | + | |
| 28123 | + | |
| 28124 | + | |
| 28125 | + | |
| 28126 | + | |
| 28127 | + | |
| 28128 | + | |
| 28129 | + | |
| 28130 | + | |
| 28131 | + | |
| 28132 | + | |
| 28133 | + | |
| 28134 | + | |
| 28135 | + | |
| 28136 | + | |
28089 | 28137 | | |
28090 | 28138 | | |
28091 | 28139 | | |
| |||
0 commit comments