]> git.lyx.org Git - features.git/commitdiff
* Row: Use Dimension class.
authorAbdelrazak Younes <younes@lyx.org>
Tue, 28 Aug 2007 09:21:48 +0000 (09:21 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Tue, 28 Aug 2007 09:21:48 +0000 (09:21 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19849 a592a061-630c-0410-9148-cb99ea01b6c8

src/Row.cpp
src/Row.h

index 8651763d88f2a548019b79a2866d0062d10deef0..61ae559a166cb57e1c9f2200d71567887615bb83 100644 (file)
@@ -29,12 +29,12 @@ RowMetrics::RowMetrics()
 
 
 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)
 {}
 
 
@@ -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
 {
        lyxerr << s << " pos: " << pos_ << " end: " << end_
-               << " width: " << width_
-               << " ascent: " << ascent_
-               << " descent: " << descent_
+               << " width: " << dim_.wid
+               << " ascent: " << dim_.asc
+               << " descent: " << dim_.des
                << std::endl;
 }
 
index 7d9a891fd13d2a0c16173375f6d152ed65bdabf3..e93ea8735d8806a8c8479933bf0b1569e4f45589 100644 (file)
--- a/src/Row.h
+++ b/src/Row.h
@@ -17,6 +17,8 @@
 
 #include "support/types.h"
 
+#include "Dimension.h"
+
 
 namespace lyx {
 
@@ -40,19 +42,21 @@ public:
        ///
        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;
 
@@ -61,12 +65,8 @@ private:
        pos_type pos_;
        /// one behind last pos covered by this row
        pos_type end_;
-       ///
-       int ascent_;
-       ///
-       int descent_;
-       ///
-       int width_;
+       /// Row dimension.
+       Dimension dim_;
 };