On Mon, Aug 19, 2002 at 01:59:35PM +0200, Jean-Marc Lasgouttes wrote:
> 
> Finally, LFUN_INSET_SHORTTITLE should be disabled when it does not mke
> sense.

Good ideas welcome. It isn't *that* simple...

Like this:


Index: BufferView_pimpl.C
===================================================================
RCS file: /cvs/lyx/lyx-devel/src/BufferView_pimpl.C,v
retrieving revision 1.283
diff -u -p -r1.283 BufferView_pimpl.C
--- BufferView_pimpl.C  2002/08/18 17:15:23     1.283
+++ BufferView_pimpl.C  2002/08/19 12:46:01
@@ -1498,6 +1497,9 @@ bool BufferView::Pimpl::dispatch(FuncReq
 
        LyXTextClass const & tclass = buffer_->params.getLyXTextClass();
 
+       LyXText * lt = bv_->getLyXText();
+       LyXLayout_ptr const & style = lt->cursor.par()->layout();
+
        switch (ev.action) {
                // --- Misc -------------------------------------------
        case LFUN_APPENDIX:
@@ -2760,6 +2765,12 @@ bool BufferView::Pimpl::dispatch(FuncReq
 
        case LFUN_INSERT_NOTE:
                insertAndEditInset(new InsetNote(buffer_->params));
+               break;
+
+       case LFUN_INSET_SHORTTITLE:
+
+               if (style->latexparam() == "void")
+                       insertAndEditInset(new InsetShortTitle(buffer_->params));
                break;
 
        case LFUN_INSET_FLOAT:


Works, but you can still change a Section layout to Standard without
losing the inset...

 
> JMarc
> 

Martin

Attachment: msg43103/pgp00000.pgp
Description: PGP signature

Reply via email to