Row::Row()
- : pos_(0), end_(0), ascent_(0), descent_(0), width_(0)
+ : pos_(0), end_(0)
{}
Row::Row(pos_type pos)
- : pos_(pos), end_(0), ascent_(0), descent_(0), width_(0)
+ : pos_(pos), end_(0)
{}
}
-void Row::width(int w)
-{
- width_ = w;
-}
-
-
-int Row::width() const
-{
- return width_;
-}
-
-
-void Row::ascent(int b)
-{
- ascent_ = b;
-}
-
-
-int Row::ascent() const
-{
- return ascent_;
-}
-
-
void Row::dump(const char * s) const
{
lyxerr << s << " pos: " << pos_ << " end: " << end_
- << " width: " << width_
- << " ascent: " << ascent_
- << " descent: " << descent_
+ << " width: " << dim_.wid
+ << " ascent: " << dim_.asc
+ << " descent: " << dim_.des
<< std::endl;
}
#include "support/types.h"
+#include "Dimension.h"
+
namespace lyx {
///
pos_type endpos() const;
///
- int height() const { return ascent_ + descent_; }
+ Dimension const & dimension() const { return dim_; }
+ ///
+ int height() const { return dim_.height(); }
///
- void width(int w);
+ void width(int w) { dim_.wid = w; }
///
- int width() const;
+ int width() const { return dim_.wid; }
///
- void ascent(int b);
+ void ascent(int a) { dim_.asc = a; }
///
- int ascent() const;
+ int ascent() const { return dim_.asc; }
///
- void descent(int b) { descent_ = b; }
+ void descent(int d) { dim_.des = d; }
///
- int descent() const { return descent_; }
+ int descent() const { return dim_.des; }
/// current debugging only
void dump(const char * = "") const;
pos_type pos_;
/// one behind last pos covered by this row
pos_type end_;
- ///
- int ascent_;
- ///
- int descent_;
- ///
- int width_;
+ /// Row dimension.
+ Dimension dim_;
};