Am Montag, den 19.02.2018, 16:40 +0100 schrieb Jürgen Spitzmüller:
> I am not sure if there is an easy fix for this. The "real" fix would
> be
> to actually change Standard to PlainLayout in 315, but I suppose
> there
> were reasons for not doing that. I am not sure if the check in
> convert_separator can be adapted to cover these old cases.

I found a solution: Check whether there is and inset end before current
layout begin and previous layout end. See attached patch.

Jürgen

> 
> Jürgen
> 
> > 
> >     Kornel
diff --git a/lib/lyx2lyx/lyx_2_2.py b/lib/lyx2lyx/lyx_2_2.py
index cb1731304e..2dd749ad78 100644
--- a/lib/lyx2lyx/lyx_2_2.py
+++ b/lib/lyx2lyx/lyx_2_2.py
@@ -189,6 +189,10 @@ def convert_separator(document):
 
         j = find_token_backwards(document.body, "\\end_layout", i-1)
         if j != -1:
+            n = find_token(document.body, "\\end_inset", j, lay[1])
+            if n != -1:
+                i = i + 1
+                continue
             lay = get_containing_layout(document.body, j-1)
             if lay != False and lay[0] == "Standard" \
                and find_token(document.body, "\\align", lay[1], lay[2]) == -1 \

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to