2 * \file math_substackinset.C
3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
8 * Full author contact details are available in file CREDITS.
13 #include "LaTeXFeatures.h"
14 #include "math_substackinset.h"
15 #include "math_data.h"
16 #include "math_mathmlstream.h"
17 #include "support/std_ostream.h"
19 #include "funcrequest.h"
20 #include "FuncStatus.h"
23 #include "support/lstrings.h"
27 using lyx::support::bformat;
32 InsetMathSubstack::InsetMathSubstack()
37 auto_ptr<InsetBase> InsetMathSubstack::doClone() const
39 return auto_ptr<InsetBase>(new InsetMathSubstack(*this));
43 void InsetMathSubstack::metrics(MetricsInfo & mi, Dimension & dim) const
45 if (mi.base.style == LM_ST_DISPLAY) {
46 StyleChanger dummy(mi.base, LM_ST_TEXT);
47 InsetMathGrid::metrics(mi, dim);
49 InsetMathGrid::metrics(mi, dim);
55 void InsetMathSubstack::draw(PainterInfo & pi, int x, int y) const
57 InsetMathGrid::draw(pi, x + 1, y);
61 bool InsetMathSubstack::getStatus(LCursor & cur, FuncRequest const & cmd,
62 FuncStatus & flag) const
65 case LFUN_TABULAR_FEATURE: {
66 string const name("substack");
67 docstring const & s = cmd.argument();
68 if (s == "add-vline-left" || s == "add-vline-right") {
70 lyx::from_utf8(N_("Can't add vertical grid lines in '%1$s'")), lyx::from_utf8(name)));
74 return InsetMathGrid::getStatus(cur, cmd, flag);
77 return InsetMathGrid::getStatus(cur, cmd, flag);
82 void InsetMathSubstack::infoize(std::ostream & os) const
88 void InsetMathSubstack::write(WriteStream & os) const
91 InsetMathGrid::write(os);
96 void InsetMathSubstack::normalize(NormalStream & os) const
99 InsetMathGrid::normalize(os);
104 void InsetMathSubstack::maple(MapleStream & os) const
107 InsetMathGrid::maple(os);
112 void InsetMathSubstack::validate(LaTeXFeatures & features) const
114 features.require("amsmath");
115 InsetMathGrid::validate(features);