MathParInset::MathParInset(short st, string const & nm, short ot)
: MathedInset(nm, ot, st)
{
- array = 0;
ascent = 8;
width = 4;
descent = 0;
MathParInset::~MathParInset()
{
- if (array) {
- MathedIter it(array);
- it.Clear();
- delete array;
- }
}
void MathParInset::setData(MathedArray * a)
{
- array = a;
+ array = *a;
// A standard paragraph shouldn't have any tabs nor CRs.
- if (array) {
- MathedIter it(array);
- while (it.OK()) {
- char c = it.GetChar();
- if (c == LM_TC_TAB || c == LM_TC_CR)
- it.Delete();
- else
- it.Next();
- }
+ MathedIter it(&array);
+ while (it.OK()) {
+ char c = it.GetChar();
+ if (c == LM_TC_TAB || c == LM_TC_CR)
+ it.Delete();
+ else
+ it.Next();
}
}
xo_ = x;
yo_ = y;
- if (!array || array->empty()) {
- if (array) {
- MathedXIter data(this);
- data.GetPos(x, y);
- }
+ if (array.empty()) {
+ MathedXIter data(this);
+ data.GetPos(x, y);
pain.rectangle(x, y - df_asc, df_width, df_asc, LColor::mathline);
return;
}
ascent = df_asc;//mathed_char_height(LM_TC_VAR, size, 'I', asc, des);
width = df_width;
descent = 0;
- if (!array) return;
- if (array->empty()) return;
+ if (array.empty()) return;
ascent = 0;
MathedXIter data(this);
void MathParInset::Write(ostream & os, bool fragile)
{
- if (!array) return;
+ if (array.empty()) return;
int brace = 0;
latexkeys const * l;
- MathedIter data(array);
+ MathedIter data(&array);
// hack
MathedRowSt const * crow = getRowSt();
data.Reset();
MathedArray * MathParInset::GetData()
{
- return array;
+ return &array;
}