The branch, master, has been updated.

- Log -----------------------------------------------------------------

commit 66e3ac003fce5f95f92bac769977d13ae4bcb57e
Author: Uwe Stöhr <uwesto...@lyx.org>
Date:   Sun Jun 24 18:24:28 2012 +0200

    fix bug #8210
    
    we need to store the document language from the beginning of the document 
in the context to be able to handle all kinds of language switch commands

diff --git a/src/tex2lyx/Preamble.h b/src/tex2lyx/Preamble.h
index ba4ef31..585cb25 100644
--- a/src/tex2lyx/Preamble.h
+++ b/src/tex2lyx/Preamble.h
@@ -35,6 +35,8 @@ public:
        Preamble();
 
        ///
+       std::string h_language;
+       ///
        std::string inputencoding() const { return h_inputencoding; }
        ///
        std::string notefontcolor() const { return h_notefontcolor; }
@@ -115,7 +117,6 @@ private:
        std::string h_index_command;
        std::string h_inputencoding;
        std::string h_justification;
-       std::string h_language;
        std::string h_language_package;
        std::string h_listings_params;
        std::string h_maintain_unincluded_children;
diff --git a/src/tex2lyx/tex2lyx.cpp b/src/tex2lyx/tex2lyx.cpp
index c7bccc3..b713e4c 100644
--- a/src/tex2lyx/tex2lyx.cpp
+++ b/src/tex2lyx/tex2lyx.cpp
@@ -671,6 +671,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.h_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.

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

Summary of changes:
 src/tex2lyx/Preamble.h  |    3 ++-
 src/tex2lyx/tex2lyx.cpp |    4 ++++
 2 files changed, 6 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
The LyX Source Repository

Reply via email to