From e4fd77faf7f1abf9ad1f48e647264d1c732f4805 Mon Sep 17 00:00:00 2001 From: Georg Baum Date: Sun, 25 Mar 2007 16:31:16 +0000 Subject: [PATCH] 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 --- src/buffer.C | 2 +- src/insets/insetinclude.C | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/buffer.C b/src/buffer.C index 80691626f9..c58b57bafb 100644 --- a/src/buffer.C +++ b/src/buffer.C @@ -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; diff --git a/src/insets/insetinclude.C b/src/insets/insetinclude.C index c2d08f788b..0cd514ed72 100644 --- a/src/insets/insetinclude.C +++ b/src/insets/insetinclude.C @@ -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