+2001-03-12 André Pönitz <poenitz@htwm.de>
+ * math_rowst.h: replace MathedRowSt with MathedRowSt,
+ more robust MathedRowSt::[gs]etTab (to get rid of the constructor arg)
+
2001-03-10 André Pönitz <poenitz@htwm.de>
* math_xiter.[Ch]:
math_matrixinset.C: move adjustVerticalSt to the only place where
///
void descent(int d);
///
- int getTab(int i) const;
+ int getTab(unsigned int i) const;
///
void setLabel(string const & l);
///
void setNumbered(bool nf);
///
- void setTab(int i, int t);
+ void setTab(unsigned int i, int t);
///
friend class MathedRowSt;
protected:
explicit MathedRowSt(int n)
: MathedRowStruct(n), next_(0)
{}
+ explicit MathedRowSt(MathedRowStruct const & t)
+ : MathedRowStruct(t), next_(0)
+ {}
//private:
///
MathedRowSt * next_;
bool empty() const { return data_ == 0; }
/// insert 'item' before 'iterator'
- void insert(iterator const & it, MathedRowSt const & item) {
+ void insert(iterator const & it, MathedRowStruct const & item) {
MathedRowSt * r = new MathedRowSt(item);
if (data_ == it.st_)
data_ = r;
}
/// insert 'item' after 'iterator'
- void insert_after(iterator & it, MathedRowSt const & item) {
+ void insert_after(iterator & it, MathedRowStruct const & item) {
MathedRowSt * r = new MathedRowSt(item);
if (it) {
r->next_ = it.st_->next_;
inline
-int MathedRowStruct::getTab(int i) const
+int MathedRowStruct::getTab(unsigned int i) const
{
- return widths_[i];
+ return i < widths_.size() ? widths_[i] : 0;
}
inline
-void MathedRowStruct::setTab(int i, int t)
+void MathedRowStruct::setTab(unsigned int i, int t)
{
+ if (i >= widths_.size())
+ widths_.resize(i + 2);
widths_[i] = t;
}
#endif