rgheck wrote:
Bo Peng wrote:

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.

This makes the use of layout pointers seem kind of fragile. Maybe we should just store the name of the layout instead, and then use TextClass::operator[] to find the layout when we need it. There may be other benefits to doing it that way, too.


If there's no performance problem, that sounds good. But only if the changes are safe and not too intrusive.

Abdel.

Reply via email to