From: Jean-Marc Lasgouttes Date: Thu, 14 Apr 2005 10:19:39 +0000 (+0000) Subject: fix display of label when inserting a new float X-Git-Tag: 1.6.10~14398 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=27a238c271030f9c29b05c5aa382e9d7ba623e28;p=features.git fix display of label when inserting a new float git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9814 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/ChangeLog b/src/ChangeLog index 62176aace1..bb11f79773 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2005-04-11 Jean-Marc Lasgouttes + + * text3.C (dispatch): change the layout to "Caption" after inserting + a float. + 2005-04-12 Martin Vermeer * text3.C (dispatch): fix language problem in newly created diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index e1a869118b..e4dc3173bc 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,3 +1,8 @@ +2005-04-11 Jean-Marc Lasgouttes + + * insetfloat.C (InsetFloat): + * insetwrap.C (InsetWrap): do not set layout here. + 2005-04-13 Georg Baum * insetbase.C (getStatus): handle LFUN_INSET_MODIFY and diff --git a/src/insets/insetfloat.C b/src/insets/insetfloat.C index b43c4a121c..cb5a2896a7 100644 --- a/src/insets/insetfloat.C +++ b/src/insets/insetfloat.C @@ -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]); } diff --git a/src/insets/insetwrap.C b/src/insets/insetwrap.C index c9b958f8d4..29696e01dc 100644 --- a/src/insets/insetwrap.C +++ b/src/insets/insetwrap.C @@ -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]); } diff --git a/src/text3.C b/src/text3.C index 9bc9ba0529..aff6aeb9bf 100644 --- a/src/text3.C +++ b/src/text3.C @@ -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);