]> git.lyx.org Git - features.git/commitdiff
fix display of label when inserting a new float
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 14 Apr 2005 10:19:39 +0000 (10:19 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 14 Apr 2005 10:19:39 +0000 (10:19 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9814 a592a061-630c-0410-9148-cb99ea01b6c8

src/ChangeLog
src/insets/ChangeLog
src/insets/insetfloat.C
src/insets/insetwrap.C
src/text3.C

index 62176aace1353c4d255ca91632268ab4e8341db1..bb11f797738e97a8e7e21ae89b53ac92d905364a 100644 (file)
@@ -1,3 +1,8 @@
+2005-04-11  Jean-Marc Lasgouttes  <lasgouttes@lyx.org>
+
+       * text3.C (dispatch): change the layout to "Caption" after inserting
+       a float.
+
 2005-04-12  Martin Vermeer  <martin.vermeer@hut.fi>
 
        * text3.C (dispatch): fix language problem in newly created
index e1a869118b6f7133f6311b7b031382db8a5d350d..e4dc3173bccd266e80c7fecd4ba9cec3bc4db948 100644 (file)
@@ -1,3 +1,8 @@
+2005-04-11  Jean-Marc Lasgouttes  <lasgouttes@lyx.org>
+
+       * insetfloat.C (InsetFloat): 
+       * insetwrap.C (InsetWrap): do not set layout here.
+
 2005-04-13  Georg Baum  <Georg.Baum@post.rwth-aachen.de>
 
        * insetbase.C (getStatus): handle LFUN_INSET_MODIFY and
index b43c4a121c35f32eb467d4b19e6dfc137bf874cc..cb5a2896a790151f08ad1f73df60aeb8760a50cd 100644 (file)
@@ -142,9 +142,6 @@ InsetFloat::InsetFloat(BufferParams const & bp, string const & type)
        setLabelFont(font);
        params_.type = type;
        setInsetName(type);
-       LyXTextClass const & tclass = bp.getLyXTextClass();
-       if (tclass.hasLayout(caplayout))
-               paragraphs().begin()->layout(tclass[caplayout]);
 }
 
 
index c9b958f8d4aa449f3efafe66eab5e1100fc37273..29696e01dc6b0cdf26301d7a6802c8b9ec8f93a3 100644 (file)
@@ -68,9 +68,6 @@ InsetWrap::InsetWrap(BufferParams const & bp, string const & type)
        params_.type = type;
        params_.width = LyXLength(50, LyXLength::PCW);
        setInsetName(type);
-       LyXTextClass const & tclass = bp.getLyXTextClass();
-       if (tclass.hasLayout(caplayout))
-               paragraphs().begin()->layout(tclass[caplayout]);
 }
 
 
index 9bc9ba0529cf964e8a3ace080f616e41f9908ca0..aff6aeb9bf1910cb15730780367792ae4467be5f 100644 (file)
@@ -1174,12 +1174,9 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd)
        case LFUN_INSERT_BRANCH:
        case LFUN_INSERT_BIBITEM:
        case LFUN_INSET_ERT:
-       case LFUN_INSET_FLOAT:
        case LFUN_INSET_FOOTNOTE:
        case LFUN_INSET_MARGINAL:
        case LFUN_INSET_OPTARG:
-       case LFUN_INSET_WIDE_FLOAT:
-       case LFUN_INSET_WRAP:
        case LFUN_TABULAR_INSERT:
        case LFUN_ENVIRONMENT_INSERT:
                // Open the inset, and move the current selection
@@ -1188,6 +1185,16 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd)
                cur.posRight();
                break;
 
+       case LFUN_INSET_FLOAT:
+       case LFUN_INSET_WIDE_FLOAT: 
+       case LFUN_INSET_WRAP:
+               doInsertInset(cur, this, cmd, true, true);
+               cur.posRight();
+               // FIXME: the "Caption" name should not be hardcoded,
+               // but given by the float definition.
+               cur.dispatch(FuncRequest(LFUN_LAYOUT, "Caption"));
+               break;
+
        case LFUN_INDEX_INSERT:
                // Just open the inset
                doInsertInset(cur, this, cmd, true, false);