]> git.lyx.org Git - lyx.git/blobdiff - lib/lyx2lyx/parser_tools.py
Pass parameters by reference (performance)
[lyx.git] / lib / lyx2lyx / parser_tools.py
index f1be0f02cd29834ca79924a69d076246692cfb59..4e30f63bf8094b65bbbb1557d62594cc1d5af317 100644 (file)
@@ -439,6 +439,9 @@ def get_containing_inset(lines, i):
           break
       j = stins - 1
 
+  if endins < i:
+      return False
+
   inset = get_value(lines, "\\begin_inset", stins)
   if inset == "":
       # shouldn't happen
@@ -465,6 +468,9 @@ def get_containing_layout(lines, i):
           break
       j = stlay - 1
 
+  if endlay < i:
+      return False
+
   lay = get_value(lines, "\\begin_layout", stlay)
   if lay == "":
       # shouldn't happen