From: Juergen Spitzmueller Date: Wed, 21 May 2014 11:12:14 +0000 (+0200) Subject: Output arguments required by arguments with default or preset arg X-Git-Tag: 2.2.0alpha1~1915 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=58db7c34f9620de419c31d7454ef5f040292baf0;p=features.git Output arguments required by arguments with default or preset arg Fixes: #9128 --- diff --git a/src/output_latex.cpp b/src/output_latex.cpp index 9f65409b66..1cf63fbe0b 100644 --- a/src/output_latex.cpp +++ b/src/output_latex.cpp @@ -321,6 +321,18 @@ void getArgInsets(otexstream & os, OutputParams const & runparams, Layout::LaTeX if (argnr == 0) return; + // Default and preset args are always output, so if they require + // other arguments, consider this. + Layout::LaTeXArgMap::const_iterator lit = latexargs.begin(); + Layout::LaTeXArgMap::const_iterator const lend = latexargs.end(); + for (; lit != lend; ++lit) { + Layout::latexarg arg = (*lit).second; + if ((!arg.presetarg.empty() || !arg.defaultarg.empty()) && !arg.requires.empty()) { + vector req = getVectorFromString(arg.requires); + required.insert(required.end(), req.begin(), req.end()); + } + } + for (unsigned int i = 1; i <= argnr; ++i) { map::const_iterator lit = ilist.find(i); bool inserted = false;