Author: uwestoehr
Date: Fri Oct 28 14:46:53 2011
New Revision: 40051
URL: http://www.lyx.org/trac/changeset/40051

Log:
tex2lyx/preamble.cpp: prevent bug #7858 (that I accidentally introduced in 
r39988) and this way fix bug #7861 as side-effect

Modified:
   lyx-devel/branches/BRANCH_2_0_X/src/tex2lyx/preamble.cpp
   lyx-devel/branches/BRANCH_2_0_X/status.20x

Modified: lyx-devel/branches/BRANCH_2_0_X/src/tex2lyx/preamble.cpp
==============================================================================
--- lyx-devel/branches/BRANCH_2_0_X/src/tex2lyx/preamble.cpp    Fri Oct 28 
14:37:59 2011        (r40050)
+++ lyx-devel/branches/BRANCH_2_0_X/src/tex2lyx/preamble.cpp    Fri Oct 28 
14:46:53 2011        (r40051)
@@ -544,8 +544,12 @@
 
        else if (name == "babel") {
                h_language_package = "default";
-               // we have to do nothing if babel is loaded without any 
options, otherwise
-               // we would pollute the preamble with this call in every 
roundtrip
+               // One might think we would have to do nothing if babel is 
loaded
+               // without any options to prevent pollution of the preamble 
with this
+               // babel call in every roundtrip.
+               // But the user could have defined babel-specific things 
afterwards. So
+               // we need to keep it in the preamble to prevent cases like bug 
#7861.
+               h_preamble << "\\usepackage{babel}\n";
                if (!opts.empty()) {
                        // check if more than one option was used - used later 
for inputenc
                        // in case inputenc is parsed before babel, set the 
encoding to auto

Modified: lyx-devel/branches/BRANCH_2_0_X/status.20x
==============================================================================
--- lyx-devel/branches/BRANCH_2_0_X/status.20x  Fri Oct 28 14:37:59 2011        
(r40050)
+++ lyx-devel/branches/BRANCH_2_0_X/status.20x  Fri Oct 28 14:46:53 2011        
(r40051)
@@ -133,6 +133,8 @@
 
 - Fix tex2lyx handling of recognized Roman fonts (bug 7856).
 
+- Fix tex2lyx handling babel-specific preamble commands (bug 7861).
+
 - Store the autosave files of unnamed buffers in the correct directory
   and make sure they are not left behind after saving (bug 7793).
 

Reply via email to