mathed46.diff

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1696 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Lars Gullik Bjønnes 2001-03-06 18:17:16 +00:00
parent 2338154427
commit 7abb55666c
7 changed files with 25 additions and 24 deletions

View File

@ -393,7 +393,7 @@ void InsetFormula::draw(BufferView * bv, LyXFont const & f,
} else { } else {
MathMatrixInset * mt = MathMatrixInset * mt =
static_cast<MathMatrixInset*>(par); static_cast<MathMatrixInset*>(par);
MathedRowSt const * crow = mt->getRowSt(); MathedRowContainer::iterator crow = mt->getRowSt().begin();
while (crow) { while (crow) {
int const y = baseline + crow->getBaseline(); int const y = baseline + crow->getBaseline();
if (crow->isNumbered()) { if (crow->isNumbered()) {
@ -404,7 +404,7 @@ void InsetFormula::draw(BufferView * bv, LyXFont const & f,
str = "(#)"; str = "(#)";
pain.text(int(x + 20), y, str, wfont); pain.text(int(x + 20), y, str, wfont);
} }
crow = crow->getNext(); ++crow;
} }
} }
} }
@ -557,11 +557,11 @@ vector<string> const InsetFormula::getLabelList() const
if (is_multi_numbered(par->GetType())) { if (is_multi_numbered(par->GetType())) {
MathMatrixInset * mt = static_cast<MathMatrixInset*>(par); MathMatrixInset * mt = static_cast<MathMatrixInset*>(par);
MathedRowSt const * crow = mt->getRowSt(); MathedRowContainer::iterator crow = mt->getRowSt().begin();
while (crow) { while (crow) {
if (!crow->getLabel().empty()) if (!crow->getLabel().empty())
label_list.push_back(crow->getLabel()); label_list.push_back(crow->getLabel());
crow = crow->getNext(); ++crow;
} }
} else if (!label_.empty()) } else if (!label_.empty())
label_list.push_back(label_); label_list.push_back(label_);

View File

@ -53,7 +53,7 @@ MathMatrixInset::MathMatrixInset(MathMatrixInset const & mt)
row_ = r; row_ = r;
else else
ro->setNext(r); ro->setNext(r);
mrow = mrow->getNext(); mrow = mrow->next_;
ro = r; ro = r;
++nr_; ++nr_;
} }
@ -67,7 +67,7 @@ MathMatrixInset::~MathMatrixInset()
{ {
MathedRowSt * r = row_.data_; MathedRowSt * r = row_.data_;
while (r) { while (r) {
MathedRowSt * q = r->getNext(); MathedRowSt * q = r->next_;
delete r; delete r;
r = q; r = q;
} }
@ -184,7 +184,7 @@ void MathMatrixInset::Metrics()
ascent = h - hl; ascent = h - hl;
break; break;
default: default:
ascent = (row_.data_->getNext()) ? h / 2 : h - hl; ascent = (row_.begin().is_last()) ? h / 2 : h - hl;
break; break;
} }
descent = h - ascent + 2; descent = h - ascent + 2;

View File

@ -45,9 +45,9 @@ public:
virtual bool isMatrix() const; virtual bool isMatrix() const;
/// Use this to manage the extra information independently of paragraph /// Use this to manage the extra information independently of paragraph
MathedRowSt * getRowSt() const; MathedRowContainer & getRowSt();
/// ///
void setRowSt(MathedRowSt * r); void setRowSt(MathedRowContainer & r);
private: private:
/// Number of columns & rows /// Number of columns & rows
int nc_; int nc_;
@ -87,14 +87,14 @@ bool MathMatrixInset::isMatrix() const
inline inline
MathedRowSt * MathMatrixInset::getRowSt() const MathedRowContainer & MathMatrixInset::getRowSt()
{ {
return row_.data_; return row_;
} }
inline inline
void MathMatrixInset::setRowSt(MathedRowSt * r) void MathMatrixInset::setRowSt(MathedRowContainer & r)
{ {
row_ = r; row_ = r;
} }

View File

