* Row: Use Dimension class.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19849 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2007-08-28 09:21:48 +00:00
parent 971c543b34
commit 378c7af432
2 changed files with 18 additions and 42 deletions

View File

@ -29,12 +29,12 @@ RowMetrics::RowMetrics()
Row::Row() Row::Row()
: pos_(0), end_(0), ascent_(0), descent_(0), width_(0) : pos_(0), end_(0)
{} {}
Row::Row(pos_type pos) Row::Row(pos_type pos)
: pos_(pos), end_(0), ascent_(0), descent_(0), width_(0) : pos_(pos), end_(0)
{} {}
@ -62,36 +62,12 @@ pos_type Row::endpos() const
} }
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 void Row::dump(const char * s) const
{ {
lyxerr << s << " pos: " << pos_ << " end: " << end_ lyxerr << s << " pos: " << pos_ << " end: " << end_
<< " width: " << width_ << " width: " << dim_.wid
<< " ascent: " << ascent_ << " ascent: " << dim_.asc
<< " descent: " << descent_ << " descent: " << dim_.des
<< std::endl; << std::endl;
} }

View File

@ -17,6 +17,8 @@
#include "support/types.h" #include "support/types.h"
#include "Dimension.h"
namespace lyx { namespace lyx {
@ -40,19 +42,21 @@ public:
/// ///
pos_type endpos() const; pos_type endpos() const;
/// ///
int height() const { return ascent_ + descent_; } Dimension const & dimension() const { return dim_; }
/// ///
void width(int w); int height() const { return dim_.height(); }
/// ///
int width() const; void width(int w) { dim_.wid = w; }
/// ///
void ascent(int b); int width() const { return dim_.wid; }
/// ///
int ascent() const; void ascent(int a) { dim_.asc = a; }
/// ///
void descent(int b) { descent_ = b; } int ascent() const { return dim_.asc; }
/// ///
int descent() const { return descent_; } void descent(int d) { dim_.des = d; }
///
int descent() const { return dim_.des; }
/// current debugging only /// current debugging only
void dump(const char * = "") const; void dump(const char * = "") const;
@ -61,12 +65,8 @@ private:
pos_type pos_; pos_type pos_;
/// one behind last pos covered by this row /// one behind last pos covered by this row
pos_type end_; pos_type end_;
/// /// Row dimension.
int ascent_; Dimension dim_;
///
int descent_;
///
int width_;
}; };