On 28/09/2008 23:22, Pavel Sanda wrote:
hi,
its constant frustration for me that it is not possible to keep outliner tree
view
in some persistent state. i very often need to uncollapse only few branches in
my view to see the structure and move between these places. the document is big
enough that full uncollapsing is not usable.
it drives me crazy to uncollapse all these branches again and again after each
update of the outliner, so i would like to have some persistent feature of
outliner.
i though about possible solutions:
1. to detect changes in structure of the document and update toc view only in
such
a case. most simple would be some caching mechanism of the last structure.
2. to remember the way tree was uncollapsed and after each rebuilt make
uncollapse
it in the same way if the structure around haven't changed to much. this
start
to suggest some diff-like algorithm and will be almost impossible to get
completely
right.
3. provide some 'freeze' checkbox with handling of the outliner trying to move
in already deleted/changed parts of document. update will on demand of
refresh
button.
i tend for 3. solution but would like to hear your opinions.
I prefer 2, kind off. This can be done completely in the frontend using
simple string comparison techniques and session management. Each time a
toc reset is requested, save in the session the strings of all the nodes
that are not collapsed. When the model is reset, restore uncollapse all
nodes that present the same string. This method will not be 100% correct
but it will be just fine for most cases because only the current code
tipically changes, all others nodes keep the same strings.
Abdel.