-#ifdef MOVE_TEXT
-// candidate for move to BufferView
-void Buffer::insertInset(Inset * inset, string const & lout,
- bool no_table)
-{
- // check for table/list in tables
- if (no_table && users->text->cursor.par->table){
- WriteAlert(_("Impossible Operation!"),
- _("Cannot insert table/list in table."),
- _("Sorry."));
- return;
- }
- // not quite sure if we want this...
- users->text->SetCursorParUndo();
- users->text->FreezeUndo();
-
- BeforeChange();
- if (!lout.empty()) {
- users->update(-2);
- users->text->BreakParagraph();
- users->update(-1);
-
- if (users->text->cursor.par->Last()) {
- users->text->CursorLeft();
-
- users->text->BreakParagraph();
- users->update(-1);
- }
-
- int lay = textclasslist.NumberOfLayout(params.textclass,
- lout).second;
- if (lay == -1) // layout not found
- // use default layout "Standard" (0)
- lay = 0;
-
- users->text->SetLayout(lay);
-
- users->text->SetParagraph(0, 0,
- 0, 0,
- VSpace(VSpace::NONE), VSpace(VSpace::NONE),
- LYX_ALIGN_LAYOUT,
- string(),
- 0);
- users->update(-1);
-
- users->text->current_font.setLatex(LyXFont::OFF);
- }
-
- users->text->InsertInset(inset);
- users->update(-1);