diff --git a/development/FORMAT b/development/FORMAT index 727ee191ed..ac2c10b604 100644 --- a/development/FORMAT +++ b/development/FORMAT @@ -1,6 +1,12 @@ LyX file-format changes ----------------------- +2007-10-03 Uwe Stöhr Uwe Stöhr + * Format incremented to 291: Add table wrap floats. + +2007-10-03 Martin Vermeer + * Format incremented to 290: ?? + 2007-09-25 Richard Heck * Format incremented to 288: Change how command insets are represented in LyX files. diff --git a/lib/lyx2lyx/LyX.py b/lib/lyx2lyx/LyX.py index a500167d9d..97b3f19823 100644 --- a/lib/lyx2lyx/LyX.py +++ b/lib/lyx2lyx/LyX.py @@ -80,7 +80,7 @@ format_relation = [("0_06", [200], minor_versions("0.6" , 4)), ("1_3", [221], minor_versions("1.3" , 7)), ("1_4", range(222,246), minor_versions("1.4" , 5)), ("1_5", range(246,277), minor_versions("1.5" , 1)), - ("1_6", range(277,290), minor_versions("1.6" , 0))] #MV, index collapsable + ("1_6", range(277,291), minor_versions("1.6" , 0))] # Uwe Stöhr, wrap table def formats_list(): diff --git a/lib/lyx2lyx/lyx_1_6.py b/lib/lyx2lyx/lyx_1_6.py index 9050a1012d..7936fcfdb7 100644 --- a/lib/lyx2lyx/lyx_1_6.py +++ b/lib/lyx2lyx/lyx_1_6.py @@ -394,6 +394,17 @@ def revert_latexcommand_index(document): +def revert_wraptable(document): + "Revert wrap table to wrap figure." + i = 0 + while True: + i = find_token(document.body, "\\begin_inset Wrap table", i) + if i == -1: + return + document.body[i] = document.body[i].replace('\\begin_inset Wrap table', '\\begin_inset Wrap figure') + i = i + 1 + + ## # Conversion hub # @@ -412,9 +423,10 @@ convert = [[277, [fix_wrong_tables]], [287, [convert_wrapfig_options]], [288, [convert_inset_command]], [289, [convert_latexcommand_index]] + [290, []] ] -revert = [ +revert = [[289, [revert_wraptable]], [288, [revert_latexcommand_index]], [287, [revert_inset_command]], [286, [revert_wrapfig_options]], diff --git a/lib/ui/stdmenus.inc b/lib/ui/stdmenus.inc index d74771b4af..d7878321bf 100644 --- a/lib/ui/stdmenus.inc +++ b/lib/ui/stdmenus.inc @@ -374,7 +374,8 @@ Menuset Menu "insert_float" FloatInsert # This has got to be better than "Wrap", anyway - Item "Text Wrap Float|W" "wrap-insert figure" + Item "Figure Wrap Float|F" "wrap-insert figure" + Item "Table Wrap Float|T" "wrap-insert table" End Menu "insert_toc" diff --git a/src/Buffer.cpp b/src/Buffer.cpp index f540360f2f..5218e84639 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -151,7 +151,7 @@ namespace fs = boost::filesystem; namespace { -int const LYX_FORMAT = 289; //MV, index collapsable +int const LYX_FORMAT = 290; //Uwe Stöhr, wrap table } // namespace anon diff --git a/src/factory.cpp b/src/factory.cpp index e332a0b7d2..faa386251c 100644 --- a/src/factory.cpp +++ b/src/factory.cpp @@ -171,7 +171,7 @@ Inset * createInset(BufferView * bv, FuncRequest const & cmd) case LFUN_WRAP_INSERT: { string const argument = to_utf8(cmd.argument()); - if (argument == "figure") + if (argument == "figure" || argument == "table") return new InsetWrap(params, argument); lyxerr << "Non-existent wrapfig type: " << argument << endl; return 0;