>>>>> "Uwe" == Uwe Stöhr <[EMAIL PROTECTED]> writes:
Uwe> Jean-Marc Lasgouttes schrieb:
>>> I hope it is OK now.
>> See my answer to your first commit.
Uwe> Then I simply don't understand what you want. The current
Uwe> solution is the cleanest possible and it works. You must check at
Uwe> least once if the babel language is empty to clear "lang_pack",
Uwe> otherwise babel would be called in any case when the global
Uwe> option is set.
Let me say it again: you have the following test:
if (language->babel().empty() && lang_opts.empty())
What is in lang_opts? There is the language of the document
(language->babel()), plus some other things (languages used in other
places of the text). Now assume that lang_opts is empty. It is not
difficult to deduce that language->babel() is also empty!
(another) patch attached. I can commit it if you agree with the logic.
JMarc
Index: src/BufferParams.cpp
===================================================================
--- src/BufferParams.cpp (révision 18253)
+++ src/BufferParams.cpp (copie de travail)
@@ -1408,16 +1408,17 @@ string const BufferParams::dvips_options
string const BufferParams::babelCall(string const & lang_opts) const
{
- string lang_pack = lyxrc.language_package;
+ string const & lang_pack = lyxrc.language_package;
if (lang_pack == "\\usepackage{babel}") {
- // suppress the babel call when there is no babel language defined
- // for the document language in the lib/languages file and if no
- // other languages are used
- if (language->babel().empty() && lang_opts.empty())
- lang_pack.clear();
- if (!lyxrc.language_global_options && !lang_opts.empty())
- lang_pack = string("\\usepackage[") + lang_opts + "]{babel}";
- if (lyxrc.language_global_options)
+ // suppress the babel call when there is no babel
+ // language defined for the document language in the
+ // lib/languages file and if no other languages are
+ // used
+ if (lang_opts.empty())
+ return string();
+ if (!lyxrc.language_global_options)
+ return "\\usepackage[" + lang_opts + "]{babel}";
+ else
return lang_pack;
}
return lang_pack;