]> git.lyx.org Git - lyx.git/blobdiff - src/texrow.h
Small fix.
[lyx.git] / src / texrow.h
index 674d3c58dc8060a652d04ca353c05d2d5730dc11..2013ff1a2ca44a7b09dffa5c7e48ef5a80bacfce 100644 (file)
@@ -24,11 +24,7 @@ class LyXParagraph;
 class TexRow {
 public:
        ///
-       TexRow() {
-               count = 0;
-               lastpar = 0;
-               lastpos = -1;
-       }
+       TexRow() : count(0), lastpar(0), lastpos(-1) {}
 
        /// Clears structure
        void reset();
@@ -45,22 +41,46 @@ public:
        /// Appends another TexRow
        TexRow & operator+= (TexRow const &);
 
+       /// Returns the number of rows in this texrow
+       int rows() const { return count; }
+
 private:
        /// Linked list of items
-       struct RowItem {
+       class RowItem {
+       public:
+               ///
+               RowItem() : id_(-1), pos_(-1), rownumber_(0) {}
                ///
-               RowItem() {
-                       id = -1;
-                       pos = -1;
-                       rownumber = 0;
+               void id(int i) {
+                       id_ = i;
                }
-
                ///
-               int id;
+               int id() const {
+                       return id_;
+               }
+               ///
+               void pos(int p) {
+                       pos_ = p;
+               }
+               ///
+               int pos() const {
+                       return pos_;
+               }
+               ///
+               void rownumber(int r) {
+                       rownumber_ = r;
+               }
+               ///
+               int rownumber() const {
+                       return rownumber_;
+               }
+       private:
+               ///
+               int id_;
                ///
-               int pos;
+               int pos_;
                ///
-               int rownumber;
+               int rownumber_;
        };
        ///
        unsigned int count;