* This code is under the GNU General Public Licence version 2 or later.
*/
-#include <config.h>
-
#ifdef __GNUG__
#pragma implementation
#endif
#include "math_macrotable.h"
#include "math_macrotemplate.h"
#include "Painter.h"
+#include "LaTeXFeatures.h"
using std::endl;
{}
+MathMacro::MathMacro(MathMacro const & t)
+ : MathInset(t), tmplate_(t.tmplate_) // don't copy 'expanded_'!
+{}
+
+
+
MathInset * MathMacro::clone() const
{
return new MathMacro(*this);
}
-void MathMacro::Metrics(MathStyles st)
+void MathMacro::Metrics(MathStyles st, int, int)
{
if (mathcursor && mathcursor->isInside(this)) {
expanded_ = tmplate_->xcell(0);
xo(x);
yo(y);
+ Metrics(size());
+
LColor::color col;
if (mathcursor && mathcursor->isInside(this)) {
col = LColor::black;
}
- pain.rectangle(x + 1, y - ascent() + 1, width() - 2, height() - 2, col);
+ if (nargs() > 0)
+ pain.rectangle(x + 1, y - ascent() + 1, width() - 2, height() - 2, col);
}
{
return false;
}
+
+
+void MathMacro::Validate(LaTeXFeatures & features) const
+{
+ if (name_ == "binom")
+ features.binom = true;
+ MathInset::Validate(features);
+}