Uwe Stöhr wrote:
Attached is the patch that fixes the problem, that babel isn't called when you are foreign languages in CJK and Armenian-documents.

I think this is now the last remaining babel bug.

Is my patch correct? It works here for all my testcases but you have perhaps a better solution.

---

I have a stupid C++ question:

How is the syntax in C++ for this logic:

if (
    (a == 1) && (b == 1) &&
    ((C == 1) || (C == -1))
   )

I mean how can the OR be included into an AND?

regards Uwe


------------------------------------------------------------------------

Index: BufferParams.cpp
===================================================================
--- BufferParams.cpp    (revision 18227)
+++ BufferParams.cpp    (working copy)
@@ -1394,8 +1394,15 @@
        // suppress the babel call when there is no babel language defined
        // in the lib/languages file
        if (lyxrc.language_global_options && tmp == "\\usepackage{babel}" &&
-               language->babel().empty() )
-               tmp = string("");
+               language->babel().empty() ) {
+               // if the armscii8 or a CJK encoding is used, babel has to be 
called for
+               // foreign languages
+               if (language->encoding()->latexName() == "armscii8" && lang_opts != 
"" ||
+                       language->encoding()->package() == Encoding::CJK && lang_opts != 
"" )

Reformatting the line above, you get:

if (language->encoding()->latexName() == "armscii8"
        && lang_opts != ""
        || language->encoding()->package() == Encoding::CJK
        && lang_opts != "" )

I don't really know what you are testing here but this code seems broken. Do you mean this:

if (!lang_opts.empty() &&
        (language->encoding()->latexName() == "armscii8"
        || language->encoding()->package() == Encoding::CJK))

I suggest that you read some C/C++ book someday Uwe ;-)

Abdel.

Reply via email to