// Don't use forwardChar here as ditend might have
// pos() == lastpos() and forwardChar would miss it.
- for (; dit != ditend; dit.forwardPos()) {
+ // Can't use forwardPos either as this descends into
+ // nested insets.
+ for (; dit != ditend; dit.forwardPosNoDescend()) {
if (dit.pos() != dit.lastpos()) {
LyXFont f = getFont(dit.paragraph(), dit.pos());
f.update(font, params.language, toggleall);
bool isOK = false;
while (tmppit != end) {
in = pars_[tmppit].inInset();
- if (in->lyxCode() == InsetBase::FLOAT_CODE ||
- in->lyxCode() == InsetBase::WRAP_CODE) {
+ // FIXME: in should be always valid.
+ if (in &&
+ (in->lyxCode() == InsetBase::FLOAT_CODE ||
+ in->lyxCode() == InsetBase::WRAP_CODE)) {
isOK = true;
break;
}
if (cur.pos() != cur.lastpos()) {
bool updateNeeded = false;
if (!checkAndActivateInset(cur, true)) {
- lyxerr << BOOST_CURRENT_FUNCTION
- << " Running setCursor" << endl;
-
updateNeeded |= setCursor(cur, cur.pit(), cur.pos() + 1, true, false);
if (false && bidi.isBoundary(cur.buffer(), cur.paragraph(),
cur.pos()))