Jean-Marc Lasgouttes wrote: >>>>>> "Georg" == Georg Baum <[EMAIL PROTECTED]> writes: > > Georg> Not much. The stuff related to #605 is > > Georg> s/buffer\.temppath()/buffer.getMasterBuffer()->temppath()/g > > Georg> in ExternalSupport.C. > > But how do you deal with normal export? If file foo1.lyx includes > dir/foo2.lyx and foo2.lyx has an external inset bar.dat, the name > should be exported in latex as dir/bar.dat, shouldn't it?
This was indeed a missing case in my test file. I thought it should have been bar.dat. > From my cursory looking at the sources, we cannot do that directly in > doSubstitution, since there are cases where we want $$FName as plain > bar.dat. > > It seems to me that it is necessary to add a bool to doSubstitution > telling wether relative file names should relative to buffer or master > buffer. The patch is probably wrong here for the graphics inset too. I'll have a look. > Georg> What I forgot to say: I did not include the "Let's pretend we > Georg> are the master buffer" stuff because I did not understand why > Georg> it was necessary. > > What is that? I shoud really look things up before I write ;-( I meant this: @@ -2127,9 +2127,23 @@ void Buffer::makeLaTeXFile(ostream & os, << endl; texrow.newline(); } + + // if we are doing a real file with body, even if this is the + // child of some other buffer, let's cut the link here. + string save_parentname; + if (!only_body) { + save_parentname = params.parentname; + params.parentname.erase(); + } + // the real stuff latexParagraphs(os, &*(paragraphs.begin()), 0, texrow); + // Restore the parenthood if needed + if (!only_body) { + params.parentname = save_parentname; + } + // add this just in case after all the paragraphs os << endl; texrow.newline(); > Georg> - The ExportData struct is rather a hack because it circumvents > Georg> the const'ness of runparams. How to do this properly? >>> Can you collect the file names at validate() time? I'd think that >>> this pass is the right one for what you try to do. > > Georg> This would probably involve a call to prepareFile(), but should > Georg> work. > > And would you have to call prepareFile again when generating latex? Either that or store the result. Georg