]> git.lyx.org Git - lyx.git/blobdiff - src/ParagraphMetrics.h
Limit the nopassthurchars case in beamer to URL
[lyx.git] / src / ParagraphMetrics.h
index e0d9ce054144893b64477ef1b88db42778050811..b572f122b550ebd80e7358e576d88be57b972734 100644 (file)
@@ -29,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,23 +69,31 @@ public:
        ///
        bool hfillExpansion(Row const & row, pos_type pos) const;
 
-       ///
-       int position() const { return position_; }
+       /// The vertical position of the baseline of the first line of the paragraph
+       int position() const;
        void setPosition(int position);
+       /// Set position to unknown
+       void resetPosition();
+       /// Return true when the position of the paragraph is known
+       bool hasPosition() const;
+       /// The vertical position of the top of the paragraph
+       int top() const { return position_ - dim_.ascent(); }
+       /// The vertical position of the bottom of the paragraph
+       int bottom() const { return position_ + dim_.descent(); }
        ///
        int id() const { return id_; }
 
 private:
        ///
-       int position_;
+       int position_ = 0;
        ///
-       int id_;
+       int id_ = -1;
        ///
        mutable RowList rows_;
        /// cached dimensions of paragraph
        Dimension dim_;
        ///
-       Paragraph const * par_;
+       Paragraph const * par_ = nullptr;
 };
 
 } // namespace lyx