]> git.lyx.org Git - lyx.git/blobdiff - src/FontList.h
fix a crash when the inset containing the new word at cursor is deleted
[lyx.git] / src / FontList.h
index 86824bb55da5afaa56ccca16a1cd93a05a1ec1c2..61ab2205f244d3d78f122ff7cf13d1d4e560dc6e 100644 (file)
@@ -56,21 +56,13 @@ private:
        paragraph or, in the case of nested paragraphs, from the
        layout in the environment one level up until completely
        resolved.
        paragraph or, in the case of nested paragraphs, from the
        layout in the environment one level up until completely
        resolved.
-       The values Font::IGNORE_* and Font::TOGGLE are NOT
+       The values Font::IGNORE_* and FONT_TOGGLE are NOT
        allowed in these font tables.
        */
        Font font_;
 };
 
        allowed in these font tables.
        */
        Font font_;
 };
 
-
-class matchFT
-{
-public:
-       /// used by lower_bound and upper_bound
-       int operator()(FontTable const & a, FontTable const & b) const {
-               return a.pos() < b.pos();
-       }
-};
+class LaTeXFeatures;
 
 ///
 class FontList
 
 ///
 class FontList
@@ -92,6 +84,8 @@ public:
        ///
        bool empty() const { return list_.empty(); }
        ///
        ///
        bool empty() const { return list_.empty(); }
        ///
+       void clear() { list_.clear(); }
+       ///
        void erase(pos_type pos);
        ///
        iterator fontIterator(pos_type pos);
        void erase(pos_type pos);
        ///
        iterator fontIterator(pos_type pos);
@@ -102,10 +96,31 @@ public:
        ///
        void set(pos_type pos, Font const & font);
        ///
        ///
        void set(pos_type pos, Font const & font);
        ///
+       void setRange(
+               pos_type startpos,
+               pos_type endpos,
+               Font const & font);
+       ///
        void increasePosAfterPos(pos_type pos);
        ///
        void decreasePosAfterPos(pos_type pos);
 
        void increasePosAfterPos(pos_type pos);
        ///
        void decreasePosAfterPos(pos_type pos);
 
+       /// Returns the height of the highest font in range
+       FontSize highestInRange(
+               pos_type startpos,
+               pos_type endpos,
+               FontSize def_size
+               ) const;
+
+       /// is there a font change in middle of the word?
+       bool hasChangeInRange(
+               pos_type pos, ///< position in the paragraph.
+               int len ///< length of the range to check.
+               ) const;
+
+       ///
+       void validate(LaTeXFeatures & features) const;
+
 private:
        ///
        List list_;
 private:
        ///
        List list_;