Re: [PATCH] Part of Bug 3719 -- TOC out of sync

2007-06-09 Thread Abdelrazak Younes
Richard Heck wrote: Bo Peng wrote: The way to solve this might be to put some appropriate code into InsetCaption::notifyCursorLeaves(). I do not think it is a good idea to update Toc during editing, because simple add/remove of sections, change of environment will break Toc, so it is close to

Re: [PATCH] Part of Bug 3719 -- TOC out of sync

2007-06-09 Thread Abdelrazak Younes
Bo Peng wrote: The way to solve this might be to put some appropriate code into InsetCaption::notifyCursorLeaves(). I do not think it is a good idea to update Toc during editing, because simple add/remove of sections, change of environment will break Toc, so it is close to impossible to

Re: [PATCH] Part of Bug 3719 -- TOC out of sync

2007-06-09 Thread Bo Peng
Please don't touch at that. When you change a section depth, the full renumbering is done (in updateLabels()). It is only natural to update also the TocBackend at the same time. Actually this update is much quicker than the section renumbering. We have not done anything, and if the operators

Re: [PATCH] Part of Bug 3719 -- TOC out of sync

2007-06-09 Thread Abdelrazak Younes
Bo Peng wrote: Please don't touch at that. When you change a section depth, the full renumbering is done (in updateLabels()). It is only natural to update also the TocBackend at the same time. Actually this update is much quicker than the section renumbering. We have not done anything, and if

Re: [PATCH] Part of Bug 3719 -- TOC out of sync

2007-06-09 Thread Bo Peng
We have not done anything, and if the operators are cheap as you described, it is perfectly fine to me to make TocUpdate automatic. Good, thanks. But then it is your job to get it done. :-) Seriously, as we have discussed, the problem lies in 'when to update Toc'. It is unwise to update Toc

Re: [PATCH] Part of Bug 3719 -- TOC out of sync

2007-06-09 Thread Abdelrazak Younes
Bo Peng wrote: We have not done anything, and if the operators are cheap as you described, it is perfectly fine to me to make TocUpdate automatic. Good, thanks. But then it is your job to get it done. :-) I am slowly coming back, don't ask me too much ;-) Seriously, as we have

Re: [PATCH] Part of Bug 3719 -- TOC out of sync

2007-06-09 Thread Abdelrazak Younes
Richard Heck wrote: Bo Peng wrote: The way to solve this might be to put some appropriate code into InsetCaption::notifyCursorLeaves(). I do not think it is a good idea to update Toc during editing, because simple add/remove of sections, change of environment will break Toc, so it is close to

Re: [PATCH] Part of Bug 3719 -- TOC out of sync

2007-06-09 Thread Abdelrazak Younes
Bo Peng wrote: The way to solve this might be to put some appropriate code into InsetCaption::notifyCursorLeaves(). I do not think it is a good idea to update Toc during editing, because simple add/remove of sections, change of environment will break Toc, so it is close to impossible to

Re: [PATCH] Part of Bug 3719 -- TOC out of sync

2007-06-09 Thread Bo Peng
Please don't touch at that. When you change a section depth, the full renumbering is done (in updateLabels()). It is only natural to update also the TocBackend at the same time. Actually this update is much quicker than the section renumbering. We have not done anything, and if the operators

Re: [PATCH] Part of Bug 3719 -- TOC out of sync

2007-06-09 Thread Abdelrazak Younes
Bo Peng wrote: Please don't touch at that. When you change a section depth, the full renumbering is done (in updateLabels()). It is only natural to update also the TocBackend at the same time. Actually this update is much quicker than the section renumbering. We have not done anything, and if

Re: [PATCH] Part of Bug 3719 -- TOC out of sync

2007-06-09 Thread Bo Peng
> We have not done anything, and if the operators are cheap as you > described, it is perfectly fine to me to make TocUpdate automatic. Good, thanks. But then it is your job to get it done. :-) Seriously, as we have discussed, the problem lies in 'when to update Toc'. It is unwise to update

Re: [PATCH] Part of Bug 3719 -- TOC out of sync

2007-06-09 Thread Abdelrazak Younes
Bo Peng wrote: > We have not done anything, and if the operators are cheap as you > described, it is perfectly fine to me to make TocUpdate automatic. Good, thanks. But then it is your job to get it done. :-) I am slowly coming back, don't ask me too much ;-) Seriously, as we have

Re: [PATCH] Part of Bug 3719 -- TOC out of sync

2007-06-07 Thread Richard Heck
Bo Peng wrote: The way to solve this might be to put some appropriate code into InsetCaption::notifyCursorLeaves(). I do not think it is a good idea to update Toc during editing, because simple add/remove of sections, change of environment will break Toc, so it is close to impossible to

Re: [PATCH] Part of Bug 3719 -- TOC out of sync

