mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
Fix handling of \hfill inside ERT.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7281 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
dc85736c7f
commit
62c09c9630
@ -1,3 +1,8 @@
|
||||
2003-07-15 Dekel Tsur <dekelts@tau.ac.il>
|
||||
|
||||
* lyx2lyx/lyxconvert_218.py (remove_oldert): Fix handling of
|
||||
\hfill inside ERT.
|
||||
|
||||
2003-07-09 Juergen Spitzmueller <j.spitzmueller@gmx.de>
|
||||
|
||||
* CREDITS: update.
|
||||
|
@ -195,7 +195,7 @@ def is_empty(lines):
|
||||
return filter(is_nonempty_line, lines) == []
|
||||
|
||||
move_rexp = re.compile(r"\\(family|series|shape|size|emph|numeric|bar|noun|end_deeper)")
|
||||
ert_rexp = re.compile(r"\\begin_inset|.*\\SpecialChar")
|
||||
ert_rexp = re.compile(r"\\begin_inset|\\hfill|.*\\SpecialChar")
|
||||
spchar_rexp = re.compile(r"(.*)(\\SpecialChar.*)")
|
||||
ert_begin = ["\\begin_inset ERT",
|
||||
"status Collapsed",
|
||||
@ -233,11 +233,15 @@ def remove_oldert(lines):
|
||||
k = i+1
|
||||
while 1:
|
||||
k2 = find_re(lines, ert_rexp, k, j)
|
||||
inset = specialchar = 0
|
||||
inset = hfill = specialchar = 0
|
||||
if k2 == -1:
|
||||
k2 = j
|
||||
elif check_token(lines[k2], "\\begin_inset"):
|
||||
inset = 1
|
||||
elif check_token(lines[k2], "\\hfill"):
|
||||
hfill = 1
|
||||
del lines[k2]
|
||||
j = j-1
|
||||
else:
|
||||
specialchar = 1
|
||||
mo = spchar_rexp.match(lines[k2])
|
||||
@ -276,6 +280,9 @@ def remove_oldert(lines):
|
||||
if not is_nonempty_line(lines[k]):
|
||||
k = k+1
|
||||
new.append("")
|
||||
elif hfill:
|
||||
new = new+["\hfill", ""]
|
||||
k = k2
|
||||
elif specialchar:
|
||||
if new == []:
|
||||
# This is not necessary, but we want the output to be
|
||||
|
Loading…
Reference in New Issue
Block a user