]> git.lyx.org Git - features.git/commitdiff
fix bug 2244 (branch removal)
authorGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Thu, 2 Feb 2006 21:30:04 +0000 (21:30 +0000)
committerGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Thu, 2 Feb 2006 21:30:04 +0000 (21:30 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10804 a592a061-630c-0410-9148-cb99ea01b6c8

development/ChangeLog
development/FORMAT
lib/lyx2lyx/ChangeLog
lib/lyx2lyx/lyx_1_4.py

index dc1820f8584eb79a8b93ee6271a5e4838b89544c..94edcd8be8220cb41cb0bcaf7a66ad658d295d91 100644 (file)
@@ -1,3 +1,7 @@
+2006-02-02  Georg Baum  <Georg.Baum@post.rwth-aachen.de>
+
+       * FORMAT: document branches
+
 2006-02-01  Bennett Helm  <bennett.helm@fandm.edu>
 
        * MacOSX/LyX.app/Contents/Resources/preferences: update again.
index e2f0c908ced9543999984c4e6a6b20d65016912b..4312cf338a062e90da155b9b1de72b22e0dd8379 100644 (file)
@@ -296,6 +296,26 @@ Paragraph text.
        * attribute valignment="center" is replaced by valignment="middle"
        for tabular columns and cells
 
+2003-08-17  Martin Vermeer  <martin.vermeer@hut.fi>
+
+       * Added branch inset. File format:
+
+       branch definition in the header:
+       \branch <branchname>
+       \selected 0                    0/1
+       \color #rrggbb
+       \end_branch
+
+       \begin_inset Branch <branchname>
+       collapsed false                 true/false
+
+       \begin_layout Standard
+
+       <branch contents>
+       \end_layout
+
+       \end_inset
+
 2003-07-28  José Matos  <jamatos@lyx.org>
 
        * \the_end is replaced with \end_document
index 9329edd684148dc691502009b8a63af81a4508e2..d7e7aef542f63c15f78526b04a408595934402ae 100644 (file)
@@ -1,3 +1,7 @@
+2006-02-02  Georg Baum  <Georg.Baum@post.rwth-aachen.de>
+
+       * lyx_1_4.py (remove_branches): new, remove branch insets
+
 2005-12-01  José Matos  <jamatos@lyx.org>
 
        * LyX.py (choose_io): replace open and make the choice more transparent.
index 3739e5547bf1634a1e0fd8f37ea22f66655065f4..cc83bd3a9d4e7cdc2e4be8ca627121bc8e57adaf 100644 (file)
@@ -1613,6 +1613,51 @@ def convert_frameless_box(file):
                              'collapsed ' + params['collapsed']]
            i = i + 6
 
+
+def remove_branches(file):
+    i = 0
+    while 1:
+        i = find_token(file.header, "\\branch", i)
+        if i == -1:
+            break
+        file.warning("Removing branch %s." % split(file.header[i])[1])
+        j = find_token(file.header, "\\end_branch", i)
+        if j == -1:
+            file.warning("Malformed LyX file: Missing '\\end_branch'.")
+            break
+        del file.header[i:j+1]
+
+    i = 0
+    while 1:
+        i = find_token(file.body, "\\begin_inset Branch", i)
+        if i == -1:
+            return
+        j = find_end_of_inset(file.body, i)
+        if j == -1:
+            file.warning("Malformed LyX file: Missing '\\end_inset'.")
+            i = i + 1
+            continue
+        del file.body[i]
+        del file.body[j - 1]
+        # Seach for a line starting 'collapsed'
+        # If, however, we find a line starting '\layout'
+        # (_always_ present) then break with a warning message
+        collapsed_found = 0
+        while 1:
+            if (file.body[i][:9] == "collapsed"):
+                del file.body[i]
+                collapsed_found = 1
+                continue
+            elif (file.body[i][:7] == "\\layout"):
+                if collapsed_found == 0:
+                    file.warning("Malformed LyX file: Missing 'collapsed'.")
+                # Delete this new paragraph, since it would not appear in
+                # .tex output. This avoids also empty paragraphs.
+                del file.body[i]
+                break
+            i = i + 1
+
+
 ##
 # Convert jurabib
 #
@@ -2318,7 +2363,8 @@ revert =  [[244, []],
            [226, [revert_box, revert_external_2]],
            [225, [revert_note]],
            [224, [rm_end_layout, begin_layout2layout, revert_end_document,
-                  revert_valignment_middle, revert_breaks, convert_frameless_box]],
+                  revert_valignment_middle, revert_breaks, convert_frameless_box,
+                  remove_branches]],
            [223, [revert_external_2, revert_comment, revert_eqref]],
            [222, [revert_spaces, revert_bibtex]],
            [221, [rm_end_header, rm_tracking_changes, rm_body_changes]]]