mathed12.diff + some small tweeks

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1488 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Lars Gullik Bjønnes 2001-02-12 14:59:46 +00:00
parent af8dbd4a5c
commit 5059e558f1
2 changed files with 62 additions and 58 deletions

View File

@ -1,13 +1,23 @@
2001-02-12 Lars Gullik Bjønnes <larsbj@lyx.org>
* math_defs.h (struct MathedRowSt): make all private variables end
with '_', initialize in initializer list instead of in function
body.
2001-02-12 Dekel Tsur <dekelts@tau.ac.il> 2001-02-12 Dekel Tsur <dekelts@tau.ac.il>
* formula.C (LocalDispatch): Change the default action of * formula.C (LocalDispatch): Change the default action of
break-line to create an align* environment instead of eqnarray*. break-line to create an align* environment instead of eqnarray*.
* math_inset.C (Metrics): Correct drawing of the multline environment. * math_inset.C (Metrics): Correct drawing of the multline
environment.
2001-02-12 André Pönitz <poenitz@htwm.de> 2001-02-12 André Pönitz <poenitz@htwm.de>
* array.[hC]: replace private variable maxsize_ with call
to bf_.size() * array.[hC]: replace private variable maxsize_ with call to
bf_.size()
* math_defs.h: replace int[] by std::vector<int> for
MathedRowSt::widths
2001-02-09 Lars Gullik Bjønnes <larsbj@lyx.org> 2001-02-09 Lars Gullik Bjønnes <larsbj@lyx.org>

View File

@ -409,61 +409,55 @@ class MathParInset: public MathedInset {
It allows to manage the extra info independently of the paragraph data. It allows to manage the extra info independently of the paragraph data.
Only used for multiline paragraphs. Only used for multiline paragraphs.
*/ */
struct MathedRowSt { struct MathedRowSt
/// {
explicit ///
MathedRowSt(int n) { explicit
w = new int[n + 1]; // this leaks MathedRowSt(int n)
asc = desc = y = 0; : asc_(0), desc_(0), y_(0), widths_(n + 1, 0),
for (int i = 0 ; i < n + 1 ; ++i) numbered_(true), next_(0)
w[i] = 0; {}
next = 0; /// Should be const but...
numbered = true; MathedRowSt * getNext() const { return next_; }
} /// ...we couldn't use this.
/// void setNext(MathedRowSt * n) { next_ = n; }
~MathedRowSt() { ///
delete[] w; string const & getLabel() const { return label_; }
} ///
/// Should be const but... bool isNumbered() const { return numbered_; }
MathedRowSt * getNext() const { return next; } ///
/// ...we couldn't use this. int getBaseline() const { return y_; }
void setNext(MathedRowSt * n) { next = n; } ///
/// void setBaseline(int b) { y_ = b; }
string const & getLabel() const { return label; } ///
/// int ascent() const { return asc_; }
bool isNumbered() const { return numbered; } ///
/// int descent() const { return desc_; }
int getBaseline() const { return y; } ///
/// void ascent(int a) { asc_ = a; }
void setBaseline(int b) { y = b; } ///
/// void descent(int d) { desc_ = d; }
int ascent() const { return asc; } ///
/// int getTab(int i) const { return widths_[i]; }
int descent() const { return desc; } ///
/// void setLabel(string const & l) { label_ = l; }
void ascent(int a) { asc = a; } ///
/// void setNumbered(bool nf) { numbered_ = nf; }
void descent(int d) { desc = d; } ///
/// void setTab(int i, int t) { widths_[i] = t; }
int getTab(int i) const { return w[i]; } private:
/// /// Vericals
void setLabel(string const & l) { label = l; } int asc_;
/// int desc_;
void setNumbered(bool nf) { numbered = nf; } int y_;
/// /// widths
void setTab(int i, int t) { w[i] = t; } std::vector<int> widths_;
///
private: string label_;
/// Vericals ///
int asc, desc, y; bool numbered_;
/// widths ///
int * w; MathedRowSt * next_;
///
string label;
///
bool numbered;
///
MathedRowSt * next;
}; };