Move the screen redraw call out of the selection-setting routine. This

avoids multiple screen redraws in some cases.

If someone knows how to fix the FIXMEs in GuiErrorList and
GuiSpellcheker, I'd really appreciate it.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35651 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Richard Heck 2010-10-14 15:02:48 +00:00
parent 3af1fa5abb
commit b1df2bd306
3 changed files with 6 additions and 8 deletions

View File

@ -1532,9 +1532,7 @@ void BufferView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
istringstream iss(to_utf8(cmd.argument()));
iss >> opt;
if (findAdv(this, opt))
cur.dispatched();
else
cur.undispatched();
dr.screenUpdate(Update::Force | Update::FitCursor);
break;
}
@ -2344,9 +2342,6 @@ void BufferView::putSelectionAt(DocIterator const & cur,
} else
d->cursor_.setSelection(d->cursor_, length);
}
// Ensure a redraw happens in any case because the new selection could
// possibly be on the same screen as the previous selection.
processUpdateFlags(Update::Force | Update::FitCursor);
}

View File

@ -180,8 +180,9 @@ bool GuiErrorList::goTo(int item)
pos_type const range = end - start;
dit.pos() = start;
BufferView * bv = const_cast<BufferView *>(bufferview());
// FIXME: If we used an LFUN, we would not need this line:
// FIXME: If we used an LFUN, we would not need these lines:
bv->putSelectionAt(dit, range, false);
bv->processUpdateFlags(Update::Force | Update::FitCursor);
return true;
}

View File

@ -325,10 +325,12 @@ void GuiSpellchecker::check()
d->ui.languageCO->setCurrentIndex(pos);
// FIXME: if we used a lfun like in find/replace, dispatch would do
// that for us
// all of this for us
int const size = to.pos() - from.pos();
BufferView * bv = const_cast<BufferView *>(bufferview());
bv->putSelectionAt(from, size, false);
bv->processUpdateFlags(Update::Force | Update::FitCursor);
}