]> git.lyx.org Git - lyx.git/blobdiff - src/lyxfont.h
fix two crashes related to dEPM. Some crashes remain
[lyx.git] / src / lyxfont.h
index 58943b749b092c385caa35fb53d4cd849bc41ce8..8d0d3a26102418fb33c3c2dce3712750ad58d8bf 100644 (file)
@@ -221,7 +221,7 @@ public:
        ///
        LColor_color color() const;
        ///
-       Language const * language() const;
+       Language const * language() const { return lang; }
        ///
        bool isRightToLeft() const;
        ///
@@ -319,7 +319,15 @@ public:
        std::ostream & operator<<(std::ostream & os, LyXFont const & font);
 
        /// Converts logical attributes to concrete shape attribute
-       LyXFont::FONT_SHAPE realShape() const;
+       // Try hard to inline this as it shows up with 4.6 % in the profiler.
+       LyXFont::FONT_SHAPE realShape() const {
+               if (bits.noun == ON)
+                       return SMALLCAPS_SHAPE;
+               if (bits.emph == ON)
+                       return (bits.shape == UP_SHAPE) ? ITALIC_SHAPE : UP_SHAPE;
+               return bits.shape;
+       }
+
 
        /** Compaq cxx 6.5 requires that the definition be public so that
            it can compile operator==()