@ -21,9 +21,10 @@ using std::endl;
extern int number_of_newlines; extern int number_of_newlines;
MathedRowSt * MathParInset::getRowSt() const MathedRowContainer & MathParInset::getRowSt()
{ {
return 0; static MathedRowContainer dummy;
return dummy;
} }
@ -270,7 +271,7 @@ void MathParInset::Write(ostream & os, bool fragile)
latexkeys const * l; latexkeys const * l;
MathedIter data(&array); MathedIter data(&array);
// hack // hack
MathedRowSt const * crow = getRowSt(); MathedRowContainer::iterator crow = getRowSt().begin();
data.Reset(); data.Reset();
if (!Permit(LMPF_FIXED_SIZE)) { if (!Permit(LMPF_FIXED_SIZE)) {
@ -348,7 +349,7 @@ void MathParInset::Write(ostream & os, bool fragile)
<< crow->getLabel() << crow->getLabel()
<< "} "; << "} ";
} }
crow = crow->getNext(); ++crow;
} }
if (fragile) if (fragile)
os << "\\protect"; os << "\\protect";

View File

@ -67,9 +67,9 @@ public:
/// ///
virtual void SetStyle(short); virtual void SetStyle(short);
/// ///
virtual MathedRowSt * getRowSt() const; virtual MathedRowContainer & getRowSt();
/// ///
virtual void setRowSt(MathedRowSt *); virtual void setRowSt(MathedRowContainer &);
/// ///
virtual bool Permit(short f) const; virtual bool Permit(short f) const;
/// ///
@ -150,7 +150,7 @@ int MathParInset::getMaxArgumentIdx() const
inline inline
void MathParInset::setRowSt(MathedRowSt *) void MathParInset::setRowSt(MathedRowContainer &)
{} {}

View File

@ -424,7 +424,7 @@ void mathed_parse(MathedArray & array, unsigned flags = 0,
int acc_brace = 0; int acc_brace = 0;
int acc_braces[8]; int acc_braces[8];
MathParInset * mt = (mtx) ? *mtx : 0; MathParInset * mt = (mtx) ? *mtx : 0;
MathedRowSt * crow = (mt) ? mt->getRowSt() : 0; MathedRowSt * crow = (mt) ? mt->getRowSt().data_ : 0;
++plevel; ++plevel;
MathedIter data(&array); MathedIter data(&array);
@ -869,7 +869,7 @@ void mathed_parse(MathedArray & array, unsigned flags = 0,
} }
mt->SetStyle(size); mt->SetStyle(size);
mt->SetType(mathed_env); mt->SetType(mathed_env);
crow = mt->getRowSt(); crow = mt->getRowSt().data_;
} }
lyxerr[Debug::MATHED] << "MATH BEGIN[" << mathed_env << "]" << endl; lyxerr[Debug::MATHED] << "MATH BEGIN[" << mathed_env << "]" << endl;

View File

@ -186,7 +186,7 @@ void MathedXIter::SetData(MathParInset * pp)
x_ = y_ = 0; x_ = y_ = 0;
array = &p_->GetData(); array = &p_->GetData();
ncols = p_->GetColumns(); ncols = p_->GetColumns();
crow_ = p_->getRowSt(); crow_ = p_->getRowSt().data_;
if (p_->Permit(LMPF_ALLOW_CR)) if (p_->Permit(LMPF_ALLOW_CR))
flags |= MthIF_CR; flags |= MthIF_CR;
if (p_->Permit(LMPF_ALLOW_TAB)) if (p_->Permit(LMPF_ALLOW_TAB))
@ -272,7 +272,7 @@ void MathedXIter::GoBegin()
x_ = y_ = 0; x_ = y_ = 0;
sw_ = sx_ = 0; sw_ = sx_ = 0;
if (p_) { if (p_) {
crow_ = p_->getRowSt(); crow_ = p_->getRowSt().data_;
if (crow_) { if (crow_) {
x_ = crow_->getTab(0); x_ = crow_->getTab(0);
y_ = crow_->getBaseline(); y_ = crow_->getBaseline();
@ -447,7 +447,7 @@ void MathedXIter::ipop()
x_ = stck.x; x_ = stck.x;
y_ = stck.y; y_ = stck.y;
if (p_) { if (p_) {
crow_ = p_->getRowSt(); crow_ = p_->getRowSt().data_;
if (crow_) if (crow_)
for (int i = 0; i < row; ++i) for (int i = 0; i < row; ++i)
crow_ = crow_->getNext(); crow_ = crow_->getNext();