bool InsetMathHull::notifyCursorLeaves(Cursor const & /*old*/, Cursor & cur)
{
if (RenderPreview::status() == LyXRC::PREVIEW_ON) {
- Buffer const & buffer = cur.buffer();
+ Buffer const * buffer = cur.buffer();
docstring const snippet = latexString(*this);
- preview_->addPreview(snippet, buffer);
- preview_->startLoading(buffer);
+ preview_->addPreview(snippet, *buffer);
+ preview_->startLoading(*buffer);
cur.updateFlags(Update::Force);
}
return false;
label_[row] = dummy_pointer;
// We need an update of the Buffer reference cache.
// This is achieved by updateLabels().
- lyx::updateLabels(buffer());
- } else
+ buffer().updateLabels();
+ } else {
label_[row]->updateCommand(label);
+ }
return;
}
InsetCommandParams p(LABEL_CODE);
if (nonum_[row] && label_[row]) {
delete label_[row];
label_[row] = 0;
+ if (!buffer_) {
+ // The buffer is set at the end of readInset.
+ // When parsing the inset, buffer_ is 0.
+ return;
+ }
// We need an update of the Buffer reference cache.
// This is achieved by updateLabels().
- lyx::updateLabels(buffer());
+ buffer().updateLabels();
}
}
bool InsetMathHull::ams() const
{
- return
- type_ == hullAlign ||
- type_ == hullFlAlign ||
- type_ == hullMultline ||
- type_ == hullGather ||
- type_ == hullAlignAt ||
- type_ == hullXAlignAt ||
- type_ == hullXXAlignAt;
+ return type_ == hullAlign
+ || type_ == hullFlAlign
+ || type_ == hullMultline
+ || type_ == hullGather
+ || type_ == hullAlignAt
+ || type_ == hullXAlignAt
+ || type_ == hullXXAlignAt;
}
Inset::DisplayType InsetMathHull::display() const
{
- return (type_ != hullSimple && type_ != hullNone
- && type_ != hullRegexp) ? AlignCenter : Inline;
+ if (type_ == hullSimple || type_ == hullNone || type_ == hullRegexp)
+ return Inline;
+ return AlignCenter;
}
bool InsetMathHull::numberedType() const