2007-06-07 Thread Bo Peng
There don't seem to be many of these. [EMAIL PROTECTED] src]$ srcgrep 'tocBackend().update()' buffer_funcs.cpp:704: cbuf.tocBackend().update(); frontends/controllers/ControlToc.cpp:120: kernel().buffer().getMasterBuffer()-tocBackend().update(); MenuBackend.cpp:708:

Re: [PATCH] Part of Bug 3719 -- TOC out of sync

2007-06-07 Thread Richard Heck
Bo Peng wrote: The way to solve this might be to put some appropriate code into InsetCaption::notifyCursorLeaves(). I do not think it is a good idea to update Toc during editing, because simple add/remove of sections, change of environment will break Toc, so it is close to impossible to

Re: [PATCH] Part of Bug 3719 -- TOC out of sync

2007-06-07 Thread Bo Peng
There don't seem to be many of these. [EMAIL PROTECTED] src]$ srcgrep 'tocBackend().update()' buffer_funcs.cpp:704: cbuf.tocBackend().update(); frontends/controllers/ControlToc.cpp:120: kernel().buffer().getMasterBuffer()->tocBackend().update(); MenuBackend.cpp:708:

Re: [PATCH] Part of Bug 3719 -- TOC out of sync

2007-06-06 Thread Jean-Marc Lasgouttes
Richard == Richard Heck [EMAIL PROTECTED] writes: Richard Jean-Marc Lasgouttes wrote: update toc and list of xxx seems to me an expensive operation. Can it be done on demand? I mean, maybe we can add a 'refresh'/'regenerate' button in the outline panel; and update 'list of listings' and such

Re: [PATCH] Part of Bug 3719 -- TOC out of sync

2007-06-06 Thread Richard Heck
Jean-Marc Lasgouttes wrote: The navigation menu is regenerated just before displaying it. At least this is what it used to do, without much overhead. Well, it doesn't do this now. Open the Embedded Objects manual; go to some figure, and delete some characters from the caption. (Do not

Re: [PATCH] Part of Bug 3719 -- TOC out of sync

2007-06-06 Thread Bo Peng
Well, it doesn't do this now. Open the Embedded Objects manual; go to some figure, and delete some characters from the caption. (Do not highlight and delete. That regenerates. Just delete.) Exit the caption (again, you have to be careful how you do this, as some actions regenerate) and open

Re: [PATCH] Part of Bug 3719 -- TOC out of sync

2007-06-06 Thread Richard Heck
Bo Peng wrote: Well, it doesn't do this now. Open the Embedded Objects manual; go to some figure, and delete some characters from the caption. (Do not highlight and delete. That regenerates. Just delete.) Exit the caption (again, you have to be careful how you do this, as some actions

Re: [PATCH] Part of Bug 3719 -- TOC out of sync

2007-06-06 Thread Bo Peng
Anything that fixed the TOC behavior would also fix this. But it would be possible to separate these and have the TOC update only by explicit request (say) whereas the menu updated when it was shown. When I insert 'update toc' message to 'TocBackend::update()', I find that it is called whenever

Re: [PATCH] Part of Bug 3719 -- TOC out of sync

2007-06-06 Thread Bo Peng
The way to solve this might be to put some appropriate code into InsetCaption::notifyCursorLeaves(). I do not think it is a good idea to update Toc during editing, because simple add/remove of sections, change of environment will break Toc, so it is close to impossible to consider all cases and

Re: [PATCH] Part of Bug 3719 -- TOC out of sync

2007-06-06 Thread Jean-Marc Lasgouttes
> "Richard" == Richard Heck <[EMAIL PROTECTED]> writes: Richard> Jean-Marc Lasgouttes wrote: update toc and list of xxx seems to me an expensive operation. Can it be done on demand? I mean, maybe we can add a 'refresh'/'regenerate' button in the outline panel; and update

Re: [PATCH] Part of Bug 3719 -- TOC out of sync

2007-06-06 Thread Richard Heck
Jean-Marc Lasgouttes wrote: The navigation menu is regenerated just before displaying it. At least this is what it used to do, without much overhead. Well, it doesn't do this now. Open the Embedded Objects manual; go to some figure, and delete some characters from the caption. (Do not

Re: [PATCH] Part of Bug 3719 -- TOC out of sync

2007-06-06 Thread Bo Peng
Well, it doesn't do this now. Open the Embedded Objects manual; go to some figure, and delete some characters from the caption. (Do not highlight and delete. That regenerates. Just delete.) Exit the caption (again, you have to be careful how you do this, as some actions regenerate) and open

Re: [PATCH] Part of Bug 3719 -- TOC out of sync

2007-06-06 Thread Richard Heck
Bo Peng wrote: Well, it doesn't do this now. Open the Embedded Objects manual; go to some figure, and delete some characters from the caption. (Do not highlight and delete. That regenerates. Just delete.) Exit the caption (again, you have to be careful how you do this, as some actions

Re: [PATCH] Part of Bug 3719 -- TOC out of sync

2007-06-06 Thread Bo Peng
Anything that fixed the TOC behavior would also fix this. But it would be possible to separate these and have the TOC update only by explicit request (say) whereas the menu updated when it was shown. When I insert 'update toc' message to 'TocBackend::update()', I find that it is called whenever

