break
j = stins - 1
+ if endins < i:
+ return False
+
inset = get_value(lines, "\\begin_inset", stins)
if inset == "":
# shouldn't happen
break
j = stlay - 1
+ if endlay < i:
+ return False
+
lay = get_value(lines, "\\begin_layout", stlay)
if lay == "":
# shouldn't happen