commit 3040adf7650f0394a41326f017ef824da0cde1d1
Author: Jean-Marc Lasgouttes <[email protected]>
Date:   Thu Nov 27 16:30:00 2014 +0100

    Fix reverting of chunks insets to 2.0 format
    
    When the chunk inset did not have an optional argument, the prefix of the 
chunk was omitted.
    
    Fixes bug: #9343

diff --git a/lib/lyx2lyx/lyx_2_1.py b/lib/lyx2lyx/lyx_2_1.py
index 2d523db..76156d2 100644
--- a/lib/lyx2lyx/lyx_2_1.py
+++ b/lib/lyx2lyx/lyx_2_1.py
@@ -4688,7 +4688,7 @@ def revert_chunks(document):
             continue
 
         # Look for optional argument
-        have_optarg = False
+        optarg = ""
         ostart = find_token(document.body, "\\begin_inset Argument 1", i, iend)
         if ostart != -1:
             oend = find_end_of_inset(document.body, ostart)
@@ -4698,7 +4698,6 @@ def revert_chunks(document):
             else:
                 m = find_end_of_layout(document.body, k)
                 optarg = "".join(document.body[k+1:m])
-                have_optarg = True
 
             # We now remove the optional argument, so we have something
             # uniform on which to work
@@ -4727,8 +4726,7 @@ def revert_chunks(document):
             k = j
         # we now need to wrap all of these paragraphs in chunks
         newlines = []
-        if have_optarg:
-            newlines.extend(["\\begin_layout Chunk", "", "<<" + optarg + 
">>=", "\\end_layout", ""])
+        newlines.extend(["\\begin_layout Chunk", "", "<<" + optarg + ">>=", 
"\\end_layout", ""])
         for stuff in parlist:
             newlines.extend(["\\begin_layout Chunk"] + stuff + 
["\\end_layout", ""])
         newlines.extend(["\\begin_layout Chunk", "", "@", "\\end_layout", ""])
diff --git a/status.21x b/status.21x
index aeb585c..6d019ca 100644
--- a/status.21x
+++ b/status.21x
@@ -103,7 +103,9 @@ What's new
 
 - Fix import of Chunk layout with trailing empty paragraph (bug 9298).
 
-- Fix import of chunk insets containing newlines (bug 9300).
+- Fix import of chunk layouts containing newlines (bug 9300).
+
+- Fix export to LyX 2.0 of chunk insets without optional argument (bug 9343).
 
 - Fix import of ERT beamer block titles which are preceeded by a
   language switch.

Reply via email to