]> git.lyx.org Git - lyx.git/blobdiff - src/texrow.h
Fix small bug in reading \set_color in lyxrc
[lyx.git] / src / texrow.h
index 6de80a927b1637e9fda0c48762287e52ad8a80f5..2013ff1a2ca44a7b09dffa5c7e48ef5a80bacfce 100644 (file)
@@ -17,7 +17,6 @@
 #endif
 
 #include <list>
-using std::list;
 
 class LyXParagraph;
 
@@ -25,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();
@@ -46,27 +41,51 @@ 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;
        ///
-       typedef list<RowItem> RowList;
+       typedef std::list<RowItem> RowList;
        ///
        RowList rowlist;
        /// Last paragraph