>> 4. Another layout can be chosen from Document -> settings, if a >> correct textclass is selected, all layouts will work fine. (improved, >> because the current approach will change some unknown layouts to >> standard.) >> > > I think this is not enough. If the local layout is to be supported, there > should be a way to select this option in the document settings. If you > select this option, LyX should be able to reformat the document dynamically > if a proper local layout is found, or switch to the unknown layout if not > found.
This is already the case. If we restore the browse button, users can browse a local layout and apply it. The biggest improvement is that, before this patch, layouts that are unknown to article.layout will be changed to standard, and will NOT be restored when a correct layout is selected. With this patch, the unknown layouts are kept although they look like standard. >> The biggest problem with this patch is that because layout pointers >> are used directly, LayoutList, which is std:;vector<Layout> can not be >> expanded dynamically. I change it to std::list<Layout> to allow >> dynamic growth of the "unknown" textclass but this may lead to >> performance problems. >> > > This is wrong IMHO, the vector should stay and you should just construct > this "unknown layout" together with all the others. I do not know how to do this. Layouts of other textclasses are loaded before layout pointers are assigned to paragraphs. This unknown textclass will grow when an unknown layout is encountered, which invalidates pointers of previously identified layouts if vector<Layout> is used. > You have mine. I guess this patch will bring back the debate around the > usefulness of the local layout stuff, I am no expert on this stuff so I > won't comment any further. But please no heated debate; as the 1.6 > maintainer, the last decision is on Jûrgen's shoulder and, if he makes one, > it should be respected without any further discussion. As far as I am concerned, this bug has little, if any, to do with local layouts, and removing the local layout feature does not fix this problem at all. Bo