]> git.lyx.org Git - lyx.git/blobdiff - src/text.C
fix some C++ parsing bugs
[lyx.git] / src / text.C
index 27737df2376b9205928b2a315f46e955414c0f8d..396ca0e08c624e60a88964c65e89f749cc2de263 100644 (file)
@@ -78,7 +78,7 @@ int LyXText::top_y() const
                return 0;
 
        int y = 0;
-       for (Row * row = firstrow;
+       for (Row * row = firstRow();
             row && row != anchor_row_; row = row->next()) {
                y += row->height();
        }
@@ -88,7 +88,7 @@ int LyXText::top_y() const
 
 void LyXText::top_y(int newy)
 {
-       if (!firstrow)
+       if (!firstRow())
                return;
        lyxerr[Debug::GUI] << "setting top y = " << newy << endl;
 
@@ -300,7 +300,7 @@ int LyXText::singleWidth(Paragraph * par,
 }
 
 
-lyx::pos_type LyXText::log2vis(lyx::pos_type pos) const 
+lyx::pos_type LyXText::log2vis(lyx::pos_type pos) const
 {
        if (bidi_start == -1)
                return pos;
@@ -309,7 +309,7 @@ lyx::pos_type LyXText::log2vis(lyx::pos_type pos) const
 }
 
 
-lyx::pos_type LyXText::vis2log(lyx::pos_type pos) const 
+lyx::pos_type LyXText::vis2log(lyx::pos_type pos) const
 {
        if (bidi_start == -1)
                return pos;
@@ -318,7 +318,7 @@ lyx::pos_type LyXText::vis2log(lyx::pos_type pos) const
 }
 
 
-lyx::pos_type LyXText::bidi_level(lyx::pos_type pos) const 
+lyx::pos_type LyXText::bidi_level(lyx::pos_type pos) const
 {
        if (bidi_start == -1)
                return 0;
@@ -327,7 +327,7 @@ lyx::pos_type LyXText::bidi_level(lyx::pos_type pos) const
 }
 
 
-bool LyXText::bidi_InRange(lyx::pos_type pos) const 
+bool LyXText::bidi_InRange(lyx::pos_type pos) const
 {
        return bidi_start == -1 ||
                (bidi_start <= pos && pos <= bidi_end);
@@ -1299,7 +1299,7 @@ void LyXText::setHeightOfRow(Row * row)
        }
        row->width(int(maxwidth + x));
        if (inset_owner) {
-               Row * r = firstrow;
+               Row * r = firstRow();
                width = max(0, workWidth());
                while (r) {
                        if (r->width() > width)
@@ -1326,7 +1326,6 @@ void LyXText::appendParagraph(Row * row)
                        ++z;
                        insertRow(row, row->par(), z);
                        row = row->next();
-                       row->height(0);
                } else {
                        done = true;
                }
@@ -1341,29 +1340,6 @@ void LyXText::appendParagraph(Row * row)
 }
 
 
-// Do we even need this at all ? Code that uses  RowPainter *already*
-// sets need_break_row when it sees a CHANGED_IN_DRAW, though not
-// quite like this
-void LyXText::markChangeInDraw(Row * row, Row * prev)
-{
-       if (prev && prev->par() == row->par()) {
-               breakAgainOneRow(prev);
-               if (prev->next() != row) {
-                       // breakAgainOneRow() has removed row_
-                       need_break_row = prev;
-               } else {
-                       need_break_row = row;
-               }
-       } else if (!prev) {
-               need_break_row = firstrow;
-       } else {
-               need_break_row = prev->next();
-       }
-       setCursor(cursor.par(), cursor.pos());
-       /* FIXME */
-}
-
-
 void LyXText::breakAgain(Row * row)
 {
        bool not_ready = true;
@@ -1378,7 +1354,6 @@ void LyXText::breakAgain(Row * row)
                                ++z;
                                insertRow(row, row->par(), z);
                                row = row->next();
-                               row->height(0);
                        } else  {
                                row = row->next();
                                ++z;
@@ -1422,7 +1397,6 @@ void LyXText::breakAgainOneRow(Row * row)
                        ++z;
                        insertRow(row, row->par(), z);
                        row = row->next();
-                       row->height(0);
                } else  {
                        row = row->next();
                        ++z;
@@ -1540,7 +1514,6 @@ void LyXText::breakParagraph(ParagraphList & paragraphs, char keep_layout)
           cursor.par()->next()->erase(0);
 
        insertParagraph(cursor.par()->next(), cursor.row());
-
        updateCounters();
 
        // This check is necessary. Otherwise the new empty paragraph will
@@ -2790,10 +2763,10 @@ void LyXText::backspace()
 // returns pointer to a specified row
 Row * LyXText::getRow(Paragraph * par, pos_type pos, int & y) const
 {
-       if (!firstrow)
+       if (!firstRow())
                return 0;
 
-       Row * tmprow = firstrow;
+       Row * tmprow = firstRow();
        y = 0;
 
        // find the first row of the specified paragraph
@@ -2819,7 +2792,7 @@ Row * LyXText::getRowNearY(int & y) const
 {
 #if 1
        // If possible we should optimize this method. (Lgb)
-       Row * tmprow = firstrow;
+       Row * tmprow = firstRow();
        int tmpy = 0;
 
        while (tmprow->next() && tmpy + tmprow->height() <= y) {