#endif
#include "math_sizeinset.h"
+#include "math_parser.h"
#include "support/LOstream.h"
-MathSizeInset::MathSizeInset(MathStyles st)
- : MathInset(1), style_(st)
-{
- name_ = verbose();
-}
-
-
-char const * MathSizeInset::verbose() const
-{
- switch (style_) {
- case LM_ST_DISPLAY:
- return "displaystyle";
- case LM_ST_TEXT:
- return "textstyle";
- case LM_ST_SCRIPT:
- return "scriptstyle";
- case LM_ST_SCRIPTSCRIPT:
- return "scriptscriptstyle";
- }
- return "unknownstyle";
-}
+MathSizeInset::MathSizeInset(latexkeys const * l)
+ : MathNestInset(1), key_(l)
+{}
MathInset * MathSizeInset::clone() const
}
-void MathSizeInset::draw(Painter & pain, int x, int y)
+void MathSizeInset::draw(Painter & pain, int x, int y) const
{
xo(x);
yo(y);
}
-void MathSizeInset::metrics(MathStyles /* st */)
+void MathSizeInset::metrics(MathStyles /* st */) const
{
- xcell(0).metrics(style_);
+ xcell(0).metrics(MathStyles(key_->id));
ascent_ = xcell(0).ascent_;
descent_ = xcell(0).descent_;
width_ = xcell(0).width_;
void MathSizeInset::write(std::ostream & os, bool fragile) const
{
- os << "{\\" << name() << " ";
+ os << "{\\" << key_->name << " ";
cell(0).write(os, fragile);
os << "}";
}
void MathSizeInset::writeNormal(std::ostream & os) const
{
- os << "[" << name() << " ";
+ os << "[" << key_->name << " ";
cell(0).writeNormal(os);
os << "]";
}