From: Uwe Stöhr Date: Sun, 5 Oct 2008 13:42:37 +0000 (+0000) Subject: BufferParams.cpp: make Lithuanian documents compilable, fixes http://bugzilla.lyx... X-Git-Tag: 1.6.10~3168 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=8d11bc23be6ac36489021be4ff03af3f7b43651f;p=features.git BufferParams.cpp: make Lithuanian documents compilable, fixes http://bugzilla.lyx.org/show_bug.cgi?id=5323 git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26746 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/BufferParams.cpp b/src/BufferParams.cpp index 031c1c588f..c062f4e8e8 100644 --- a/src/BufferParams.cpp +++ b/src/BufferParams.cpp @@ -1035,9 +1035,15 @@ bool BufferParams::writeLaTeX(odocstream & os, LaTeXFeatures & features, // http://bugzilla.lyx.org/show_bug.cgi?id=4597#c4 size_t japan = language_options.str().find("japanese"); // japan = string::npos when not found + // if Lithuanian is used, babel must directly be loaded + // with language options, not in the class options, see + // http://bugzilla.lyx.org/show_bug.cgi?id=5323 + size_t lithu = language_options.str().find("lithuanian"); + // lithu = string::npos when not found if (lyxrc.language_global_options && !language_options.str().empty() - && viet == string::npos && japan == string::npos) + && viet == string::npos && japan == string::npos + && lithu == string::npos) clsoptions << language_options.str() << ','; } @@ -1872,7 +1878,13 @@ string BufferParams::babelCall(string const & lang_opts) const // http://bugzilla.lyx.org/show_bug.cgi?id=4597#c4 size_t japan = lang_opts.find("japanese"); // japan = string::npos when not found - if (!lyxrc.language_global_options || viet != string::npos || japan != string::npos) + // If Lithuanian is used, babel must directly be loaded with the + // language options, see + // http://bugzilla.lyx.org/show_bug.cgi?id=5323 + size_t lithu = lang_opts.find("lithuanian"); + // lithu = string::npos when not found + if (!lyxrc.language_global_options || viet != string::npos + || japan != string::npos || lithu != string::npos) return "\\usepackage[" + lang_opts + "]{babel}"; return lang_pack; }