]> git.lyx.org Git - lyx.git/blobdiff - src/ParagraphMetrics.h
tex2lyx: fix import of umlauts and ß in math (#12739)
[lyx.git] / src / ParagraphMetrics.h
index 2e57f834d9b38b606aeb34ecda83b0bd9e6767db..0d186f158bc217917d0d563d47a7592871892061 100644 (file)
 #include "Dimension.h"
 #include "Row.h"
 
-#include <vector>
-
 namespace lyx {
 
-/**
- * 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;
-
 class BufferView;
 class Paragraph;
 
@@ -38,7 +29,7 @@ class Paragraph;
 class ParagraphMetrics {
 public:
        /// Default constructor (only here for STL containers).
-       ParagraphMetrics() : position_(0), par_(0) {}
+       ParagraphMetrics() {}
        /// The only useful constructor.
        explicit ParagraphMetrics(Paragraph const & par);
 
@@ -69,6 +60,8 @@ public:
        RowList const & rows() const { return rows_; }
        ///
        int rightMargin(BufferView const & bv) const;
+       ///
+       Paragraph const & par() const { return *par_; }
 
        /// dump some information to lyxerr
        void dump() const;
@@ -79,16 +72,20 @@ public:
        ///
        int position() const { return position_; }
        void setPosition(int position);
+       ///
+       int id() const { return id_; }
 
 private:
        ///
-       int position_;
+       int position_ = 0;
+       ///
+       int id_ = -1;
        ///
        mutable RowList rows_;
        /// cached dimensions of paragraph
        Dimension dim_;
        ///
-       Paragraph const * par_;
+       Paragraph const * par_ = nullptr;
 };
 
 } // namespace lyx