Hello! Another minor issue (i did not find a bugzilla entry):
If you select text and insert a float then all three paragraphs that are created are filled with the text and in the middle paragraph the caption inset is displayed left of the text. With this patch the above and below paragraph are left empty whereas the selected text is pasted into the caption inset.
Another thing i would find nice: when i insert a figure or a table into a float i always use centered alignment for that paragraph, because i think it should be centered above or below the caption. Maybe, if we insert blank paragraphs to ease the insertion of the float content, we should set the alignment of these paragraphs to centered
Bernhard
Index: text3.C =================================================================== --- text3.C (revision 17095) +++ text3.C (working copy) @@ -1210,7 +1210,13 @@ case LFUN_FLOAT_INSERT: case LFUN_FLOAT_WIDE_INSERT: case LFUN_WRAP_INSERT: { - doInsertInset(cur, this, cmd, true, true); + bool gotsel = false; + if (cur.selection()) { + lyx::dispatch(FuncRequest(LFUN_CUT)); + gotsel = true; + } + + doInsertInset(cur, this, cmd, true, false); cur.posRight(); ParagraphList & pars = cur.text()->paragraphs(); // We create two additional empty paragraphs so that the @@ -1222,6 +1228,10 @@ cur.pit() = 1; cur.pos() = 0; cur.dispatch(FuncRequest(LFUN_CAPTION_INSERT)); + + if (gotsel) { + lyx::dispatch(FuncRequest(LFUN_PASTE, "0")); + } // FIXME: When leaving the Float (or Wrap) inset we should // delete any empty paragraph left above or below the // caption.