- bool first_footnote_par_is_not_empty = tmppar->next->size();
-
- while (tmppar->next
- && tmppar->next->footnoteflag == LyXParagraph::OPEN_FOOTNOTE) {
- tmppar = tmppar->next; /* I use next instead of Next(),
- * because there cannot be any
- * footnotes in a footnote
- * environment */
- tmppar->footnoteflag = LyXParagraph::NO_FOOTNOTE;
-
- /* remember the captions and empty paragraphs */
- if ((textclasslist.Style(bview->buffer()->params.textclass,
- tmppar->GetLayout())
- .labeltype == LABEL_SENSITIVE)
- || !tmppar->Last())
- tmppar->SetLayout(bview->buffer()->params, 0);
- }
-
- // now we will paste the ex-footnote, if the layouts allow it
- // first restore the layout of the paragraph right behind
- // the footnote
- if (tmppar->next)
- tmppar->next->MakeSameLayout(cursor.par());
-
- // first the end
- if ((!tmppar->GetLayout() && !tmppar->table)
- || (tmppar->Next()
- && (!tmppar->Next()->Last()
- || tmppar->Next()->HasSameLayout(tmppar)))) {
- if (tmppar->Next()->Last()
- && tmppar->Next()->IsLineSeparator(0))
- tmppar->Next()->Erase(0);
- tmppar->PasteParagraph(bview->buffer()->params);
- }
-
- tmppar = tmppar->Next(); /* make sure tmppar cannot be touched
- * by the pasting of the beginning */
-
- /* then the beginning */
- /* if there is no space between the text and the footnote, so we insert
- * a blank
- * (only if the previous par and the footnotepar are not empty!) */
- if ((!firsttmppar->next->GetLayout() && !firsttmppar->next->table)
- || firsttmppar->HasSameLayout(firsttmppar->next)) {
- if (firsttmppar->size()
- && !firsttmppar->IsSeparator(firsttmppar->size() - 1)
- && first_footnote_par_is_not_empty) {
- firsttmppar->next->InsertChar(0, ' ');
- }
- firsttmppar->PasteParagraph(bview->buffer()->params);
- }
-
- /* now redo the paragaphs */
- RedoParagraphs(bview, cursor, tmppar);
-
- SetCursor(bview, cursor.par(), cursor.pos());
-
- /* sometimes it can happen, that there is a counter change */
- Row * row = cursor.row();
- while (row->next() && row->par() != tmppar && row->next()->par() != tmppar)
- row = row->next();
- UpdateCounters(bview, row);
-
-
- ClearSelection();
-}
-#endif
-
-
-/* the DTP switches for paragraphs. LyX will store them in the
-* first physicla paragraph. When a paragraph is broken, the top settings
-* rest, the bottom settings are given to the new one. So I can make shure,
-* they do not duplicate themself and you cannnot make dirty things with
-* them! */
-
-void LyXText::SetParagraph(BufferView * bview,