From 2eb4a46d0b63361532a8b6bd3a3d62f4f00365a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20St=C3=B6hr?= Date: Sat, 30 Jun 2012 03:40:40 +0200 Subject: [PATCH] tex2lyx: backport fix for bug #8210 --- src/tex2lyx/Preamble.h | 2 ++ src/tex2lyx/tex2lyx.cpp | 4 ++++ status.20x | 1 + 3 files changed, 7 insertions(+) diff --git a/src/tex2lyx/Preamble.h b/src/tex2lyx/Preamble.h index 9b15a3fea0..8372fcb33c 100644 --- a/src/tex2lyx/Preamble.h +++ b/src/tex2lyx/Preamble.h @@ -39,6 +39,8 @@ public: /// std::string notefontcolor() const { return h_notefontcolor; } /// + std::string language() const { return h_language; } + /// std::string use_indices() const { return h_use_indices; } /// bool indentParagraphs() const; diff --git a/src/tex2lyx/tex2lyx.cpp b/src/tex2lyx/tex2lyx.cpp index 5b91e1842d..3acc0e7a22 100644 --- a/src/tex2lyx/tex2lyx.cpp +++ b/src/tex2lyx/tex2lyx.cpp @@ -681,6 +681,10 @@ bool tex2lyx(idocstream & is, ostream & os, string encoding) active_environments.push_back("document"); Context context(true, textclass); stringstream ss; + // store the document language in the context to be able to handle the + // commands like \foreignlanguage and \textenglish etc. + context.font.language = preamble.language(); + // parse the main text parse_text(p, ss, FLAG_END, true, context); if (Context::empty) // Empty document body. LyX needs at least one paragraph. diff --git a/status.20x b/status.20x index 4ce7367d02..0742baa56f 100644 --- a/status.20x +++ b/status.20x @@ -84,6 +84,7 @@ What's new * TEX2LYX +- Fix bug that language change was not recognized (bug 8210). * ADVANCED FIND AND REPLACE