Fix crash with included files

* src/buffer.C
	(Buffer::makeLaTeXFile): Use runparams.encoding to be consistent

	* src/insets/insetinclude.C
	(InsetInclude::latex): Change runparams.encoding to the encoding of
	the child document for makeLateXFile


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17555 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Georg Baum 2007-03-25 16:31:16 +00:00
parent 2ccde85cb5
commit e4fd77faf7
2 changed files with 5 additions and 1 deletions

View File

@ -872,7 +872,7 @@ bool Buffer::makeLaTeXFile(FileName const & fname,
OutputParams const & runparams,
bool output_preamble, bool output_body)
{
string const encoding = params().encoding().iconvName();
string const encoding = runparams.encoding->iconvName();
lyxerr[Debug::LATEX] << "makeLaTeXFile encoding: "
<< encoding << "..." << endl;

View File

@ -426,9 +426,13 @@ int InsetInclude::latex(Buffer const & buffer, odocstream & os,
// argument. Should we set it to string(), or should makeLaTeXFile
// make use of it somehow? (JMarc 20031002)
#endif
// The included file might be written in a different encoding
Encoding const * const oldEnc = runparams.encoding;
runparams.encoding = &tmp->params().encoding();
tmp->makeLaTeXFile(writefile,
onlyPath(masterFilename(buffer)),
runparams, false);
runparams.encoding = oldEnc;
} else {
// Copy the file to the temp dir, so that .aux files etc.
// are not created in the original dir. Files included by