#include "InsetMathBig.h"
#include "MathSupport.h"
-#include "MathMLStream.h"
+#include "MathStream.h"
#include "MathStream.h"
-#include "frontends/Application.h"
-#include "frontends/FontLoader.h"
#include "frontends/FontMetrics.h"
#include "support/lstrings.h"
-using std::string;
+namespace lyx {
+
using std::auto_ptr;
-InsetMathBig::InsetMathBig(string const & name, string const & delim)
+InsetMathBig::InsetMathBig(docstring const & name, docstring const & delim)
: name_(name), delim_(delim)
{}
-string InsetMathBig::name() const
+docstring InsetMathBig::name() const
{
return name_;
}
void InsetMathBig::metrics(MetricsInfo & mi, Dimension & dim) const
{
- double const h
- = theApp->fontLoader().metrics(mi.base.font).ascent('I');
+ double const h = theFontMetrics(mi.base.font).ascent('I');
double const f = increase();
dim_.wid = 6;
dim_.asc = int(h + f * h);
// mathed_draw_deco does not use the leading backslash, so remove it.
// Replace \| by \Vert (equivalent in LaTeX), since mathed_draw_deco
// would treat it as |.
- string const delim = (delim_ == "\\|") ?
- "Vert" :
- lyx::support::ltrim(delim_, "\\");
+ docstring const delim =
+ (delim_ == "\\|") ? from_ascii("Vert") : support::ltrim(delim_, "\\");
mathed_draw_deco(pi, x + 1, y - dim_.ascent(), 4, dim_.height(),
delim);
setPosCache(pi, x, y);
void InsetMathBig::write(WriteStream & os) const
{
- os << '\\' << name_ << ' ' << delim_;
+ os << '\\' << name_ << delim_;
if (delim_[0] == '\\')
os.pendingSpace(true);
}
void InsetMathBig::normalize(NormalStream & os) const
{
- os << '[' << name_ << ' ' << delim_ << ']';
+ os << '[' << name_ << ' ' << delim_ << ']';
}
-void InsetMathBig::infoize2(std::ostream & os) const
+void InsetMathBig::infoize2(odocstream & os) const
{
os << name_;
}
-bool InsetMathBig::isBigInsetDelim(string const & delim)
+bool InsetMathBig::isBigInsetDelim(docstring const & delim)
{
// mathed_draw_deco must handle these
static char const * const delimiters[] = {
"\\uparrow", "\\Uparrow",
"\\updownarrow", "\\Updownarrow", ""
};
- return (lyx::support::findToken(delimiters, delim) >= 0);
+ return support::findToken(delimiters, to_utf8(delim)) >= 0;
}
+
+
+} // namespace lyx