- bview->updateInset(inset_owner, true);
-}
-
-
-void LyXText::SetParagraphExtraOpt(BufferView * bview, int type,
- char const * width,
- char const * widthp,
- int alignment, bool hfill,
- bool start_minipage)
-{
- LyXCursor tmpcursor = cursor;
- LyXParagraph * tmppar;
- if (!selection) {
- sel_start_cursor = cursor;
- sel_end_cursor = cursor;
- }
-
- // make sure that the depth behind the selection are restored, too
-#ifndef NEW_INSETS
- LyXParagraph * endpar = sel_end_cursor.par()->LastPhysicalPar()->Next();
-#else
- LyXParagraph * endpar = sel_end_cursor.par()->Next();
-#endif
- LyXParagraph * undoendpar = endpar;
-
- if (endpar && endpar->GetDepth()) {
- while (endpar && endpar->GetDepth()) {
-#ifndef NEW_INSETS
- endpar = endpar->LastPhysicalPar()->Next();
-#else
- endpar = endpar->Next();
-#endif
- undoendpar = endpar;
- }
- }
- else if (endpar) {
- endpar = endpar->Next(); // because of parindents etc.
- }
-
- SetUndo(bview->buffer(), Undo::EDIT,
-#ifndef NEW_INSETS
- sel_start_cursor
- .par()->ParFromPos(sel_start_cursor.pos())->previous,
-#else
- sel_start_cursor.par()->previous,
-#endif
- undoendpar);
-
- tmppar = sel_end_cursor.par();
-#ifndef NEW_INSETS
- while(tmppar != sel_start_cursor.par()->FirstPhysicalPar()->Previous()) {
- SetCursor(bview, tmppar->FirstPhysicalPar(), 0);
-#else
- while(tmppar != sel_start_cursor.par()->Previous()) {
- SetCursor(bview, tmppar, 0);
-#endif
- status = LyXText::NEED_MORE_REFRESH;
- refresh_row = cursor.row();
- refresh_y = cursor.y() - cursor.row()->baseline();
-#ifndef NEW_INSETS
- if (cursor.par()->footnoteflag ==
- sel_start_cursor.par()->footnoteflag) {
-#endif
- if (type == LyXParagraph::PEXTRA_NONE) {
- if (cursor.par()->pextra_type != LyXParagraph::PEXTRA_NONE) {
- cursor.par()->UnsetPExtraType(bview->buffer()->params);
- cursor.par()->pextra_type = LyXParagraph::PEXTRA_NONE;
- }
- } else {
- cursor.par()->SetPExtraType(bview->buffer()->params,
- type, width, widthp);
- cursor.par()->pextra_hfill = hfill;
- cursor.par()->pextra_start_minipage = start_minipage;
- cursor.par()->pextra_alignment = alignment;
- }
-#ifndef NEW_INSETS
- }
- tmppar = cursor.par()->FirstPhysicalPar()->Previous();
-#else
- tmppar = cursor.par()->Previous();
-#endif
- }
- RedoParagraphs(bview, sel_start_cursor, endpar);
- ClearSelection();
- SetCursor(bview, sel_start_cursor.par(), sel_start_cursor.pos());
- sel_cursor = cursor;
- SetCursor(bview, sel_end_cursor.par(), sel_end_cursor.pos());
- SetSelection();
- SetCursor(bview, tmpcursor.par(), tmpcursor.pos());