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 dbadd00733
commit ebbe6c1924
4 changed files with 9 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

@ -270,6 +270,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

@ -556,7 +556,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);
@ -1092,6 +1093,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();

View File

@ -141,6 +141,8 @@ What's new
- Fix instant preview when a preview snippet produces errors (bug 9510).
- Fix instant preview of included documents in child documents (bug 9583).
* LYX2LYX