mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
become more liberal with accepted values, fix table cases
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5912 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
8c46346d86
commit
7c7f326f64
@ -1,3 +1,8 @@
|
||||
2003-01-07 José Matos <jamatos@fep.up.pt>
|
||||
|
||||
* lyx2lyx/lyxconvert_217.py: change bool_table to a function,
|
||||
becoming more liberal regarding the accepted values.
|
||||
|
||||
2003-01-06 Angus Leeming <leeming@lyx.org>
|
||||
|
||||
* scripts/lyxpreview2bitmap.sh: don't use 'which' to find an executable.
|
||||
|
@ -18,7 +18,12 @@
|
||||
import re, string, sys
|
||||
from parser_tools import *
|
||||
|
||||
bool_table = {"0": "false", "1":"true" }
|
||||
def bool_table(item):
|
||||
if item == "0":
|
||||
return "false"
|
||||
# should emit a warning if item != "1"
|
||||
return "true"
|
||||
|
||||
align_table = {"0": "top", "2": "left", "4": "right", "8": "center"}
|
||||
use_table = {"0": "none", "1": "parbox"}
|
||||
|
||||
@ -54,7 +59,7 @@ def table_update(lines):
|
||||
res = features_re.match( lines[1] )
|
||||
if res:
|
||||
val = res.groups()
|
||||
lines[1] = '<features rotate="%s" islongtable="%s" endhead="%s" endfirsthead="%s" endfoot="%s" endlastfoot="%s">' % (bool_table[val[0]], bool_table[val[1]], val[2], val[3], val[4], val[5])
|
||||
lines[1] = '<features rotate="%s" islongtable="%s" endhead="%s" endfirsthead="%s" endfoot="%s" endlastfoot="%s">' % (bool_table(val[0]), bool_table(val[1]), val[2], val[3], val[4], val[5])
|
||||
|
||||
if lines[2]=="":
|
||||
del lines[2]
|
||||
@ -81,12 +86,12 @@ def table_update(lines):
|
||||
res = cell_re.match(lines[i])
|
||||
if res:
|
||||
val = res.groups()
|
||||
lines[i] = '<cell multicolumn="%s" alignment="%s" valignment="%s" topline="%s" bottomline="%s" leftline="%s" rightline="%s" rotate="%s" usebox="%s" width="%s" special="%s">' % ( val[0], align_table[val[1]], align_table[val[2]], bool_table[val[3]], bool_table[val[4]], bool_table[val[5]], bool_table[val[6]], bool_table[val[7]], use_table[val[8]], val[9], val[10])
|
||||
lines[i] = '<cell multicolumn="%s" alignment="%s" valignment="%s" topline="%s" bottomline="%s" leftline="%s" rightline="%s" rotate="%s" usebox="%s" width="%s" special="%s">' % ( val[0], align_table[val[1]], align_table[val[2]], bool_table(val[3]), bool_table(val[4]), bool_table(val[5]), bool_table(val[6]), bool_table(val[7]), use_table[val[8]], val[9], val[10])
|
||||
|
||||
res = row_re.match(lines[i])
|
||||
if res:
|
||||
val = res.groups()
|
||||
lines[i] = '<row topline="%s" bottomline="%s" newpage="%s">' % (bool_table[val[0]], bool_table[val[1]], bool_table[val[2]])
|
||||
lines[i] = '<row topline="%s" bottomline="%s" newpage="%s">' % (bool_table(val[0]), bool_table(val[1]), bool_table(val[2]))
|
||||
|
||||
i = i + 1
|
||||
|
||||
@ -96,7 +101,7 @@ def table_update(lines):
|
||||
if res:
|
||||
val = res.groups()
|
||||
col_info[i] = '<column alignment="%s" valignment="%s" leftline="%s" rightline="%s" width="%s" special="%s">' \
|
||||
% ( align_table[val[0]], align_table[val[1]], bool_table[val[2]], bool_table[val[3]], val[4],val[5])
|
||||
% ( align_table[val[0]], align_table[val[1]], bool_table(val[2]), bool_table(val[3]), val[4],val[5])
|
||||
|
||||
return lines[:2] + col_info + lines[2:]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user