Dov Feldstern wrote: > Index: lyx-devel/src/output_latex.cpp > =================================================================== > --- lyx-devel.orig/src/output_latex.cpp 2007-06-29 16:02:45.000000000 +0300 > +++ lyx-devel/src/output_latex.cpp 2007-07-01 20:52:31.000000000 > > @@ -315,7 +319,7 @@ > pit->getFontSettings(bparams, i).language()->encoding(); > if (encoding->package() == Encoding::inputenc && > switchEncoding(os, bparams, false, > - *(runparams.encoding), *encoding) > 0) { > + *(runparams.encoding), *encoding).first) { > runparams.encoding = encoding; > os << '\n'; > texrow.newline(); > @@ -598,17 +602,17 @@ > }
This is wrong. The old condition is correct for os << '\n'; texrow.newline(); , and the new one is correct for runparams.encoding = encoding; . > @@ -617,19 +621,20 @@ > // but it is the best we can do > if (oldEnc.package() == Encoding::none > || newEnc.package() == Encoding::none) > - return 0; > + return make_pair(false, 0); > > LYXERR(Debug::LATEX) << "Changing LaTeX encoding from " > << oldEnc.name() << " to " > << newEnc.name() << endl; > os << setEncoding(newEnc.iconvName()); > if (bparams.inputenc == "default") > - return 0; > + return make_pair(true, 0); > > docstring const inputenc(from_ascii(newEnc.latexName())); > switch (newEnc.package()) { > case Encoding::none: > - return 0; > + // shouldn't ever reach here, see above > + return make_pair(false, 0); make_pair(true, 0) is slightly better (because the encoding has been changed already). > // Dead code to avoid a warning: > - return 0; > + return make_pair(false, 0); Ditto. > Index: lyx-devel/src/output_latex.h > =================================================================== > --- lyx-devel.orig/src/output_latex.h 2007-07-01 20:28:13.000000000 +0300 > +++ lyx-devel/src/output_latex.h 2007-07-01 20:30:52.000000000 +0300 > @@ -17,6 +17,8 @@ > > namespace lyx { > > +using std::pair; 'using' is forbiden in header files. I did not test anything, but the rest looks good. Georg