-#if 0
-// increment depth over selection and
-// make a total rebreak of those paragraphs
-void LyXText::IncDepth(BufferView * bview)
-{
- // If there is no selection, just use the current paragraph
- if (!selection) {
- sel_start_cursor = cursor; // dummy selection
- sel_end_cursor = cursor;
- }
-
- // We end at the next paragraph with depth 0
- Paragraph * endpar = sel_end_cursor.par()->next();
-
- Paragraph * undoendpar = endpar;
-
- if (endpar && endpar->getDepth()) {
- while (endpar && endpar->getDepth()) {
- endpar = endpar->next();
- undoendpar = endpar;
- }
- }
- else if (endpar) {
- endpar = endpar->next(); // because of parindents etc.
- }
-
- SetUndo(bview->buffer(), Undo::EDIT,
- sel_start_cursor.par()->previous(),
- undoendpar);
-
- LyXCursor tmpcursor = cursor; // store the current cursor
-
- // ok we have a selection. This is always between sel_start_cursor
- // and sel_end cursor
- cursor = sel_start_cursor;
-
- bool anything_changed = false;
-
- while (true) {
- // NOTE: you can't change the depth of a bibliography entry
- if (
- textclasslist.Style(bview->buffer()->params.textclass,
- cursor.par()->GetLayout()
- ).labeltype != LABEL_BIBLIO) {
- Paragraph * prev = cursor.par()->previous();
-
- if (prev
- && (prev->GetDepth() - cursor.par()->GetDepth() > 0
- || (prev->GetDepth() == cursor.par()->GetDepth()
- && textclasslist.Style(bview->buffer()->params.textclass,
- prev->GetLayout()).isEnvironment()))) {
- cursor.par()->params.depth(cursor.par()->params.depth() + 1);
- anything_changed = true;
- }
- }
- if (cursor.par() == sel_end_cursor.par())
- break;
- cursor.par(cursor.par()->next());
- }
-
- // if nothing changed set all depth to 0
- if (!anything_changed) {
- cursor = sel_start_cursor;
- while (cursor.par() != sel_end_cursor.par()) {
- cursor.par()->params.depth(0);
- cursor.par(cursor.par()->next());
- }
- cursor.par()->params.depth(0);
- }
-
- redoParagraphs(bview, sel_start_cursor, endpar);
-
- // we have to reset the selection, because the
- // geometry could have changed
- setCursor(bview, sel_start_cursor.par(),
- sel_start_cursor.pos());
- sel_cursor = cursor;
- setCursor(bview, sel_end_cursor.par(), sel_end_cursor.pos());
- updateCounters(bview, cursor.row());
- clearSelection(bview);
- setSelection(bview);
- setCursor(bview, tmpcursor.par(), tmpcursor.pos());
-}
-#else