odocstream & os, TexRow & texrow,
OutputParams const & runparams)
{
- lyxerr[Debug::LATEX] << "TeXDeeper... " << &*pit << endl;
+ LYXERR(Debug::LATEX) << "TeXDeeper... " << &*pit << endl;
ParagraphList::const_iterator par = pit;
while (par != paragraphs.end() &&
os, texrow, runparams);
}
}
- lyxerr[Debug::LATEX] << "TeXDeeper...done " << endl;
+ LYXERR(Debug::LATEX) << "TeXDeeper...done " << endl;
return par;
}
odocstream & os, TexRow & texrow,
OutputParams const & runparams)
{
- lyxerr[Debug::LATEX] << "TeXEnvironment... " << &*pit << endl;
+ LYXERR(Debug::LATEX) << "TeXEnvironment... " << &*pit << endl;
BufferParams const & bparams = buf.params();
LyXLayout_ptr const & style = pit->layout();
- Language const * language = pit->getParLanguage(bparams);
- Language const * doc_language = bparams.language;
- Language const * previous_language =
+ Language const * const par_language = pit->getParLanguage(bparams);
+ Language const * const doc_language = bparams.language;
+ Language const * const prev_par_language =
(pit != paragraphs.begin())
? boost::prior(pit)->getParLanguage(bparams)
: doc_language;
- if (language->babel() != previous_language->babel()) {
+ if (par_language->babel() != prev_par_language->babel()) {
if (!lyxrc.language_command_end.empty() &&
- previous_language->babel() != doc_language->babel()) {
+ prev_par_language->babel() != doc_language->babel()) {
os << from_ascii(subst(
lyxrc.language_command_end,
"$$lang",
- previous_language->babel()))
+ prev_par_language->babel()))
<< '\n';
texrow.newline();
}
if (lyxrc.language_command_end.empty() ||
- language->babel() != doc_language->babel()) {
+ par_language->babel() != doc_language->babel()) {
os << from_ascii(subst(
lyxrc.language_command_begin,
"$$lang",
- language->babel()))
+ par_language->babel()))
<< '\n';
texrow.newline();
}
OutputParams const & runparams_in,
string const & everypar)
{
- lyxerr[Debug::LATEX] << "TeXOnePar... " << &*pit << " '"
+ LYXERR(Debug::LATEX) << "TeXOnePar... " << &*pit << " '"
<< everypar << "'" << endl;
BufferParams const & bparams = buf.params();
LyXLayout_ptr style;
OutputParams runparams = runparams_in;
runparams.moving_arg |= style->needprotect;
- Language const * language = pit->getParLanguage(bparams);
- Language const * doc_language = bparams.language;
- Language const * previous_language =
+ Language const * const par_language = pit->getParLanguage(bparams);
+ Language const * const doc_language = bparams.language;
+ Language const * const prev_par_language =
(pit != paragraphs.begin())
? boost::prior(pit)->getParLanguage(bparams)
: doc_language;
- if (language->babel() != previous_language->babel()
+ if (par_language->babel() != prev_par_language->babel()
// check if we already put language command in TeXEnvironment()
&& !(style->isEnvironment()
&& (pit == paragraphs.begin() ||
|| boost::prior(pit)->getDepth() < pit->getDepth())))
{
if (!lyxrc.language_command_end.empty() &&
- previous_language->babel() != doc_language->babel())
+ prev_par_language->babel() != doc_language->babel())
{
os << from_ascii(subst(lyxrc.language_command_end,
"$$lang",
- previous_language->babel()))
+ prev_par_language->babel()))
<< '\n';
texrow.newline();
}
if (lyxrc.language_command_end.empty() ||
- language->babel() != doc_language->babel())
+ par_language->babel() != doc_language->babel())
{
os << from_ascii(subst(
lyxrc.language_command_begin,
"$$lang",
- language->babel()))
+ par_language->babel()))
<< '\n';
texrow.newline();
}
}
- LyXFont const outerfont =
- outerFont(std::distance(paragraphs.begin(), pit),
- paragraphs);
- // This must be identical to basefont in Paragraph::simpleTeXOnePar
- LyXFont basefont = (pit->beginOfBody() > 0) ?
- pit->getLabelFont(bparams, outerfont) :
- pit->getLayoutFont(bparams, outerfont);
- Encoding const & outer_encoding(*(outerfont.language()->encoding()));
- // FIXME we switch from the outer encoding to the encoding of
- // this paragraph, since I could not figure out the correct
- // logic to take the encoding of the previous paragraph into
- // account. This may result in some unneeded encoding changes.
- if (switchEncoding(os, bparams, outer_encoding,
- *(basefont.language()->encoding()))) {
- os << '\n';
- texrow.newline();
- }
-
// In an inset with unlimited length (all in one row),
// don't allow any special options in the paragraph
if (!pit->forceDefaultParagraphs()) {
break;
}
+ LyXFont const outerfont =
+ outerFont(std::distance(paragraphs.begin(), pit),
+ paragraphs);
+
// FIXME UNICODE
os << from_utf8(everypar);
bool need_par = pit->simpleTeXOnePar(buf, bparams, outerfont,
+ // *encoding,
os, texrow, runparams);
// Make sure that \\par is done with the font of the last
}
if (boost::next(pit) == paragraphs.end()
- && language->babel() != doc_language->babel()) {
+ && par_language->babel() != doc_language->babel()) {
// Since \selectlanguage write the language to the aux file,
// we need to reset the language at the end of footnote or
// float.
os << from_ascii(subst(
lyxrc.language_command_end,
"$$lang",
- language->babel()));
+ par_language->babel()));
pending_newline = true;
}
- // FIXME we switch from the encoding of this paragraph to the
- // outer encoding, since I could not figure out the correct logic
- // to take the encoding of the next paragraph into account.
- // This may result in some unneeded encoding changes.
- basefont = pit->getLayoutFont(bparams, outerfont);
- switchEncoding(os, bparams, *(basefont.language()->encoding()),
- outer_encoding);
if (pending_newline) {
os << '\n';
texrow.newline();
}
+ runparams_in.encoding = runparams.encoding;
// we don't need it for the last paragraph!!!
// Note from JMarc: we will re-add a \n explicitely in
// only, but it is the best we can do.
if ((bparams.inputenc == "auto" || bparams.inputenc == "default") &&
oldEnc.name() != newEnc.name() &&
+ oldEnc.name() != "ascii" && newEnc.name() != "ascii" &&
oldEnc.name() != "tis620-0" && newEnc.name() != "tis620-0") {
- lyxerr[Debug::LATEX] << "Changing LaTeX encoding from "
+ LYXERR(Debug::LATEX) << "Changing LaTeX encoding from "
<< oldEnc.name() << " to "
<< newEnc.name() << endl;
os << setEncoding(newEnc.iconvName());