]> git.lyx.org Git - features.git/blobdiff - src/ParagraphMetrics.h
Transfer Paragraph::hfillExpansion() to ParagraphMetrics. This also reduce the depend...
[features.git] / src / ParagraphMetrics.h
index 6d9a3fa828ca74b9e3195dd098223710e78cc3f4..42f6d8720472fb629b4ba0705080fa7696e7a4ee 100644 (file)
@@ -17,7 +17,9 @@
 #ifndef PARAGRAPH_METRICS_H
 #define PARAGRAPH_METRICS_H
 
+#include "Dimension.h"
 #include "Paragraph.h"
+#include "Row.h"
 
 namespace lyx {
 
@@ -40,11 +42,10 @@ public:
        ParagraphMetrics(Paragraph const & par);
 
        /// Copy operator.
-       /// Important note: We don't copy \c row_change_status_ and
-       /// \c row_signature_ because those are updated externally with
-       /// \c updateRowChangeStatus() in TextMetrics::redoParagraph().
        ParagraphMetrics & operator=(ParagraphMetrics const &);
 
+       void reset(Paragraph const & par);
+
        ///
        Row & getRow(pos_type pos, bool boundary);
        ///
@@ -67,28 +68,23 @@ public:
        RowList & rows() { return rows_; }
        /// The painter and others use this
        RowList const & rows() const { return rows_; }
-       /// The painter and others use this
-       std::vector<bool> const & rowChangeStatus() const
-       { return row_change_status_; }
-       ///
-       void updateRowChangeStatus();
        ///
        int rightMargin(Buffer const & buffer) const;
+       ///
+       int singleWidth(pos_type pos, Font const & Font) const;
 
        /// dump some information to lyxerr
        void dump() const;
 
-private:
-       ///
-       typedef std::vector<size_type> RowSignature;
        ///
-       size_type calculateRowSignature(Row const &);
+       bool hfillExpansion(Row const & row, pos_type pos) const;
+
+       /// 
+       void computeRowSignature(Row &, BufferParams const & bparams);
+
+private:
        ///
        mutable RowList rows_;
-       ///
-       RowSignature row_signature_;
-       ///
-       std::vector<bool> row_change_status_;
        /// cached dimensions of paragraph
        Dimension dim_;
        ///