When we export the file to latex, we use the redefinition_ variable to check whether we should output newcommand or renewcommand. This variable was set by the MathMacroTemplate::metrics() function, and this caused problem when the export is running in a different thread as the GUI.
In general, the metrics() functions should not change the Buffer; we have updateBuffer/updateMacros for that purpose.
}
-void MathMacroTemplate::updateToContext(MacroContext const & mc) const
+void MathMacroTemplate::updateToContext(MacroContext const & mc)
{
redefinition_ = mc.get(name()) != 0;
}
// valid macro?
MacroData const * macro = 0;
- if (validName()) {
+ if (validName())
macro = mi.macrocontext.get(name());
- // updateToContext() - avoids another lookup
- redefinition_ = macro != 0;
- }
-
// update look?
int argsInDef = maxArgumentInDefinition();
if (lookOutdated_ || argsInDef != argsInLook_) {
virtual void validate(LaTeXFeatures &) const;
/// decide whether its a redefinition
- void updateToContext(MacroContext const & mc) const;
+ void updateToContext(MacroContext const & mc);
///
void draw(PainterInfo & pi, int x, int y) const;
/// (re)newcommand or def
mutable MacroType type_;
/// defined before already?
- mutable bool redefinition_;
+ bool redefinition_;
///
void createLook(int args) const;
///