diff --git a/development/FORMAT b/development/FORMAT index 53c1135838..c253117c72 100644 --- a/development/FORMAT +++ b/development/FORMAT @@ -1,6 +1,9 @@ LyX file-format changes ----------------------- +2008-05-30 Richard Heck + * Format incremented to 335: fixes for InsetSpace problems. + 2008-05-16 Uwe Stöhr * Format incremented to 334: fix for bug 4868. diff --git a/lib/lyx2lyx/lyx_1_6.py b/lib/lyx2lyx/lyx_1_6.py index 41e6b6b8d7..2078ff5866 100644 --- a/lib/lyx2lyx/lyx_1_6.py +++ b/lib/lyx2lyx/lyx_1_6.py @@ -2280,6 +2280,26 @@ def revert_paper_sizes(document): document.header[j] = "\\papersize executivepaper" +def convert_InsetSpace(document): + " Convert '\\begin_inset Space foo' to '\\begin_inset space foo'" + i = 0 + while True: + i = find_token(document.body, "\\begin_inset Space", i) + if i == -1: + return + document.body[i] = document.body[i].replace('\\begin_inset Space', '\\begin_inset space') + + +def revert_InsetSpace(document): + " Revert '\\begin_inset space foo' to '\\begin_inset Space foo'" + i = 0 + while True: + i = find_token(document.body, "\\begin_inset space", i) + if i == -1: + return + document.body[i] = document.body[i].replace('\\begin_inset space', '\\begin_inset Space') + + ## # Conversion hub # @@ -2343,9 +2363,11 @@ convert = [[277, [fix_wrong_tables]], [332, []], [333, [update_apa_styles]], [334, [convert_paper_sizes]], + [335, [convert_InsetSpace]], ] -revert = [[333, [revert_paper_sizes]], +revert = [[334, [revert_InsetSpace]], + [333, [revert_paper_sizes]], [332, []], [331, [revert_graphics_group]], [330, [revert_ltcaption]], diff --git a/src/Buffer.cpp b/src/Buffer.cpp index 110923a416..afe016b70c 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -115,7 +115,7 @@ namespace os = support::os; namespace { -int const LYX_FORMAT = 334; +int const LYX_FORMAT = 335; typedef map DepClean; typedef map > RefCache; diff --git a/src/factory.cpp b/src/factory.cpp index c49da69310..2646a3c6ca 100644 --- a/src/factory.cpp +++ b/src/factory.cpp @@ -528,7 +528,7 @@ Inset * readInset(Lexer & lex, Buffer const & buf) inset.reset(new InsetERT(buf)); } else if (tmptok == "listings") { inset.reset(new InsetListings(buf)); - } else if (tmptok == "Space") { + } else if (tmptok == "space") { inset.reset(new InsetSpace); } else if (tmptok == "Tabular") { inset.reset(new InsetTabular(buf)); diff --git a/src/insets/InsetSpace.cpp b/src/insets/InsetSpace.cpp index c8b2c9c959..c9156d4e51 100644 --- a/src/insets/InsetSpace.cpp +++ b/src/insets/InsetSpace.cpp @@ -446,7 +446,7 @@ void InsetSpaceParams::read(Lexer & lex) void InsetSpace::write(ostream & os) const { - os << "Space "; + os << "space "; params_.write(os); }