* Whitespace.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25259
a592a061-630c-0410-9148-
cb99ea01b6c8
" Convert 'display foo' to 'display false/true'"
i = 0
while True:
" Convert 'display foo' to 'display false/true'"
i = 0
while True:
- i = find_token(document.body, "display", i)
+ i = find_token(document.body, "\tdisplay", i)
- if check_token(i, "none"):
+ val = get_value(document.body, 'display', i)
+ if val == "none":
document.body[i] = document.body[i].replace('none', 'false')
document.body[i] = document.body[i].replace('none', 'false')
- if check_token(i, "default"):
document.body[i] = document.body[i].replace('default', 'true')
document.body[i] = document.body[i].replace('default', 'true')
- if check_token(i, "monochrome"):
+ if val == "monochrome":
document.body[i] = document.body[i].replace('monochrome', 'true')
document.body[i] = document.body[i].replace('monochrome', 'true')
- if check_token(i, "grayscale"):
document.body[i] = document.body[i].replace('grayscale', 'true')
document.body[i] = document.body[i].replace('grayscale', 'true')
- if check_token(i, "color"):
document.body[i] = document.body[i].replace('color', 'true')
document.body[i] = document.body[i].replace('color', 'true')
- if check_token(i, "preview"):
document.body[i] = document.body[i].replace('preview', 'true')
document.body[i] = document.body[i].replace('preview', 'true')
def revert_display_enum(document):
" Revert 'display false/true' to 'display none/color'"
i = 0
while True:
def revert_display_enum(document):
" Revert 'display false/true' to 'display none/color'"
i = 0
while True:
- i = find_token(document.body, "display", i)
+ i = find_token(document.body, "\tdisplay", i)
- if check_token(i, "false"):
+ val = get_value(document.body, 'display', i)
+ if val == "false":
document.body[i] = document.body[i].replace('false', 'none')
document.body[i] = document.body[i].replace('false', 'none')
- if check_token(i, "true"):
document.body[i] = document.body[i].replace('true', 'default')
document.body[i] = document.body[i].replace('true', 'default')
def remove_fontsCJK(document):
def remove_fontsCJK(document):
def convert_plain_layout(document):
def convert_plain_layout(document):
- " Convert 'PlainLayout' to 'Plain Layout'"
- i = 0
- while True:
- i = find_token(document.body, '\\begin_layout PlainLayout', i)
- if i == -1:
- return
- document.body[i] = document.body[i].replace('\\begin_layout PlainLayout', \
- '\\begin_layout Plain Layout')
- i += 1
+ " Convert 'PlainLayout' to 'Plain Layout'"
+ i = 0
+ while True:
+ i = find_token(document.body, '\\begin_layout PlainLayout', i)
+ if i == -1:
+ return
+ document.body[i] = document.body[i].replace('\\begin_layout PlainLayout', \
+ '\\begin_layout Plain Layout')
+ i += 1
def revert_plain_layout(document):
def revert_plain_layout(document):
- " Convert 'PlainLayout' to 'Plain Layout'"
- i = 0
- while True:
- i = find_token(document.body, '\\begin_layout Plain Layout', i)
- if i == -1:
- return
- document.body[i] = document.body[i].replace('\\begin_layout Plain Layout', \
- '\\begin_layout PlainLayout')
- i += 1
+ " Convert 'PlainLayout' to 'Plain Layout'"
+ i = 0
+ while True:
+ i = find_token(document.body, '\\begin_layout Plain Layout', i)
+ if i == -1:
+ return
+ document.body[i] = document.body[i].replace('\\begin_layout Plain Layout', \
+ '\\begin_layout PlainLayout')
+ i += 1
+
def revert_plainlayout(document):
def revert_plainlayout(document):
- " Convert 'PlainLayout' to 'Plain Layout'"
- i = 0
- while True:
- i = find_token(document.body, '\\begin_layout PlainLayout', i)
- if i == -1:
- return
- # This will be incorrect for some document classes, since Standard is not always
- # the default. But (a) it is probably the best we can do and (b) it will actually
- # work, in fact, since an unknown layout will be converted to default.
- document.body[i] = document.body[i].replace('\\begin_layout PlainLayout', \
- '\\begin_layout Standard')
- i += 1
+ " Convert 'PlainLayout' to 'Plain Layout'"
+ i = 0
+ while True:
+ i = find_token(document.body, '\\begin_layout PlainLayout', i)
+ if i == -1:
+ return
+ # This will be incorrect for some document classes, since Standard is not always
+ # the default. But (a) it is probably the best we can do and (b) it will actually
+ # work, in fact, since an unknown layout will be converted to default.
+ document.body[i] = document.body[i].replace('\\begin_layout PlainLayout', \
+ '\\begin_layout Standard')
+ i += 1