X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FText2.cpp;h=4a0c1dd3eb27b9b7393d0f4d6e75e6fd77ad2c15;hb=d145c2dc9f27666ca0ed9f8589f99f502d7b2a4d;hp=dba04960533e0ee8a669c1028643b1734952a59e;hpb=63897c2959b77b33edade692f41a16a599c0f7bf;p=lyx.git diff --git a/src/Text2.cpp b/src/Text2.cpp index dba0496053..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;