// updateMetrics() does not update paragraph position
// This is done at draw() time. So we need a redraw!
- buffer_.changed(false);
+ // We pass true so that metrics are computed for the sake
+ // of having MacroData updated.
+ buffer_.changed(true);
if (needsFitCursor()) {
// The cursor is off screen so ensure it is visible.
// This event (moving without mouse click) is not passed further.
// This should be changed if it is further utilized.
- buffer_.changed(false);
+ // We pass true so that metrics are computed for the sake
+ // of having MacroData updated.
+ buffer_.changed(true);
}
}
drawMarkers2(pi, expx, expy);
} else {
bool drawBox = lyxrc.macro_edit_style == LyXRC::MACRO_EDIT_INLINE_BOX;
- MacroData const * macro = MacroTable::globalMacros().get(name());
- bool upshape = macro && macro->symbol()
- && macro->symbol()->extra == "textmode";
+ bool user_macro = !MacroTable::globalMacros().get(name());
+ bool upshape = user_macro ? false : d->macro_ && d->macro_->symbol()
+ && d->macro_->symbol()->extra == "textmode";
Changer dummy = pi.base.font.changeShape(upshape ? UP_SHAPE
: pi.base.font.shape());
void MathMacro::write(WriteStream & os) const
{
- MacroData const * macro = MacroTable::globalMacros().get(name());
- bool textmode_macro = macro && macro->symbol()
- && macro->symbol()->extra == "textmode";
- bool needs_mathmode = macro && (!macro->symbol()
- || macro->symbol()->extra != "textmode");
+ bool user_macro = !MacroTable::globalMacros().get(name());
+ bool textmode_macro = user_macro ? false : d->macro_ && d->macro_->symbol()
+ && d->macro_->symbol()->extra == "textmode";
+ bool needs_mathmode = user_macro ? bool(d->macro_) : d->macro_ && (!d->macro_->symbol()
+ || d->macro_->symbol()->extra != "textmode");
MathEnsurer ensurer(os, needs_mathmode, true, textmode_macro);