New file format for InsetPreview introduced in r38890.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33891 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Vincent van Ravesteijn 2010-03-28 14:52:47 +00:00
parent bb69584112
commit a4ec2fc8fe
2 changed files with 32 additions and 3 deletions

View File

@ -1237,6 +1237,33 @@ def revert_math_output(document):
document.header[i] = "\\html_use_mathml " + newval
def revert_inset_preview(document):
" Dissolves the preview inset "
i = 0
j = 0
k = 0
while True:
i = find_token(document.body, "\\begin_inset Preview", i)
if i == -1:
return
j = find_end_of_inset(document.body, i)
if j == -1:
document.warning("Malformed LyX document: Could not find end of Preview inset.")
return
#If the layout is Standard we need to remove it, otherwise there
#will be paragraph breaks that shouldn't be there.
k = find_token(document.body, "\\begin_layout Standard", i)
if k == i+2:
del document.body[i : i+3]
del document.body[j-5 : j-2]
i -= 6
else:
del document.body[i]
del document.body[j-1]
i -= 2
##
# Conversion hub
#
@ -1275,10 +1302,12 @@ convert = [[346, []],
[376, []],
[377, []],
[378, []],
[379, [convert_math_output]]
[379, [convert_math_output]],
[380, []]
]
revert = [[378, [revert_math_output]],
revert = [[379, [revert_inset_preview]],
[378, [revert_math_output]],
[377, []],
[376, [revert_multirow]],
[375, [revert_includeall]],

View File

@ -126,7 +126,7 @@ namespace {
// Do not remove the comment below, so we get merge conflict in
// independent branches. Instead add your own.
int const LYX_FORMAT = 379; // rgh: xhtml math output type
int const LYX_FORMAT = 380; // vfr: introduction of insetpreview
typedef map<string, bool> DepClean;
typedef map<docstring, pair<InsetLabel const *, Buffer::References> > RefCache;