bool isEncoding(BufferParams const & bparams, LyXFont const & font,
string const & encoding)
{
+ // We do ignore bparams.inputenc == "default" here because characters
+ // in this encoding could be treated by TeX as something different,
+ // e.g. if they are inside a CJK environment. See also
+ // http://bugzilla.lyx.org/show_bug.cgi?id=3043.
return (bparams.inputenc == encoding
|| (bparams.inputenc == "auto"
&& font.language()->encoding()->latexName() == encoding));
}
-Change const Paragraph::Pimpl::lookupChange(pos_type pos) const
+Change const & Paragraph::Pimpl::lookupChange(pos_type pos) const
{
BOOST_ASSERT(pos >= 0 && pos <= size());
if (style.pass_thru)
return;
- if (column > lyxrc.ascii_linelen
+ if (column > lyxrc.plaintext_linelen
&& i
&& getChar(i - 1) != ' '
&& (i < size() - 1)
os << '\n';
} else {
if (open_font) {
- column += running_font.latexWriteEndChanges(os, basefont, basefont);
+ column += running_font.latexWriteEndChanges(
+ os, basefont, basefont, bparams);
open_font = false;
}
basefont = owner_->getLayoutFont(bparams, outerfont);
#endif
// some insets cannot be inside a font change command
if (open_font && inset->noFontChange()) {
- column +=running_font.
- latexWriteEndChanges(os,
- basefont,
- basefont);
+ column += running_font.latexWriteEndChanges(
+ os, basefont, basefont, bparams);
open_font = false;
basefont = owner_->getLayoutFont(bparams, outerfont);
running_font = basefont;
case 0x20ac: // EURO SIGN
if (isEncoding(bparams, font, "latin9")
|| isEncoding(bparams, font, "cp1251")
- || isEncoding(bparams, font, "utf8")) {
+ || isEncoding(bparams, font, "utf8")
+ || isEncoding(bparams, font, "latin10")
+ || isEncoding(bparams, font, "cp858")) {
os.put(c);
} else {
os << "\\texteuro{}";