Fix preview of included files in child documents (bug #9583)

This commit is contained in:
Juergen Spitzmueller 2015-06-02 17:23:52 +02:00
parent e5323de7cf
commit 5d41a22ee4
3 changed files with 7 additions and 2 deletions

View File

@ -31,7 +31,7 @@ OutputParams::OutputParams(Encoding const * enc)
dryrun(false), silent(false), pass_thru(false),
html_disable_captions(false), html_in_par(false),
html_make_pars(true), for_toc(false), for_tooltip(false),
for_search(false), includeall(false)
for_search(false), for_preview(false), includeall(false)
{
// Note: in PreviewLoader::Impl::dumpPreamble
// OutputParams runparams(0);

View File

@ -275,6 +275,9 @@ public:
/// Are we generating this material for use by advanced search?
bool for_search;
/// Are we generating this material for instant preview?
bool for_preview;
/// Include all children notwithstanding the use of \includeonly
bool includeall;

View File

@ -555,7 +555,8 @@ void InsetInclude::latex(otexstream & os, OutputParams const & runparams) const
from_utf8(incfile), true);
}
FileName const writefile(makeAbsPath(mangled, masterBuffer->temppath()));
FileName const writefile(makeAbsPath(mangled, runparams.for_preview ?
buffer().temppath() : masterBuffer->temppath()));
LYXERR(Debug::LATEX, "incfile:" << incfile);
LYXERR(Debug::LATEX, "exportfile:" << exportfile);
@ -1091,6 +1092,7 @@ docstring latexString(InsetInclude const & inset)
// by latex() anyway.
OutputParams runparams(0);
runparams.flavor = OutputParams::LATEX;
runparams.for_preview = true;
inset.latex(os, runparams);
return ods.str();