Lars Gullik Bjønnes a écrit :
Abdelrazak Younes <[EMAIL PROTECTED]> writes:
| I found myself using more and more the two ways toc navigation but,
| eventually I got annoyed by the slowness of it. So I fixed it :-)
|
| This patch implements a Toc backend (TocBackend.[Ch]) that is used in
| toc.h. The speed improvement is _very_ very nice on windows.
| I guess it should be sensible under mac and linux also. Try to open the
| navigate menu on a user guide or any big highly hierarchical
| document). Maybe this was the cause of the slowness on Mac because of
| the special menu handling.
|
| This patch impact minimally current code (except for toc.[Ch] and
| ControlToc.[Ch] of course). The toc cache is implemented as a static
| variable (static map<Buffer const *, lyx::TocBackend> toc_backend_; in
| toc.C), this is not very nice but this seems to be the
| only way with current code structure. Eventually, this toc_backend_
| should become a member of the kernel.
| I use the paragraph text as an universal ID for the Toc item. This
| could/should eventually change once we have something stable.
This id need only be unique for the current lyx session right?
then paragrpah::id() should be good enough.
The problem is that this id is not constant across moves or depth
changes (as done by the outline function). Wait... I am not sure anymore
I need them to be constant now that updateToc is called inside
updateLabels... I'll try that.
Does the change to return references actually change anyting
visible (performance wise)?
Performance wise the most important change is of course the construction
of the toc only when there's a document change. Formerly, the
construction was done every time you click the navigate menu or you use
the Toc dialog. I think the use of reference should also help here but
not much compared to the first point.
Abdel.