]> git.lyx.org Git - lyx.git/blobdiff - src/Length.cpp
Factor code for math axis height
[lyx.git] / src / Length.cpp
index d862f40213d3a4bdea1e834bc0f3cf586d1b1616..62b7c842f8f8bf509a06406cb27af5c9023d2466 100644 (file)
@@ -300,7 +300,14 @@ double Length::inInch(double text_width, double em_width) const
 
 int Length::inPixels(MetricsBase const & base) const
 {
-       return inPixels(base.textwidth, theFontMetrics(base.font).em());
+       FontInfo fi = base.font;
+       if (unit_ == Length::MU)
+               // mu is 1/18th of an em in the math symbol font
+               fi.setFamily(SYMBOL_FAMILY);
+       else
+               // Math style is only taken into account in the case of mu
+               fi.setStyle(LM_ST_TEXT);
+       return inPixels(base.textwidth, theFontMetrics(fi).em());
 }
 
 
@@ -355,6 +362,8 @@ GlueLength::GlueLength(Length const & len, Length const & plus,
 
 GlueLength::GlueLength(string const & data)
 {
+       // false positive from coverity
+       // coverity[CHECKED_RETURN]
        isValidGlueLength(data, this);
 }