remove layout Comment, fix bug 1280 critical for 1.4

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7380 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
José Matox 2003-07-27 12:08:53 +00:00
parent 00e5c3f3a2
commit ff66614d1a
7 changed files with 78 additions and 72 deletions

View File

@ -1,3 +1,7 @@
2003-07-27 José Matos <jamatos@fep.up.pt>
* lyx2lyx/lyxconvert_223.py (convert_comment): remove layout Comment.
2003-07-27 Lars Gullik Bjønnes <larsbj@gullik.net>
* reLyX/configure.ac: new file

View File

@ -16,12 +16,6 @@ Style Code
PassThru 1
End
# Comment style definition
Style Comment
LatexType Paragraph
LatexName remark
End
Style LyX-Code
ObsoletedBy Code
End
@ -30,4 +24,4 @@ NoStyle LyX-Code
NoStyle Address
NoStyle Right_Address
NoStyle Right_Address

View File

@ -13,10 +13,6 @@ Preamble
\AtBeginDocument{\make@lr\thetheorem}
EndPreamble
Style Comment
LabelString ":äøòä"
End
Style Abstract
LabelString "øéö÷ú"
End

View File

@ -43,37 +43,6 @@ Style LyX-Code
End
# Comment style definition
Style Comment
Margin Dynamic
LatexType Environment
LatexName comment
NextNoIndent 1
LeftMargin MMM
RightMargin MMM
Align Block
AlignPossible Block, Left, Right, Center
LabelType Static
LabelSep :x
Labelstring "Comment:"
LabelFont
Shape Italic
Series Bold
Color black
EndFont
TextFont
Color magenta
Shape Italic
EndFont
Preamble
\usepackage{verbatim}
EndPreamble
End
# Address style definition
Style Address
Margin Static

View File

@ -14,3 +14,7 @@ End
Style LaTeX
ObsoletedBy Standard
End
Style Comment
ObsoletedBy Standard
End

View File

@ -341,33 +341,6 @@ Style Invoice
LabelString "Invoice no.:"
End
# Comment style definition
Style Comment
Margin Dynamic
LatexType Environment
LatexName comment
NextNoIndent 1
LeftMargin MMM
RightMargin MMM
Align Block
AlignPossible Block, Left, Right, Center
LabelType Static
LabelSep :x
Labelstring "Comment:"
### Finally a few obsolete definitions for compatibility
Input obsolete.inc
LabelFont
Shape Italic
Series Bold
Color black
EndFont
TextFont
Color magenta
Shape Italic
EndFont
Preamble
\usepackage{verbatim}
EndPreamble
End

View File

@ -17,7 +17,7 @@
import string
import re
from parser_tools import find_token
from parser_tools import find_token, find_end_of
def convert_external(lines):
external_rexp = re.compile(r'\\begin_inset External ([^,]*),"([^"]*)",')
@ -53,8 +53,74 @@ def convert_external(lines):
lines[i:i+1] = [top, template]
i = i + 1
def convert_comment(lines):
i = 0
comment = "\\layout Comment"
while 1:
i = find_token(lines, comment, i)
if i == -1:
return
lines[i:i+1] = ["\\layout Standard","","",
"\\begin_inset Comment",
"collapsed true","",
"\\layout Standard"]
i = i + 7
while 1:
old_i = i
i = find_token(lines, "\\layout", i)
if i == -1:
i = len(lines) - 1
lines[i:i] = ["\\end_inset ","",""]
return
j = find_token(lines, '\\begin_deeper', old_i, i)
if j == -1: j = i + 1
k = find_token(lines, '\\begin_inset', old_i, i)
if k == -1: k = i + 1
if j < i and j < k:
i = j
del lines[i]
i = find_end_of( lines, i, "\\begin_deeper","\\end_deeper")
if i == -1:
#This case should not happen
#but if this happens deal with it greacefully adding
#the missing \end_deeper.
i = len(lines) - 1
lines[i:i] = ["\end_deeper","","","\\end_inset ","",""]
return
else:
del lines[i]
continue
if k < i:
i = k
i = find_end_of( lines, i, "\\begin_inset","\\end_inset")
if i == -1:
#This case should not happen
#but if this happens deal with it greacefully adding
#the missing \end_inset.
i = len(lines) - 1
lines[i:i] = ["\\end_inset ","","","\\end_inset ","",""]
return
else:
i = i + 1
continue
if string.find(lines[i], comment) == -1:
lines[i:i] = ["\\end_inset"]
i = i + 1
break
lines[i:i+1] = ["\\layout Standard"]
i = i + 1
def convert(header, body):
convert_external(body)
convert_comment(body)
if __name__ == "__main__":
pass