Abdelrazak Younes a écrit :
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.

Please test and comment. Test especially on other frontends to see if it
doesn't break anything. Tested only with qt4.

Just finished compiling with qt3 (always a penitence :-( ); I am happy to report that the navigate menu and the Toc Dialog work as expected. There is no reason why it should not be the same for xform and gtk so my plan is to:
1) replace item::uid() with item::id() that contains the paragraph id.
2) send the updated patch
3) commit :-)

In the mean time any testing would be welcome.

Abdel.


Reply via email to