]> git.lyx.org Git - features.git/blobdiff - src/Row.h
FindAdv: Small improvements
[features.git] / src / Row.h
index 2c60638f344d2731c32a452a2b28e776225fc873..6583fb21e82c2dc8c704c45261ffa282e9e7faf0 100644 (file)
--- a/src/Row.h
+++ b/src/Row.h
@@ -50,7 +50,10 @@ public:
                // An inset
                INSET,
                // Some spacing described by its width, not a string
-               SPACE
+               SPACE,
+               // Spacing until the left margin, with a minimal value given
+               // by the initial width
+               MARGINSPACE
        };
 
 /**
@@ -63,9 +66,6 @@ public:
                        : type(t), pos(p), endpos(p + 1), font(f), change(ch) {}
 
 
-               // Return the number of separator in the element (only STRING type)
-               int countSeparators() const;
-
                // Return total width of element, including separator overhead
                // FIXME: Cache this value or the number of expanders?
                double full_width() const { return dim.wid + extra * countExpanders(); }
@@ -119,9 +119,11 @@ public:
                pos_type pos;
                // first position after the element in the paragraph
                pos_type endpos;
-               // The dimension of the chunk (does not contains the
+               // The dimension of the chunk (does not contain the
                // separator correction)
                Dimension dim;
+               // The width of the element without trailing spaces
+               int nspc_wid = 0;
 
                // Non-zero only if element is an inset
                Inset const * inset = nullptr;
@@ -233,8 +235,6 @@ public:
        /// The offset of the right-most cursor position on the row
        int right_x() const;
 
-       // Return the number of separators in the row
-       int countSeparators() const;
        // Set the extra spacing for every expanding character in STRING-type
        // elements.  \param w is the total amount of extra width for the row to be
        // distributed among expanders.  \return false if the justification fails.
@@ -245,12 +245,14 @@ public:
                 Font const & f, Change const & ch);
        ///
        void add(pos_type pos, char_type const c,
-                Font const & f, Change const & ch, bool can_break);
+                Font const & f, Change const & ch);
        ///
        void addVirtual(pos_type pos, docstring const & s,
                        Font const & f, Change const & ch);
        ///
        void addSpace(pos_type pos, int width, Font const & f, Change const & ch);
+       ///
+       void addMarginSpace(pos_type pos, int width, Font const & f, Change const & ch);
 
        ///
        typedef std::vector<Element> Elements;