Commit
5577e877 introduces forceUpdateBuffer() to delay actual
updatBuffer() calls to a central place.
In Cursor::upDownInText, the updateNeeded flag (which triggers
Update::Force update flag) is set to true when Cursor::checkDepm
returns true. This is fine, except that checkDepm also leads to a
forceBufferUpdate() call.
The logic in the method was such that, when updateNeeded is already
true when entering, forceBufferUpdate() will be called even though
checkDepm did not request it.
Fixes a slight delay with selecting in MergedManual (the manual of
manuals).
}
-bool Cursor::upDownInText(bool up, bool & updateNeeded)
+bool Cursor::upDownInText(bool up)
{
LASSERT(text(), return false);
getPos(xo, yo);
xo = beforeDispatchPosX_;
+ // Is a full repaint necessary?
+ bool updateNeeded = false;
+
// update the targetX - this is here before the "return false"
// to set a new target which can be used by InsetTexts above
// if we cannot move up/down inside this inset anymore
dummy.pos() = dummy.pos() == 0 ? dummy.lastpos() : 0;
dummy.pit() = dummy.pit() == 0 ? dummy.lastpit() : 0;
- updateNeeded |= bv().checkDepm(dummy, *this);
- updateTextTargetOffset();
- if (updateNeeded)
+ if (bv().checkDepm(dummy, *this)) {
+ updateNeeded = true;
forceBufferUpdate();
+ }
+ updateTextTargetOffset();
}
- return false;
+ return updateNeeded;
}
// with and without selection are handled differently
++dummy.pos();
if (bv().checkDepm(dummy, old)) {
updateNeeded = true;
+ forceBufferUpdate();
// Make sure that cur gets back whatever happened to dummy (Lgb)
operator=(dummy);
}
// When selection==false, this is done by TextMetrics::editXY
setCurrentFont();
- updateNeeded |= bv().checkDepm(*this, old);
+ if (bv().checkDepm(*this, old)) {
+ updateNeeded = true;
+ forceBufferUpdate();
+ }
}
- if (updateNeeded)
- forceBufferUpdate();
updateTextTargetOffset();
- return true;
+ return updateNeeded;
}
/// return true if fullscreen update is needed
bool down();
/// move up/down in a text inset, called for LFUN_UP/DOWN,
- /// return true if successful, updateNeeded set to true if fullscreen
- /// update is needed, otherwise it's not touched
- bool upDownInText(bool up, bool & updateNeeded);
+ /// return true if fullscreen update is needed
+ bool upDownInText(bool up);
/// move up/down in math or any non text inset, call for LFUN_UP/DOWN
/// return true if successful
bool upDownInMath(bool up);
if (!atFirstOrLastRow) {
needsUpdate |= cur.selHandle(select);
- cur.upDownInText(up, needsUpdate);
+ needsUpdate |= cur.upDownInText(up);
needsUpdate |= cur.beforeDispatchCursor().inMathed();
} else {
pos_type newpos = up ? 0 : cur.lastpos();
needsUpdate |= cur.selHandle(select);
// we do not reset the targetx of the cursor
cur.pos() = newpos;
- needsUpdate |= bv->checkDepm(cur, bv->cursor());
- cur.updateTextTargetOffset();
- if (needsUpdate)
+ if (bv->checkDepm(cur, bv->cursor())) {
+ needsUpdate = true;
cur.forceBufferUpdate();
+ }
+ cur.updateTextTargetOffset();
break;
}
// the selection right now, but wait for the next dispatch.
if (select)
needsUpdate |= cur.selHandle(select);
- cur.upDownInText(up, needsUpdate);
+ needsUpdate |= cur.upDownInText(up);
cur.undispatched();
}