]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insettext.C
prevent crash when inserting minipage in table cell,
[lyx.git] / src / insets / insettext.C
index 4e0e5ea8767cf810b6ce6468b04831d43d3346f3..78bb89071e290ff205c68048b367bec53a8d7550 100644 (file)
@@ -252,8 +252,8 @@ void InsetText::read(Buffer const * buf, LyXLex & lex)
                        break;
                }
 
-               if (token == "\\the_end") {
-                       lex.printError("\\the_end read in inset! Error in document!");
+               if (token == "\\end_document") {
+                       lex.printError("\\end_document read in inset! Error in document!");
                        return;
                }
 
@@ -362,26 +362,17 @@ void InsetText::draw(PainterInfo & pi, int x, int baseline) const
                first = 0;
        }
 
-       int yf = y_offset + first;
-       y = 0;
+       int yo = y_offset + first;
 
-       while (rit != end && yf < y2) {
-               paintRows(*bv, text_, rit,
-                       y + y_offset + first, x, y + text_.top_y());
-               y += rit->height();
-               yf += rit->height();
-               ++rit;
-       }
+       paintRows(*bv, text_, rit, x, 0, yo, y2, yo);
 
        text_.clearPaint();
 
-       if (drawFrame_ == ALWAYS || (drawFrame_ == LOCKED && locked)) {
+       if (drawFrame_ == ALWAYS || (drawFrame_ == LOCKED && locked))
                drawFrame(pain, int(start_x));
-       }
 
-       if (need_update != INIT) {
+       if (need_update != INIT)
                need_update = NONE;
-       }
 }
 
 
@@ -515,7 +506,7 @@ void InsetText::lockInset(BufferView * bv)
 }
 
 
-void InsetText::lockInset(BufferView * bv, UpdatableInset * inset)
+void InsetText::lockInset(BufferView * /*bv*/, UpdatableInset * inset)
 {
        the_locking_inset = inset;
        inset_x = cix() - top_x + drawTextXOffset;
@@ -629,7 +620,7 @@ bool InsetText::updateInsetInInset(BufferView * bv, InsetOld * inset)
                                return false;
                        found = tl_inset->updateInsetInInset(bv, inset);
                        ustat = FULL;
-               } else { 
+               } else {
                        text_.updateInset(tl_inset);
                        setUpdateStatus(ustat);
                }
@@ -800,11 +791,7 @@ void InsetText::lfunMouseMotion(FuncRequest const & cmd)
        if (cur == text_.cursor)
                return;
        text_.setSelection();
-       bool flag = (text_.toggle_cursor.par() != text_.toggle_end_cursor.par() ||
-                                text_.toggle_cursor.pos() != text_.toggle_end_cursor.pos());
-       if (flag) {
-               updateLocal(bv, SELECTION, false);
-       }
+       updateLocal(bv, SELECTION, false);
 }