]> git.lyx.org Git - features.git/commitdiff
change the file format number to 229 for the sake of a cleaner minipage/box conversion
authorJürgen Spitzmüller <spitz@lyx.org>
Mon, 29 Dec 2003 15:49:50 +0000 (15:49 +0000)
committerJürgen Spitzmüller <spitz@lyx.org>
Mon, 29 Dec 2003 15:49:50 +0000 (15:49 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8287 a592a061-630c-0410-9148-cb99ea01b6c8

development/ChangeLog
development/FORMAT
lib/lyx2lyx/ChangeLog
lib/lyx2lyx/lyx2lyx
lib/lyx2lyx/lyxconvert_227.py
lib/lyx2lyx/lyxconvert_228.py [new file with mode: 0644]
lib/lyx2lyx/lyxrevert_229.py [new file with mode: 0644]
src/ChangeLog
src/buffer.C

index d4f7cff291e0bf914f1b407968cd21be1ef5b9e2..dc3426906858fb84b3f2458e61eb3251aacdc702 100644 (file)
@@ -1,3 +1,7 @@
+2003-12-29  Jürgen Spitzmüller  <j.spitzmueller@gmx.de>
+
+       * FORMAT: document change to format 229.
+       
 2003-12-15  Angus Leeming  <leeming@lyx.org>
 
        * FORMAT: document change to format 228.
index b4764b86f5488bbd498345b591499b088cc73380..aaf9e3e0366aec5f3e3489535e703c36492a6fb2 100644 (file)
@@ -1,6 +1,12 @@
 LyX file-format changes
 -----------------------
 
+2003-12-29  Jürgen Spitzmüller  <j.spitzmueller@gmx.de>
+
+       * format incremented to 229.
+       * Minipages cannot be read anymore. All minipage insets will
+       be converted to frameless box insets between 228->229.
+
 2003-12-15  Angus Leeming  <leeming@lyx.org>
 
        * format incremented to 228.
index 6a5b8091ed75c2971f93e41b5494afa9ba2a1218..c609e0b3d86277d09cbe026ca5b093137ca49553 100644 (file)
@@ -1,7 +1,9 @@
 2003-12-29  Jürgen Spitzmüller  <j.spitzmueller@gmx.de>
 
+       * lyx2lyx: up the format to 229.
        * lyxconvert_224.py (convert_minipage): remove function...
-       * lyxconvert_227.py: ...and place it here.
+       * lyxconvert_228.py: ...and place it here.
+       * lyxrevert_229.py: new file (bare bones).
 
 2003-12-19  Angus Leeming  <leeming@lyx.org>
 
index 1a45dbe0db3e896758a639a8f341e77496c9ebc6..d4333283bcf76499ab339213020da8b3b7b758ee 100755 (executable)
@@ -40,7 +40,7 @@ opt.quiet = 0
 
 format = re.compile(r"(\d)[\.,]?(\d\d)")
 fileformat = re.compile(r"\\lyxformat\s*(\S*)")
-lst_ft = [210, 215, 216, 217,  218, 220, 221, 223, 224, 225, 226, 227, 228]
+lst_ft = [210, 215, 216, 217,  218, 220, 221, 223, 224, 225, 226, 227, 228, 229]
 
 def usage():
     print """Usage: lyx2lyx [options] [file]
index e10332355690addf35ef64f7bdb8eb6a818e87b5..5ea38b22257808d906c9fb60dd422c24209b9c1c 100644 (file)
@@ -16,7 +16,7 @@
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
 import sys
-from parser_tools import find_token, find_tokens
+from parser_tools import find_tokens
 
 def convert_collapsable(lines):
     i = 0
@@ -52,72 +52,8 @@ def convert_collapsable(lines):
         i = i + 1
 
 
-def convert_minipage(lines):
-    """ Convert minipages to the box inset.
-    We try to use the same order of arguments as lyx does.
-    """
-    pos = ["t","c","b"]
-    inner_pos = ["c","t","b","s"]
-
-    i = 0
-    while 1:
-        i = find_token(lines, "\\begin_inset Minipage", i)
-        if i == -1:
-            return
-
-        lines[i] = "\\begin_inset Box Frameless"
-        i = i + 1
-
-        # convert old to new position using the pos list
-        if lines[i][:8] == "position":
-            lines[i] = 'position "%s"' % pos[int(lines[i][9])]
-        else:
-            lines.insert(i, 'position "%s"' % pos[0])
-        i = i + 1
-
-        lines.insert(i, 'hor_pos "c"')
-        i = i + 1
-        lines.insert(i, 'has_inner_box 1')
-        i = i + 1
-
-        # convert the inner_position
-        if lines[i][:14] == "inner_position":
-            lines[i] = 'inner_pos "%s"' %  inner_pos[int(lines[i][15])]
-        else:
-            lines.insert('inner_pos "%s"' % inner_pos[0])
-        i = i + 1
-
-        # We need this since the new file format has a height and width
-        # in a different order.
-        if lines[i][:6] == "height":
-            height = lines[i][6:]
-            # test for default value of 221 and convert it accordingly
-            if height == ' "0pt"':
-                height = ' "1pt"'
-            del lines[i]
-        else:
-            height = ' "1pt"'
-
-        if lines[i][:5] == "width":
-            width = lines[i][5:]
-            del lines[i]
-        else:
-            width = ' "0"'
-
-        lines.insert(i, 'use_parbox 0')
-        i = i + 1
-        lines.insert(i, 'width' + width)
-        i = i + 1
-        lines.insert(i, 'special "none"')
-        i = i + 1
-        lines.insert(i, 'height' + height)
-        i = i + 1
-        lines.insert(i, 'height_special "totalheight"')
-        i = i + 1
-
 def convert(header, body):
     convert_collapsable(body)
-    convert_minipage(body)
 
 if __name__ == "__main__":
     pass
diff --git a/lib/lyx2lyx/lyxconvert_228.py b/lib/lyx2lyx/lyxconvert_228.py
new file mode 100644 (file)
index 0000000..33e5af6
--- /dev/null
@@ -0,0 +1,91 @@
+# This file is part of lyx2lyx
+# Copyright (C) 2003 José Matos <jamatos@fep.up.pt>
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+
+
+
+import sys
+from parser_tools import find_token
+
+
+def convert_minipage(lines):
+    """ Convert minipages to the box inset.
+    We try to use the same order of arguments as lyx does.
+    """
+    pos = ["t","c","b"]
+    inner_pos = ["c","t","b","s"]
+
+    i = 0
+    while 1:
+        i = find_token(lines, "\\begin_inset Minipage", i)
+        if i == -1:
+            return
+
+        lines[i] = "\\begin_inset Box Frameless"
+        i = i + 1
+
+        # convert old to new position using the pos list
+        if lines[i][:8] == "position":
+            lines[i] = 'position "%s"' % pos[int(lines[i][9])]
+        else:
+            lines.insert(i, 'position "%s"' % pos[0])
+        i = i + 1
+
+        lines.insert(i, 'hor_pos "c"')
+        i = i + 1
+        lines.insert(i, 'has_inner_box 1')
+        i = i + 1
+
+        # convert the inner_position
+        if lines[i][:14] == "inner_position":
+            lines[i] = 'inner_pos "%s"' %  inner_pos[int(lines[i][15])]
+        else:
+            lines.insert('inner_pos "%s"' % inner_pos[0])
+        i = i + 1
+
+        # We need this since the new file format has a height and width
+        # in a different order.
+        if lines[i][:6] == "height":
+            height = lines[i][6:]
+            # test for default value of 221 and convert it accordingly
+            if height == ' "0pt"':
+                height = ' "1pt"'
+            del lines[i]
+        else:
+            height = ' "1pt"'
+
+        if lines[i][:5] == "width":
+            width = lines[i][5:]
+            del lines[i]
+        else:
+            width = ' "0"'
+
+        lines.insert(i, 'use_parbox 0')
+        i = i + 1
+        lines.insert(i, 'width' + width)
+        i = i + 1
+        lines.insert(i, 'special "none"')
+        i = i + 1
+        lines.insert(i, 'height' + height)
+        i = i + 1
+        lines.insert(i, 'height_special "totalheight"')
+        i = i + 1
+
+def convert(header, body):
+    convert_minipage(body)
+
+if __name__ == "__main__":
+    pass
diff --git a/lib/lyx2lyx/lyxrevert_229.py b/lib/lyx2lyx/lyxrevert_229.py
new file mode 100644 (file)
index 0000000..5a1a16d
--- /dev/null
@@ -0,0 +1,24 @@
+# This file is part of lyx2lyx
+# Copyright (C) 2003 José Matos <jamatos@fep.up.pt>
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+
+
+
+def convert(header, body):
+    pass
+
+if __name__ == "__main__":
+    pass
index 941f8fcaa97ccef486ef4ee3409636632dc9b110..304c8b37fa66c6664c6c3bd4f2e12575fca79833 100644 (file)
@@ -1,3 +1,7 @@
+2003-12-29  Jürgen Spitzmüller  <j.spitzmueller@gmx.de>
+
+       * buffer.C: increment format to 229.
+
 2003-12-28  Michael Schmitt  <michael.schmitt@teststep.org>
 
        * LaTeXFeatures.C:
index 30a42b39daa4f2f03d527610124c5c73be2fa85a..ac553cbcd3b71cf93ffbbfedb2b53a92e5108b82 100644 (file)
@@ -132,7 +132,7 @@ extern BufferList bufferlist;
 
 namespace {
 
-const int LYX_FORMAT = 228;
+const int LYX_FORMAT = 229;
 
 } // namespace anon