X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Flyx_cb.C;h=6548ea1edb4e9b619eb375f0e5a1e4a71e7369b6;hb=1bb197b5d4821404cfe11509c71d1f8de7cee711;hp=acd2dc171b61fdc03abe9b4c2e8ddf83204c5237;hpb=8283e978f8d621041c432b9b88a476bfd567385c;p=lyx.git diff --git a/src/lyx_cb.C b/src/lyx_cb.C index acd2dc171b..6548ea1edb 100644 --- a/src/lyx_cb.C +++ b/src/lyx_cb.C @@ -17,7 +17,7 @@ #include "bufferview_funcs.h" #include "debug.h" #include "lastfiles.h" -#include "LyXView.h" +#include "frontends/LyXView.h" #include "lyxrc.h" #include "lyxtext.h" #include "gettext.h" @@ -28,7 +28,6 @@ #include "frontends/Alert.h" #include "frontends/FileDialog.h" -#include "frontends/GUIRunTime.h" #include "support/FileInfo.h" #include "support/filetools.h" @@ -81,9 +80,6 @@ void ShowMessage(Buffer const * buf, // should be moved to lyxfunc.C bool MenuWrite(BufferView * bv, Buffer * buffer) { - // FIXME: needed ? - XFlush(GUIRunTime::x11Display()); - if (!buffer->save()) { if (Alert::askQuestion(_("Save failed. Rename and try again?"), MakeDisplayPath(buffer->fileName(), 50), @@ -437,13 +433,12 @@ void MenuInsertLabel(BufferView * bv, string const & arg) bv->owner()->prohibitInput(); if (label.empty()) { Paragraph * par = bv->getLyXText()->cursor.par(); - LyXTextClass const & tclass = - textclasslist[bv->buffer()->params.textclass]; - LyXLayout const * layout = &tclass[par->layout()]; - + LyXLayout_ptr layout = par->layout(); if (layout->latextype == LATEX_PARAGRAPH && par->previous()) { Paragraph * par2 = par->previous(); - LyXLayout const * layout2 = &tclass[par2->layout()]; + + LyXLayout_ptr const & layout2 = par2->layout(); + if (layout2->latextype != LATEX_PARAGRAPH) { par = par2; layout = layout2;