commit a4a1c11b2d904d29faed69c1cd63408ed27526bc
Author: Richard Heck <[email protected]>
Date:   Sat Jul 23 13:42:54 2016 -0400

    Fix hang reported at #10307.
    
    Also, add a FIXME explaining what we'd need to do to fix the
    convert_TeX_brace_to_Argument routine properly.
    
    (cherry picked from commit 0f4c14bba21526274856ef564b689cbbded5f777)
---
 lib/lyx2lyx/lyx_2_1.py |   11 +++++++++++
 status.22x             |    2 ++
 2 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/lib/lyx2lyx/lyx_2_1.py b/lib/lyx2lyx/lyx_2_1.py
index fe5f9d6..7044ad8 100644
--- a/lib/lyx2lyx/lyx_2_1.py
+++ b/lib/lyx2lyx/lyx_2_1.py
@@ -219,7 +219,15 @@ def convert_TeX_brace_to_Argument(document, line, n, nmax, 
inset, environment, o
           else:
             lineERT += 1
       if environment == True:
+        # FIXME This version of the routine does not check for and pass over
+        # arguments before n. So it attempts to process the argument in the
+        # document, no matter what has been specified.
+        #
+        # The other branch does do that, but probably that code would be better
+        # in a single location: Skip all those arguments, then process the ones
+        # we want.
         end_ERT = find_end_of_inset(document.body, lineERT)
+        document.warning(str(end_ERT))
         if end_ERT == -1:
           document.warning("Can't find end of ERT!!")
           break
@@ -254,6 +262,9 @@ def convert_TeX_brace_to_Argument(document, line, n, nmax, 
inset, environment, o
               document.body[lineERT2 : end2 + 1] = ["\\end_layout", "", 
"\\end_inset"]
             document.body[lineERT : end_ERT + 1] = ["\\begin_inset Argument " 
+ str(n), "status open", "", "\\begin_layout Plain Layout"]
           n += 1
+        else:
+          document.warning("Unable to process argument!")
+          n += 1
 
 
 ###############################################################################
diff --git a/status.22x b/status.22x
index d5eecbf..7c18611 100644
--- a/status.22x
+++ b/status.22x
@@ -40,6 +40,8 @@ What's new
 
 * LYX2LYX
 
+- Fix hang with some IEEEtran documents (bug 10307).
+
 
 * USER INTERFACE
 

Reply via email to