* BufferView::Pimpl::update:

- streamline a bit to only run updateMetrics once
	- do not take a backup copy of theCoords


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14332 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Lars Gullik Bjønnes 2006-07-04 00:19:59 +00:00
parent 1ff081141d
commit 32cd0ee6f9

View File

@ -701,33 +701,29 @@ void BufferView::Pimpl::update(Update::flags flags)
// Update macro store
buffer_->buildMacros();
CoordCache backup;
std::swap(theCoords, backup);
// This, together with doneUpdating(), verifies (using
// asserts) that screen redraw is not called from
// within itself.
theCoords.startUpdating();
// First drawing step
updateMetrics(flags & Update::SinglePar);
bool singlePar = flags & Update::SinglePar;
bool forceupdate(flags & (Update::Force | Update::SinglePar));
if ((flags & Update::FitCursor) && fitCursor()) {
if ((flags & (Update::FitCursor | Update::MultiParSel))
&& (fitCursor() || multiParSel())) {
forceupdate = true;
updateMetrics();
}
if ((flags & Update::MultiParSel) && multiParSel()) {
forceupdate = true;
updateMetrics();
singlePar = false;
}
if (forceupdate) {
// Second drawing step
updateMetrics(singlePar);
owner_->workArea()->redraw(*bv_);
} else {
// Abort updating of the coord
// cache - just restore the old one
std::swap(theCoords, backup);
theCoords.doneUpdating();
}
} else
owner_->workArea()->greyOut();