The branch, master, has been updated.

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

commit a69fcde0726450d696081ed5c21506d42a90b103
Author: Uwe Stöhr <[email protected]>
Date:   Sun Feb 10 23:31:38 2013 +0100

    tex2lyx/Preamble.cpp: fix bug #8525 temporarily
    
    - this might break some tex2lyx features but tex2lyx was completely broken 
- not even the simplest TeX file could be imported and compiles

diff --git a/src/tex2lyx/Preamble.cpp b/src/tex2lyx/Preamble.cpp
index 8d82f6c..02469a2 100644
--- a/src/tex2lyx/Preamble.cpp
+++ b/src/tex2lyx/Preamble.cpp
@@ -802,11 +802,20 @@ void Preamble::handle_package(Parser &p, string const & 
name,
                // Therefore check for the "," character.
                // It is also only set when there is not more than one babel
                // language option.
-               if (opts.find(",") == string::npos && one_language == true)
-                       h_inputencoding = opts;
-               if (!options.empty())
-                       p.setEncoding(options.back(), Encoding::inputenc);
-               options.clear();
+               if (!opts.empty()) {
+                       if (opts.find(",") == string::npos && one_language == 
true) {
+                               h_inputencoding = opts;
+                               // FIXME: if this line is used, tex2lyx 
swallows the next character
+                               // in the file behind "{inputenc}"
+                               //p.setEncoding(opts);
+                       } else {
+                               h_preamble << "\\usepackage[" << opts << "}{" 
<< name << "}\n";
+                               // FIXME: enabling this introduces bug #8525
+                               //p.setEncoding(options.back(), 
Encoding::inputenc);
+                       }
+                       options.clear();
+               } else
+                       h_preamble << "\\usepackage{" << name << "}\n";         
        }
 
        else if (name == "srcltx") {

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

Summary of changes:
 src/tex2lyx/Preamble.cpp |   19 ++++++++++++++-----
 1 files changed, 14 insertions(+), 5 deletions(-)


hooks/post-receive
-- 
The LyX Source Repository

Reply via email to