mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-13 03:40:34 +00:00
repair tabular conversions
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9647 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
cb12e79018
commit
3a4be311e6
@ -1,3 +1,11 @@
|
||||
2005-02-17 Georg Baum <Georg.Baum@post.rwth-aachen.de>
|
||||
|
||||
* lyx_1_4.py (convert_table_valignment_middle,
|
||||
revert_valignment_middle): use regex to recognize
|
||||
'\\begin_inset Tabular' and '\\begin_inset Tabular'
|
||||
* lyx_1_2.py (update_tabular, update_longtables): ditto
|
||||
* lyx_1_1_6fix3.py (update_tabular): ditto
|
||||
|
||||
2005-02-15 José Matos <jamatos@lyx.org>
|
||||
|
||||
* lyx_1_2.py (remove_pextra): fix bug 1816.
|
||||
|
@ -18,7 +18,7 @@
|
||||
|
||||
import re
|
||||
import string
|
||||
from parser_tools import find_token
|
||||
from parser_tools import find_token, find_re
|
||||
|
||||
def bool_table(item):
|
||||
if item == "0":
|
||||
@ -32,10 +32,11 @@ use_table = {"0": "none", "1": "parbox"}
|
||||
table_meta_re = re.compile(r'<LyXTabular version="?1"? rows="?(\d*)"? columns="?(\d*)"?>')
|
||||
|
||||
def update_tabular(file):
|
||||
regexp = re.compile(r'^\\begin_inset\s+Tabular')
|
||||
lines = file.body
|
||||
i=0
|
||||
while 1:
|
||||
i = find_token(lines, '\\begin_inset Tabular', i)
|
||||
i = find_re(lines, regexp, i)
|
||||
if i == -1:
|
||||
break
|
||||
|
||||
|
@ -480,10 +480,11 @@ attr_re = re.compile(r' \w*="(false|0|)"')
|
||||
line_re = re.compile(r'<(features|column|row|cell)')
|
||||
|
||||
def update_tabular(file):
|
||||
regexp = re.compile(r'^\\begin_inset\s+Tabular')
|
||||
lines = file.body
|
||||
i = 0
|
||||
while 1:
|
||||
i = find_token(lines, '\\begin_inset Tabular', i)
|
||||
i = find_re(lines, regexp, i)
|
||||
if i == -1:
|
||||
break
|
||||
|
||||
@ -608,10 +609,11 @@ longtable_re = re.compile(r'islongtable="(\w)"')
|
||||
ltvalues_re = re.compile(r'endhead="(-?\d*)" endfirsthead="(-?\d*)" endfoot="(-?\d*)" endlastfoot="(-?\d*)"')
|
||||
lt_features_re = re.compile(r'(endhead="-?\d*" endfirsthead="-?\d*" endfoot="-?\d*" endlastfoot="-?\d*")')
|
||||
def update_longtables(file):
|
||||
regexp = re.compile(r'^\\begin_inset\s+Tabular')
|
||||
body = file.body
|
||||
i = 0
|
||||
while 1:
|
||||
i = find_token(body, '\\begin_inset Tabular', i)
|
||||
i = find_re(body, regexp, i)
|
||||
if i == -1:
|
||||
break
|
||||
i = i + 1
|
||||
|
@ -2,7 +2,7 @@
|
||||
# -*- coding: iso-8859-1 -*-
|
||||
# Copyright (C) 2002 Dekel Tsur <dekel@lyx.org>
|
||||
# Copyright (C) 2002-2004 José Matos <jamatos@lyx.org>
|
||||
# Copyright (C) 2004-2005 Georg Baum <Georg.Baum@post.rwth-aachen.de>
|
||||
# Copyright (C) 2004-2005 Georg Baum <Georg.Baum@post.rwth-aachen.de>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
@ -23,7 +23,7 @@ from os import access, F_OK
|
||||
import os.path
|
||||
from parser_tools import find_token, find_end_of_inset, get_next_paragraph, \
|
||||
get_paragraph, get_value, del_token, is_nonempty_line,\
|
||||
find_tokens, find_end_of, find_token2
|
||||
find_tokens, find_end_of, find_token2, find_re
|
||||
from sys import stdin
|
||||
from string import replace, split, find, strip, join
|
||||
|
||||
@ -396,9 +396,10 @@ def convert_valignment_middle(body, start, end):
|
||||
|
||||
|
||||
def convert_table_valignment_middle(file):
|
||||
regexp = re.compile(r'^\\begin_inset\s+Tabular')
|
||||
i = 0
|
||||
while 1:
|
||||
i = find_token(file.body, '\\begin_inset Tabular', i)
|
||||
i = find_re(file.body, regexp, i)
|
||||
if i == -1:
|
||||
return
|
||||
j = find_end_of_inset(file.body, i + 1)
|
||||
@ -417,9 +418,10 @@ def revert_table_valignment_middle(body, start, end):
|
||||
|
||||
|
||||
def revert_valignment_middle(file):
|
||||
regexp = re.compile(r'^\\begin_inset\s+Tabular')
|
||||
i = 0
|
||||
while 1:
|
||||
i = find_token(file.body, '\\begin_inset Tabular', i)
|
||||
i = find_re(file.body, regexp, i)
|
||||
if i == -1:
|
||||
return
|
||||
j = find_end_of_inset(file.body, i + 1)
|
||||
|
Loading…
x
Reference in New Issue
Block a user