- text()->setCursor(buffer()->getParFromID(tmpid).pit(), tmppos);
-}
-
-
-void BufferView::insertInset(InsetBase * inset, string const & lout)
-{
- // not quite sure if we want this...
- text()->recUndo(text()->cursor().par());
- freezeUndo();
-
- cursor().clearSelection();
- if (!lout.empty()) {
- text()->breakParagraph(buffer()->paragraphs());
-
- if (!text()->cursorPar()->empty()) {
- text()->cursorLeft(true);
- text()->breakParagraph(buffer()->paragraphs());
- }
-
- string lres = lout;
- LyXTextClass const & tclass = buffer()->params().getLyXTextClass();
- bool hasLayout = tclass.hasLayout(lres);
-
- text()->setLayout(hasLayout ? lres : tclass.defaultLayoutName());
- text()->setParagraph(Spacing(), LYX_ALIGN_LAYOUT, string(), 0);
- }
- cursor().innerText()->insertInset(inset);
- unFreezeUndo();