From dfcd6fb7ea3f3c72918bfc06597b5e7e2d963df1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20St=C3=B6hr?= Date: Sun, 5 Oct 2008 19:12:12 +0000 Subject: [PATCH] make Latvian documents compilable, fixes http://bugzilla.lyx.org/show_bug.cgi?id=5324 git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26752 a592a061-630c-0410-9148-cb99ea01b6c8 --- lib/languages | 2 +- src/BufferParams.cpp | 17 ++++++++--------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/lib/languages b/lib/languages index 68bd1a7e3a..9fdf0d981e 100644 --- a/lib/languages +++ b/lib/languages @@ -59,7 +59,7 @@ kazakh kazakh "Kazakh" false pt154 kk_KZ "" korean "" "Korean" false euc-kr ko "" # there is no country code for Latin because it is a dead language latin latin "Latin" false iso8859-15 la "" -latvian latvian "Latvian" false iso8859-13 lv_LV "" +latvian latvian "Latvian" false iso8859-4 lv_LV "" lithuanian lithuanian "Lithuanian" false iso8859-13 lt_LT "" lowersorbian lowersorbian "Lower Sorbian" false iso8859-2 dsb_DE "" magyar magyar "Hungarian" false iso8859-2 hu_HU "" diff --git a/src/BufferParams.cpp b/src/BufferParams.cpp index c062f4e8e8..dfeed2c9fa 100644 --- a/src/BufferParams.cpp +++ b/src/BufferParams.cpp @@ -1034,16 +1034,15 @@ bool BufferParams::writeLaTeX(odocstream & os, LaTeXFeatures & features, // with language options, not in the class options, see // 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 + // if Latvian or 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 latvian = language_options.str().find("latvian"); 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 - && lithu == string::npos) + && latvian == string::npos && lithu == string::npos) clsoptions << language_options.str() << ','; } @@ -1877,14 +1876,14 @@ string BufferParams::babelCall(string const & lang_opts) const // language options, see // http://bugzilla.lyx.org/show_bug.cgi?id=4597#c4 size_t japan = lang_opts.find("japanese"); - // japan = string::npos when not found - // If Lithuanian is used, babel must directly be loaded with the - // language options, see + // If Latvian or Lithuanian is used, babel must directly be loaded with + // the language options, see // http://bugzilla.lyx.org/show_bug.cgi?id=5323 + size_t latvian = lang_opts.find("latvian"); 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) + || japan != string::npos || latvian != string::npos + || lithu != string::npos) return "\\usepackage[" + lang_opts + "]{babel}"; return lang_pack; }