Re: [PATCH] Part of Bug 3719 -- TOC out of sync

2007-06-06 Thread Bo Peng
The way to solve this might be to put some appropriate code into InsetCaption::notifyCursorLeaves(). I do not think it is a good idea to update Toc during editing, because simple add/remove of sections, change of environment will break Toc, so it is close to impossible to consider all cases and

[PATCH] Part of Bug 3719 -- TOC out of sync

2007-06-05 Thread Richard Heck
Richard Heck wrote: Bo Peng wrote: Because you are on this topic, can you also check when navigation - list of listings and other entries are updated? When I add a listings insets with caption, I can see an empty entry but not the caption. This is a similar issue. The update is done by this

Re: [PATCH] Part of Bug 3719 -- TOC out of sync

2007-06-05 Thread Bo Peng
This is wrong. updateLabels() IS called from LFUN_CAPTION_INSERT. But it is NOT called after the caption itself is edited. So you get the same problem if you change an existing caption and then view the navigation menu or, for that matter, the TOC. The way to solve this might be to put some

Re: [PATCH] Part of Bug 3719 -- TOC out of sync

2007-06-05 Thread Richard Heck
Bo Peng wrote: This is wrong. updateLabels() IS called from LFUN_CAPTION_INSERT. But it is NOT called after the caption itself is edited. So you get the same problem if you change an existing caption and then view the navigation menu or, for that matter, the TOC. The way to solve this might be

Re: [PATCH] Part of Bug 3719 -- TOC out of sync

2007-06-05 Thread Jean-Marc Lasgouttes
Richard == Richard Heck [EMAIL PROTECTED] writes: Richard This is wrong. updateLabels() IS called from Richard LFUN_CAPTION_INSERT. But it is NOT called after the caption Richard itself is edited. So you get the same problem if you change Richard an existing caption and then view the navigation

Re: [PATCH] Part of Bug 3719 -- TOC out of sync

2007-06-05 Thread Jean-Marc Lasgouttes
update toc and list of xxx seems to me an expensive operation. Can it be done on demand? I mean, maybe we can add a 'refresh'/'regenerate' button in the outline panel; and update 'list of listings' and such only if this menu item is clicked. This is how it used to be in the good old time,

Re: [PATCH] Part of Bug 3719 -- TOC out of sync

2007-06-05 Thread Richard Heck
Jean-Marc Lasgouttes wrote: update toc and list of xxx seems to me an expensive operation. Can it be done on demand? I mean, maybe we can add a 'refresh'/'regenerate' button in the outline panel; and update 'list of listings' and such only if this menu item is clicked. This is how it

[PATCH] Part of Bug 3719 -- TOC out of sync

2007-06-05 Thread Richard Heck
Richard Heck wrote: Bo Peng wrote: Because you are on this topic, can you also check when navigation -> list of listings and other entries are updated? When I add a listings insets with caption, I can see an empty entry but not the caption. This is a similar issue. The update is done by this

Re: [PATCH] Part of Bug 3719 -- TOC out of sync

2007-06-05 Thread Bo Peng
This is wrong. updateLabels() IS called from LFUN_CAPTION_INSERT. But it is NOT called after the caption itself is edited. So you get the same problem if you change an existing caption and then view the navigation menu or, for that matter, the TOC. The way to solve this might be to put some

Re: [PATCH] Part of Bug 3719 -- TOC out of sync

2007-06-05 Thread Richard Heck
Bo Peng wrote: This is wrong. updateLabels() IS called from LFUN_CAPTION_INSERT. But it is NOT called after the caption itself is edited. So you get the same problem if you change an existing caption and then view the navigation menu or, for that matter, the TOC. The way to solve this might be

Re: [PATCH] Part of Bug 3719 -- TOC out of sync

2007-06-05 Thread Jean-Marc Lasgouttes
> "Richard" == Richard Heck <[EMAIL PROTECTED]> writes: Richard> This is wrong. updateLabels() IS called from Richard> LFUN_CAPTION_INSERT. But it is NOT called after the caption Richard> itself is edited. So you get the same problem if you change Richard> an existing caption and then view

Re: [PATCH] Part of Bug 3719 -- TOC out of sync

2007-06-05 Thread Jean-Marc Lasgouttes
>> update toc and list of xxx seems to me an expensive operation. Can >> it be done on demand? I mean, maybe we can add a >> 'refresh'/'regenerate' button in the outline panel; and update >> 'list of listings' and such only if this menu item is clicked. This is how it used to be in the good old

Re: [PATCH] Part of Bug 3719 -- TOC out of sync

2007-06-05 Thread Richard Heck
Jean-Marc Lasgouttes wrote: update toc and list of xxx seems to me an expensive operation. Can it be done on demand? I mean, maybe we can add a 'refresh'/'regenerate' button in the outline panel; and update 'list of listings' and such only if this menu item is clicked. This is how it