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;
}
return;
}
+ bv->hideCursor();
+
if (!owner())
x += scroll();
x += TEXT_TO_INSET_OFFSET;
- RowList::iterator rowit = text_.rows().begin();
+ RowList::iterator rit = text_.rows().begin();
RowList::iterator end = text_.rows().end();
- int y_offset = baseline - rowit->ascent_of_text();
- int ph = pain.paperHeight();
+ int y_offset = baseline - rit->ascent_of_text();
+ int y2 = pain.paperHeight();
int first = 0;
int y = y_offset;
- while (rowit != end && y + rowit->height() <= 0) {
- y += rowit->height();
- first += rowit->height();
- ++rowit;
+ while (rit != end && y + rit->height() <= 0) {
+ y += rit->height();
+ first += rit->height();
+ ++rit;
}
if (y_offset < 0) {
text_.top_y(-y_offset);
first = 0;
}
- int yf = y_offset + first;
- y = 0;
-
- bv->hideCursor();
+ int yo = y_offset + first;
- while (rowit != end && yf < ph) {
- paintRows(*bv, text_, rowit,
- y + y_offset + first, int(x), y + text_.top_y());
- y += rowit->height();
- yf += rowit->height();
- ++rowit;
- }
+ 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;
- }
}
}
-void InsetText::lockInset(BufferView * bv, UpdatableInset * inset)
+void InsetText::lockInset(BufferView * /*bv*/, UpdatableInset * inset)
{
the_locking_inset = inset;
inset_x = cix() - top_x + drawTextXOffset;
return false;
found = tl_inset->updateInsetInInset(bv, inset);
ustat = FULL;
- } else {
+ } else {
text_.updateInset(tl_inset);
setUpdateStatus(ustat);
}
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);
}
void InsetText::toggleSelection(BufferView * bv, bool kill_selection)
{
- if (the_locking_inset) {
+ if (the_locking_inset)
the_locking_inset->toggleSelection(bv, kill_selection);
- }
int x = top_x + TEXT_TO_INSET_OFFSET;
- RowList::iterator rowit = text_.rows().begin();
+ RowList::iterator rit = text_.rows().begin();
RowList::iterator end = text_.rows().end();
- int y_offset = top_baseline - rowit->ascent_of_text();
+ int y_offset = top_baseline - rit->ascent_of_text();
int y = y_offset;
- while ((rowit != end) && ((y + rowit->height()) <= 0)) {
- y += rowit->height();
- ++rowit;
+ while (rit != end && y + rit->height() <= 0) {
+ y += rit->height();
+ ++rit;
}
if (y_offset < 0)
y_offset = y;