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();
lt = getLyXText(bv);
clear = true;
}
- if (!checkAndActivateInset(bv, x, tmp_y, button)) {
+ // we put here -1 and not button as now the button in the
+ // edit call should not be needed we will fix this in 1.3.x
+ // cycle hopefully (Jug 20020509)
+ if (!checkAndActivateInset(bv, x, tmp_y, -1)) {
lt->setCursorFromCoordinates(bv, x - drawTextXOffset,
y + insetAscent);
lt->cursor.x_fix(lt->cursor.x());
hideInsetCursor(bv);
no_selection = true;
locked = false;
- int code;
+ int code = NONE;
#if 0
if (drawFrame_ == LOCKED)
code = CURSOR|CLEAR_FRAME;
#if 0
updateLocal(bv, code, false);
#else
- setUpdateStatus(bv, code);
+ if (code != NONE)
+ setUpdateStatus(bv, code);
#endif
}
} else {
lt->insertStringAsLines(bv, clip);
}
+ // bug 393
+ lt->clearSelection();
+
updwhat = CURSOR_PAR;
updflag = true;
break;
setUndo(bv, Undo::INSERT,
lt->cursor.par(), lt->cursor.par()->next());
lt->pasteSelection(bv);
+ // bug 393
+ lt->clearSelection();
updwhat = CURSOR_PAR;
updflag = true;
}
}
-int InsetText::latex(Buffer const * buf, ostream & os, bool, bool) const
+int InsetText::latex(Buffer const * buf, ostream & os, bool moving_arg, bool) const
{
TexRow texrow;
- buf->latexParagraphs(os, par, 0, texrow);
+ buf->latexParagraphs(os, par, 0, texrow, moving_arg);
return texrow.rows();
}
int dummyx = x;
int dummyy = y + insetAscent;
Inset * inset = bv->checkInsetHit(getLyXText(bv), dummyx, dummyy);
-
+ // we only do the edit() call if the inset was hit by the mouse
+ // or if it is a highly editable inset. So we should call this
+ // function from our own edit with button < 0.
+ if (button < 0 && !isHighlyEditableInset(inset))
+ return false;
+
if (inset) {
if (x < 0)
x = insetWidth;
{
BufferParams const & bparams = bv->buffer()->params;
LyXText * llt = getLyXText(bv);
-
+
while(par->next()) {
if (par->size() && par->next()->size() &&
!par->isSeparator(par->size()-1))