]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insettext.C
Revert this change as it sneaked in and wasn't discussed yet.
[lyx.git] / src / insets / insettext.C
index b35065af69da726944d5a024d99c452f3b8faa29..c4062bdba881a83ec654e4b534fedb05db367e3a 100644 (file)
@@ -451,15 +451,35 @@ void InsetText::draw(BufferView * bv, LyXFont const & f,
                first += row->height();
                row = row->next();
        }
-       if (y_offset < 0)
-               y_offset = y;
-       lt->first_y = first;
+       if (y_offset < 0) {
+               lt->first_y = -y_offset;
+               first = y;
+               y_offset = 0;
+       } else {
+               lt->first_y = first;
+               first = 0;
+       }
        if (cleared || (need_update&(INIT|FULL))) {
-               int yf = y_offset;
+               int yf = y_offset + first;
                y = 0;
                while ((row != 0) && (yf < ph)) {
-                       lt->getVisibleRow(bv, y+y_offset, int(x), row,
-                                               y+first, cleared);
+                       lt->getVisibleRow(bv, y + y_offset + first, int(x),
+                                         row, y + lt->first_y, cleared);
+                       if (bv->text->status() == LyXText::CHANGED_IN_DRAW) {
+                               lt->need_break_row = row;
+                               lt->fullRebreak(bv);
+                               lt->setCursor(bv, lt->cursor.par(),
+                                             lt->cursor.pos());
+                               if (lt->selection.set()) {
+                                       lt->setCursor(bv, lt->selection.start,
+                                                     lt->selection.start.par(),
+                                                     lt->selection.start.pos());
+                                       lt->setCursor(bv, lt->selection.end,
+                                                     lt->selection.end.par(),
+                                                     lt->selection.end.pos());
+                               }
+                               break;
+                       }
                        y += row->height();
                        yf += row->height();
                        row = row->next();
@@ -763,7 +783,7 @@ void InsetText::insetUnlock(BufferView * bv)
        hideInsetCursor(bv);
        no_selection = true;
        locked = false;
-       int code;
+       int code = NONE;
 #if 0
        if (drawFrame_ == LOCKED)
                code = CURSOR|CLEAR_FRAME;
@@ -797,7 +817,8 @@ void InsetText::insetUnlock(BufferView * bv)
 #if 0
        updateLocal(bv, code, false);
 #else
-       setUpdateStatus(bv, code);
+       if (code != NONE)
+               setUpdateStatus(bv, code);
 #endif
 }
 
@@ -2718,7 +2739,7 @@ void InsetText::collapseParagraphs(BufferView * bv) const
 {
        BufferParams const & bparams = bv->buffer()->params;
        LyXText * llt = getLyXText(bv);
-       
+
        while(par->next()) {
                if (par->size() && par->next()->size() &&
                        !par->isSeparator(par->size()-1))