commit bc9215e15874d42cdeba752cc9ab48c7a8467cf9
Author: Jean-Marc Lasgouttes <lasgout...@lyx.org>
Date:   Thu Mar 6 13:58:13 2025 +0100

    Rename RowList to Rows and move its definition to ParagraphMetrics.h
    
    There is another RowList in TexRow.
---
 src/ParagraphMetrics.cpp            |  4 ++--
 src/ParagraphMetrics.h              | 15 ++++++++++++---
 src/Row.h                           |  7 -------
 src/TextMetrics.cpp                 |  8 ++++----
 src/TextMetrics.h                   |  2 +-
 src/frontends/qt/GuiInputMethod.cpp |  2 +-
 6 files changed, 20 insertions(+), 18 deletions(-)

diff --git a/src/ParagraphMetrics.cpp b/src/ParagraphMetrics.cpp
index b6058a897e..34edaff167 100644
--- a/src/ParagraphMetrics.cpp
+++ b/src/ParagraphMetrics.cpp
@@ -104,8 +104,8 @@ size_t ParagraphMetrics::getRowIndex(pos_type pos, bool 
boundary) const
        if (pos > 0 && boundary)
                --pos;
 
-       RowList::const_iterator rit = rows_.end();
-       RowList::const_iterator const begin = rows_.begin();
+       Rows::const_iterator rit = rows_.end();
+       Rows::const_iterator const begin = rows_.begin();
 
        for (--rit; rit != begin && rit->pos() > pos; --rit)
                ;
diff --git a/src/ParagraphMetrics.h b/src/ParagraphMetrics.h
index 15f2d61749..c1749947aa 100644
--- a/src/ParagraphMetrics.h
+++ b/src/ParagraphMetrics.h
@@ -20,11 +20,20 @@
 #include "Dimension.h"
 #include "Row.h"
 
+#include <vector>
+
 namespace lyx {
 
 class BufferView;
 class Paragraph;
 
+/**
+ * Each paragraph is broken up into a number of rows on the screen.
+ * This is a list of such on-screen rows, ordered from the top row
+ * downwards.
+ */
+typedef std::vector<Row> Rows;
+
 /// Helper class for paragraph metrics.
 class ParagraphMetrics {
 public:
@@ -55,9 +64,9 @@ public:
        /// descend of paragraph below baseline
        int descent() const { return dim_.descent(); }
        /// Text updates the rows using this access point
-       RowList & rows() { return rows_; }
+       Rows & rows() { return rows_; }
        /// The painter and others use this
-       RowList const & rows() const { return rows_; }
+       Rows const & rows() const { return rows_; }
        ///
        int rightMargin(BufferView const & bv) const;
        ///
@@ -89,7 +98,7 @@ private:
        ///
        int id_ = -1;
        ///
-       mutable RowList rows_;
+       mutable Rows rows_;
        /// cached dimensions of paragraph
        Dimension dim_;
        ///
diff --git a/src/Row.h b/src/Row.h
index e5c7659ae9..62ea6fb4c6 100644
--- a/src/Row.h
+++ b/src/Row.h
@@ -426,13 +426,6 @@ private:
 std::ostream & operator<<(std::ostream & os, Row::Elements const & elts);
 
 
-/**
- * Each paragraph is broken up into a number of rows on the screen.
- * This is a list of such on-screen rows, ordered from the top row
- * downwards.
- */
-typedef std::vector<Row> RowList;
-
 } // namespace lyx
 
 #endif
diff --git a/src/TextMetrics.cpp b/src/TextMetrics.cpp
index 757dfd1e5c..32adfb47a8 100644
--- a/src/TextMetrics.cpp
+++ b/src/TextMetrics.cpp
@@ -1198,9 +1198,9 @@ bool needsRowBreak(int f1, int f2)
 }
 
 
-RowList TextMetrics::breakParagraph(Row const & bigrow) const
+Rows TextMetrics::breakParagraph(Row const & bigrow) const
 {
-       RowList rows;
+       Rows rows;
        bool const is_rtl = text_->isRTL(bigrow.pit());
        bool const end_label = text_->getEndLabel(bigrow.pit()) != 
END_LABEL_NO_LABEL;
        pos_type const bigrow_endpos =
@@ -1560,8 +1560,8 @@ Row const * TextMetrics::getRowNearY(int & y)
 
        int yy = pm.top();
        LBUFERR(!pm.rows().empty());
-       RowList::const_iterator rit = pm.rows().begin();
-       RowList::const_iterator rlast = pm.rows().end();
+       Rows::const_iterator rit = pm.rows().begin();
+       Rows::const_iterator rlast = pm.rows().end();
        --rlast;
        for (; rit != rlast; yy += rit->height(), ++rit)
                if (yy + rit->height() > y)
diff --git a/src/TextMetrics.h b/src/TextMetrics.h
index e7b03939c4..ec05b302e6 100644
--- a/src/TextMetrics.h
+++ b/src/TextMetrics.h
@@ -171,7 +171,7 @@ private:
        Row tokenizeParagraph(pit_type pit) const;
 
        // Break the row produced by tokenizeParagraph() into a list of rows.
-       RowList breakParagraph(Row const & row) const;
+       Rows breakParagraph(Row const & row) const;
 
        // Expands the alignment of row \param row in paragraph \param par
        LyXAlignment getAlign(Paragraph const & par, Row const & row) const;
diff --git a/src/frontends/qt/GuiInputMethod.cpp 
b/src/frontends/qt/GuiInputMethod.cpp
index 372811a75e..c983500f64 100644
--- a/src/frontends/qt/GuiInputMethod.cpp
+++ b/src/frontends/qt/GuiInputMethod.cpp
@@ -67,7 +67,7 @@ struct GuiInputMethod::Private
 
        InputMethodState im_state_;
 
-       RowList::iterator rows_;
+       Rows::iterator rows_;
        size_type rows_size_;
 
        pos_type * cur_pos_ptr_ = nullptr;
-- 
lyx-cvs mailing list
lyx-cvs@lists.lyx.org
https://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to