]> git.lyx.org Git - features.git/blobdiff - lib/lyx2lyx/parser_tools.py
Prevent changing of non-tabular lines.
[features.git] / lib / lyx2lyx / parser_tools.py
index 3b15704eac1eb9f5ade988eb24cd6cf46a347fd5..b16648a8219ca2077d6bacc833aa44934f1a029d 100644 (file)
@@ -144,6 +144,21 @@ def find_beginning_of_inset(lines, i):
 def find_end_of_tabular(lines, i):
     return find_end_of(lines, i, "<lyxtabular", "</lyxtabular")
 
+def get_tabular_lines(lines, i):
+    result = []
+    i = i+1
+    j = find_end_of_tabular(lines, i)
+    if j == -1:
+       return []
+
+    while i <= j:
+       if check_token(lines[i], "\\begin_inset"):
+           i = find_end_of_inset(lines, i)+1
+       else:
+           result.append(i)
+           i = i+1
+    return result
+
 def is_nonempty_line(line):
     return line != " "*len(line)