commit d752334ec499f6353c867b3b37655f7b1f3d62ee
Author: Georg Baum <b...@lyx.org>
Date:   Wed Mar 11 22:20:44 2015 +0100

    Fix tex2lyx script output
    
    tex2lyx did not use the InsetLayout for the script insets, so it did not 
know
    that it had to use Plain Layout. However, there is still a possible pitfall:
    InsetScript uses a hard coded plain layout for the InsetText constructor, so
    if anybody would remove ForcePlain 1 and MultiPar false from the InsetLayout
    then LyX would still write script insets with plain layout, but tex2lyx 
would
    output standard layout again.

diff --git a/src/tex2lyx/test/box-color-size-space-align.lyx.lyx 
b/src/tex2lyx/test/box-color-size-space-align.lyx.lyx
index 1b590c8..b08a0bf 100644
--- a/src/tex2lyx/test/box-color-size-space-align.lyx.lyx
+++ b/src/tex2lyx/test/box-color-size-space-align.lyx.lyx
@@ -2119,9 +2119,7 @@ from textgreek and textcyr: ἀв
 from subscript: 
 \begin_inset script subscript
 
-\begin_layout Standard
-
-\size normal
+\begin_layout Plain Layout
 4
 \end_layout
 
diff --git a/src/tex2lyx/test/test-insets.lyx.lyx 
b/src/tex2lyx/test/test-insets.lyx.lyx
index 5801561..1fb8cdc 100644
--- a/src/tex2lyx/test/test-insets.lyx.lyx
+++ b/src/tex2lyx/test/test-insets.lyx.lyx
@@ -6063,7 +6063,7 @@ ow
 
 \begin_inset script superscript
 
-\begin_layout Standard
+\begin_layout Plain Layout
 Wow
 \end_layout
 
@@ -6131,7 +6131,7 @@ TIPA
 e̥ e̊ e̬ e̤ ḛ e̼ e̪ e̺ e̻ e
 \begin_inset script superscript
 
-\begin_layout Standard
+\begin_layout Plain Layout
 h
 \end_layout
 
@@ -6140,7 +6140,7 @@ h
  e̹ e̜ e̟ e̠ e̠ ë e̽ e̩ e̩ e̯ e˞e
 \begin_inset script superscript
 
-\begin_layout Standard
+\begin_layout Plain Layout
 w
 \end_layout
 
@@ -6149,7 +6149,7 @@ w
  e
 \begin_inset script superscript
 
-\begin_layout Standard
+\begin_layout Plain Layout
 j
 \end_layout
 
@@ -6158,7 +6158,7 @@ j
  e
 \begin_inset script superscript
 
-\begin_layout Standard
+\begin_layout Plain Layout
 ɣ
 \end_layout
 
@@ -6167,7 +6167,7 @@ j
  e
 \begin_inset script superscript
 
-\begin_layout Standard
+\begin_layout Plain Layout
 ʕ
 \end_layout
 
@@ -6176,7 +6176,7 @@ j
  e̴ e̝ e̞ e̘ e̙ ẽ e
 \begin_inset script superscript
 
-\begin_layout Standard
+\begin_layout Plain Layout
 n
 \end_layout
 
@@ -6185,7 +6185,7 @@ n
  e
 \begin_inset script superscript
 
-\begin_layout Standard
+\begin_layout Plain Layout
 l
 \end_layout
 
@@ -6867,7 +6867,7 @@ status collapsed
 A sub
 \begin_inset script subscript
 
-\begin_layout Standard
+\begin_layout Plain Layout
 sc
 \emph on
 ript
@@ -6880,7 +6880,7 @@ ript
  and super
 \begin_inset script superscript
 
-\begin_layout Standard
+\begin_layout Plain Layout
 script with 
 \begin_inset Formula $a^2+b^2=c^2$
 \end_inset
diff --git a/src/tex2lyx/text.cpp b/src/tex2lyx/text.cpp
index 5a55b87..68f4ec9 100644
--- a/src/tex2lyx/text.cpp
+++ b/src/tex2lyx/text.cpp
@@ -3635,7 +3635,8 @@ void parse_text(Parser & p, ostream & os, unsigned flags, 
bool outer,
                        context.check_layout(os);
                        begin_inset(os, "script ");
                        os << t.cs().substr(4) << '\n';
-                       parse_text_in_inset(p, os, FLAG_ITEM, false, context);
+                       newinsetlayout = findInsetLayout(context.textclass, 
t.cs(), true);
+                       parse_text_in_inset(p, os, FLAG_ITEM, false, context, 
newinsetlayout);
                        end_inset(os);
                        if (t.cs() == "textsubscript")
                                
preamble.registerAutomaticallyLoadedPackage("subscript");

Reply via email to