lyx_mirror/src/mathed/math_sizeinset.C
Lars Gullik Bjønnes 33a28bdc9c Add string << operators for the other streams as well, and removes
c_str() all places where it is not needed anymore.
(I also add config.h to several files that was missing it)
+ added s string constructor to math_symbolinset

I also change some "while(" to "while ("

mmm ... yes ... I add a "zero()" function to LyXLength... an "empty()"
function did not seem appropriate. changed a couple of places that
checked on length.value() != 0.0.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3149 a592a061-630c-0410-9148-cb99ea01b6c8
2001-12-05 08:04:20 +00:00

51 lines
902 B
C

#include <config.h>
#ifdef __GNUG__
#pragma implementation
#endif
#include "math_sizeinset.h"
#include "math_parser.h"
#include "math_mathmlstream.h"
#include "math_streamstr.h"
MathSizeInset::MathSizeInset(latexkeys const * l)
: MathNestInset(1), key_(l)
{}
MathInset * MathSizeInset::clone() const
{
return new MathSizeInset(*this);
}
void MathSizeInset::draw(Painter & pain, int x, int y) const
{
xcell(0).draw(pain, x, y);
}
void MathSizeInset::metrics(MathMetricsInfo const & mi) const
{
MathMetricsInfo m = mi;
m.style = MathStyles(key_->id);
xcell(0).metrics(m);
ascent_ = xcell(0).ascent_;
descent_ = xcell(0).descent_;
width_ = xcell(0).width_;
}
void MathSizeInset::write(WriteStream & os) const
{
os << "{\\" << key_->name << ' ' << cell(0) << '}';
}
void MathSizeInset::normalize(NormalStream & os) const
{
os << "[" << key_->name << ' ' << cell(0) << ']';
}