Abdelrazak Younes wrote:
Jürgen Spitzmüller wrote:
[EMAIL PROTECTED] wrote:
The caption inset patch by Georg, Martin and myself.

Looks nice. I have two problems, though:

1. How do I add a paragraph break _before_ the caption, in order to place a figure above it?

You need to go out of the caption first with the left arrow key and then press 'Enter'. Maybe we need to put two empty paragraphs before and after the caption.

I've done that. Hope you'll like it.


and run the new DEPM from Michael when the cursor goes out of the float.

This remains to be done.

Abdel.


Author: younes
Date: Thu Feb  1 10:22:03 2007
New Revision: 16999

URL: http://www.lyx.org/trac/changeset/16999
Log:
Add empty paragraphs before and after the caption inset upon float (or wrap) inset creation.

Hopefully fix bug 675:

http://bugzilla.lyx.org/show_bug.cgi?id=675

Modified:
    lyx-devel/trunk/src/text3.C

Modified: lyx-devel/trunk/src/text3.C
URL: http://www.lyx.org/trac/file/lyx-devel/trunk/src/text3.C?rev=16999
==============================================================================
--- lyx-devel/trunk/src/text3.C (original)
+++ lyx-devel/trunk/src/text3.C Thu Feb  1 10:22:03 2007
@@ -1134,9 +1134,6 @@
                doInsertInset(cur, this, cmd, true, true);
                cur.posRight();
                updateLabels(*bv->buffer());
-               // FIXME: We should insert two empty paragraphs before and
-               // after the caption so that the user can go up or down in
-               // order to insert a figure or a table.
                break;
        case LFUN_NOTE_INSERT:
        case LFUN_CHARSTYLE_INSERT:
@@ -1165,11 +1162,24 @@

        case LFUN_FLOAT_INSERT:
        case LFUN_FLOAT_WIDE_INSERT:
-       case LFUN_WRAP_INSERT:
+       case LFUN_WRAP_INSERT: {
                doInsertInset(cur, this, cmd, true, true);
                cur.posRight();
+               ParagraphList & pars = cur.text()->paragraphs();
+               // We create two additional empty paragraphs so that the
+               // user can choose where to put the graphics (or table).
+               pars.push_back(pars[0]);
+               pars.push_back(pars[0]);
+               // Now that we have three paragraphs, we reposition the cursor
+               // at the beginning of the second one.
+               cur.pit() = 1;
+               cur.pos() = 0;
                cur.dispatch(FuncRequest(LFUN_CAPTION_INSERT));
-               break;
+               // FIXME: When leaving the Float (or Wrap) inset we should
+               // any empty paragraph left above or below the
+               // caption.
+               break;
+       }

        case LFUN_INDEX_INSERT:
        case LFUN_NOMENCL_INSERT: {



Reply via email to