[EMAIL PROTECTED] wrote: > Hi! > > Here's the final patch. It modifies the output routine for DocBook such > that bitmap files for math equations are exported to a directory > `filename + "_math"`.
Looking at your code I see two things: 1. It factors out some code in PreviewLoader.C into a separate pair of files, SnippetConversion.C. From the point of view of the outside world, the PreviewLoader API is unchanged so there will be no viral effects that propogate elsewhere. Either you've done the factoring correctly and the Previews continue to work, or you haven't. 2. You use the SnippetConversion API directly to generate snippets for use by the exported DocBook files. This requires one further function startAndWait in addition to the rest of the SnippetConversion API. I'm not going to comment further on the use of SnippetConversion by the DocBook export code. It looks reasonable to me. As for the factorization of code out of PreviewLoader.C and into SnippetConversion.[Ch]: I'm perfectly happy with it. You've done the factoring out because the docbook export wants to deal with the SnippetConversion stuff directly (ie, statr a conversion process and block until its finished) rather than with the whole, asynchronous PreviewLoader. Great. Makes lots of sense. Ok, I understand what you're doing. I'm totally happy with the general idea. Looking more closely at the code in SnippetConversion.[Ch] and PreviewLoader.C, I see that the factoring out is actually pretty mechanical. Not much room to introduce new bugs beyond the "Does it still work?" question. I think you should comment the SnippetConversion.h file further. /// Default constructor. No conversions are intitiated. SnippetConversion() : pid_(0) {} /// Initialise member variables. Do not initiate conversions. SnippetConversion(std::string const & filename_base, Converter const * converter, SnippetList const & pending); /** Start the conversion and return immediately. * The conversion process is run asynchronously. */ void start(Buffer const & buffer, ...); /** Start the conversion and block further execution until * the conversion process finiishes. */ int startAndWait(Buffer const & buffer, ...); Minor point: in SnippetConversion.C, this function: string const SnippetConversion::findSnippet(string const & snippet_) const { else { - return ""; + return string(); } } In the startAndWait function, shouldn't you initially set pid_ = 0 in case someone hs tried to use the same SnippetConversion variable twice? > Angus, I also have changes to lyxpreview2bitmap.py and > legacy_lyxpreview2png which allow the generation of PNG and EPS even if > dvipng is not present. I'll post that as a separate patch. Good. -- Angus