// removes the row and reset the touched counters
void LyXText::removeRow(Row * row) const
{
+ Row * row_prev = row->previous();
if (row->next())
- row->next()->previous(row->previous());
- if (!row->previous()) {
+ row->next()->previous(row_prev);
+ if (!row_prev) {
firstrow = row->next();
// lyx::Assert(firstrow);
} else {
- row->previous()->next(row->next());
+ row_prev->next(row->next());
}
- if (row == lastrow)
- lastrow = row->previous();
-
+ if (row == lastrow) {
+ lyx::Assert(!row->next());
+ lastrow = row_prev;
+ }
+ if (refresh_row == row) {
+ refresh_row = row_prev ? row_prev : row->next();
+ // what about refresh_y, refresh_height
+ }
+
height -= row->height(); // the text becomes smaller
delete row;
void LyXText::copySelection(BufferView * bview)
{
- // Stuff what we got on the clipboard. Even if there is no selection.
-
- // There is a problem with having the stuffing here in that the
- // larger the selection the slower LyX will get. This can be
- // solved by running the line below only when the selection has
- // finished. The solution used currently just works, to make it
- // faster we need to be more clever and probably also have more
- // calls to stuffClipboard. (Lgb)
+ // stuff the selection onto the X clipboard, from an explicit copy request
bview->stuffClipboard(selectionAsString(bview->buffer(), true));
// this doesnt make sense, if there is no selection