X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FText2.cpp;h=4a0c1dd3eb27b9b7393d0f4d6e75e6fd77ad2c15;hb=d145c2dc9f27666ca0ed9f8589f99f502d7b2a4d;hp=1e2a88df5c0117ad70cedccc4914166e2bbc1d94;hpb=ffda0d89b444a6f7814df8db3f311e2a42edda9d;p=lyx.git diff --git a/src/Text2.cpp b/src/Text2.cpp index 1e2a88df5c..4a0c1dd3eb 100644 --- a/src/Text2.cpp +++ b/src/Text2.cpp @@ -46,8 +46,6 @@ #include "TextMetrics.h" #include "VSpace.h" -#include "insets/InsetEnvironment.h" - #include "mathed/InsetMathHull.h" #include "support/lassert.h" @@ -216,22 +214,6 @@ void Text::setLayout(Buffer const & buffer, pit_type start, pit_type end, void Text::setLayout(Cursor & cur, docstring const & layout) { LASSERT(this == cur.text(), /**/); - // special handling of new environment insets - BufferView & bv = cur.bv(); - BufferParams const & params = bv.buffer().params(); - Layout const & lyxlayout = params.documentClass()[layout]; - if (lyxlayout.is_environment) { - // move everything in a new environment inset - LYXERR(Debug::DEBUG, "setting layout " << to_utf8(layout)); - lyx::dispatch(FuncRequest(LFUN_LINE_BEGIN)); - lyx::dispatch(FuncRequest(LFUN_LINE_END_SELECT)); - lyx::dispatch(FuncRequest(LFUN_CUT)); - Inset * inset = new InsetEnvironment(bv.buffer(), layout); - insertInset(cur, inset); - //inset->edit(cur, true); - //lyx::dispatch(FuncRequest(LFUN_PASTE)); - return; - } pit_type start = cur.selBegin().pit(); pit_type end = cur.selEnd().pit() + 1; @@ -386,8 +368,7 @@ void Text::toggleFree(Cursor & cur, Font const & font, bool toggleall) { LASSERT(this == cur.text(), /**/); // If the mask is completely neutral, tell user - if (font.fontInfo() == ignore_font && - (font.language() == 0 || font.language() == ignore_language)) { + if (font.fontInfo() == ignore_font && font.language() == ignore_language) { // Could only happen with user style cur.message(_("No font change defined.")); return;