On Thu, 2007-01-18 at 21:09 +0200, Martin Vermeer wrote: > On Thu, Jan 18, 2007 at 06:59:10PM +0200, Martin Vermeer wrote: > > On Thu, Jan 18, 2007 at 05:02:20PM +0100, Jean-Marc Lasgouttes wrote: > > > >>>>> "Martin" == Martin Vermeer <[EMAIL PROTECTED]> writes: > > > > > > >> If you want to take in account branches (or more generally nested > > > >> textinset), you should do it completely, I can't believe it is so > > > >> difficult. > > > > > > Martin> I think branches are the main problem. We don't really need to > > > Martin> see footnotes and the like in the ToC. But when using > > > Martin> branches, e.g., for translating to two languages, all of the > > > Martin> section header text will be inside one or the other branch > > > Martin> inset. There is nothing left and the ToC entry will be just > > > Martin> the number. This is IMHO the only thing that needs fixing. > > > > > > I think it would be interesting to try to implement > > > insettext::addToTOC and make it add call the existing code > > > recursively. It is probably not that much work. > > > > Probably so. > > > > > Then you would have to specialize it for branch (exit early if > > > inactive) and maybe note (never output anything). > > > > I suspect you would have to shortcircuit it for every collapsable inset > > that is closed. > > > > > This is the way I have been wanting to go for numbering, but I never > > > found the time to actually do it. I think it is much better than an > > > ad-hoc solution. > > > > This is not an ad-hoc solution. It is the ONLY solution that will put in > > ToC entries > > for headers that are not inside a branch inset but CONTAIN one or more > > branch insets. > > It's the solution to a different problem. And essentially a useability bug > > fix... a ToC > > containing only numbers is unuseable for navigation or outlining. > > > > > And I am sure there are people who put section > > > headers in minipages... > > > > Sure. That's where _your_ proposed solution is called for. > > > > > JMarc > > > > - Martin > > Actually putting section headers in minipages already works... as long > as you don't close the minipage and try to go the header inside by means > of ToC or navigation menu. The crash error message is > > Assertion triggered in virtual void > lyx::InsetCollapsable::cursorPos(const lyx::BufferView&, const > lyx::CursorSlice&, bool, int&, int&) const by failing check "status() != > Collapsed" in file insetcollapsable.C:244 > > I put this in bugzilla this afternoon. > > The mechanism by which collapsible insets are recursively traversed by > ToC I don't know. It's not the inset.addToToC mechanism.
I suspect it is just the use of a pariterator (or whatever) to traverse all paragraphs in the document, also inside textinsets. addToToC is needed only for cases not covered by this, like (apparently) float, wrap and include. > Anyway, we have > to stop this crash by preventing the cursor to go into a closed inset. > How to do that? This bug is fixed in latest SVN. Great! My original patch is still needed and fixes a useability bug. As I wrote earlier,a ToC containing only numbers is unuseable for navigation or outlining. I verified that it does the job. (And Jean-Marc's objection that it only handles the first paragraph is invalid, because in the use case that the patch fixes, that is all there is. To spell it out: this is about a Default para inside a Branch inset inside an outer para of type, e.g., Section header.) Does anyone see a gotcha or want to test this still (generally a good idea), or can I commit this to 1.5? (a similar patch to toc.C in 1.4 would also be appropriate.) - Martin
signature.asc
Description: This is a digitally signed message part