]> git.lyx.org Git - lyx.git/commitdiff
Fix and simplify par params parsing in get_containing_layout.
authorJuergen Spitzmueller <spitz@lyx.org>
Sat, 29 Nov 2014 09:54:05 +0000 (10:54 +0100)
committerJuergen Spitzmueller <spitz@lyx.org>
Sat, 29 Nov 2014 09:54:05 +0000 (10:54 +0100)
The previous verion did not catch \align <alignment>.

Richard, this should go to branch as well.

lib/lyx2lyx/parser_tools.py

index 9707f7ad463f9a24f92b566140fdd89b69eb2dad..f1be0f02cd29834ca79924a69d076246692cfb59 100644 (file)
@@ -470,13 +470,12 @@ def get_containing_layout(lines, i):
       # shouldn't happen
       return False
   par_params = ["\\noindent", "\\indent", "\\indent-toggle", "\\leftindent",
-                "\\start_of_appendix", "\\paragraph_spacing single",
-                "\\paragraph_spacing onehalf", "\\paragraph_spacing double",
-                "\\paragraph_spacing other", "\\align", "\\labelwidthstring"]
+                "\\start_of_appendix", "\\paragraph_spacing", "\\align",
+                "\\labelwidthstring"]
   stpar = stlay
   while True:
       stpar += 1
-      if lines[stpar] not in par_params:
+      if lines[stpar].split(' ', 1)[0] not in par_params:
           break
   return (lay, stlay, endlay, stpar)