]> git.lyx.org Git - features.git/commitdiff
mathedSymbolDim only needs a MathBase
authorGuillaume Munch <gm@lyx.org>
Sun, 20 Nov 2016 21:34:03 +0000 (22:34 +0100)
committerGuillaume Munch <gm@lyx.org>
Sun, 20 Nov 2016 23:08:11 +0000 (00:08 +0100)
src/mathed/InsetMathChar.cpp
src/mathed/InsetMathSymbol.cpp
src/mathed/MathSupport.cpp
src/mathed/MathSupport.h

index a2b9b76069d86509bb1e67be05c9fd7b71329ba2..1fef2209a54c09bd3601ea4d86621ef10f31883f 100644 (file)
@@ -109,7 +109,7 @@ void InsetMathChar::metrics(MetricsInfo & mi, Dimension & dim) const
        if (mathfont && subst_) {
                // If the char has a substitute, draw the replacement symbol
                // instead, but only in math mode.
-               mathedSymbolDim(mi, dim, subst_);
+               mathedSymbolDim(mi.base, dim, subst_);
                kerning_ = mathed_char_kerning(mi.base.font, *subst_->draw.rbegin());
                return;
        } else if (!slanted(char_) && mi.base.fontname == "mathnormal") {
index 885aa60f01f911c57ebcd9f54f221d50b57d9987..92d2573560a4ad808141d0d999f7263ac77012ea 100644 (file)
@@ -61,7 +61,7 @@ docstring InsetMathSymbol::name() const
 void InsetMathSymbol::metrics(MetricsInfo & mi, Dimension & dim) const
 {
        // set dim
-       mathedSymbolDim(mi, dim, sym_);
+       mathedSymbolDim(mi.base, dim, sym_);
        // set kerning_
        kerning_ = mathed_char_kerning(mi.base.font, *sym_->draw.rbegin());
        // correct height for broken cmex and wasy font
index 3d708406d3c2cfe9a5dbc8dd248d6d7935b7bbbf..16fbbcd4be0be7816302fce8560f550ce1a91431 100644 (file)
@@ -660,7 +660,7 @@ void mathed_draw_deco(PainterInfo & pi, int x, int y, int w, int h,
 }
 
 
-void mathedSymbolDim(MetricsInfo & mi, Dimension & dim, latexkeys const * sym)
+void mathedSymbolDim(MetricsBase & mb, Dimension & dim, latexkeys const * sym)
 {
        LASSERT((bool)sym, return);
        //lyxerr << "metrics: symbol: '" << sym->name
@@ -670,10 +670,10 @@ void mathedSymbolDim(MetricsInfo & mi, Dimension & dim, latexkeys const * sym)
 
        bool const italic_upcase_greek = sym->inset == "cmr" &&
                sym->extra == "mathalpha" &&
-               mi.base.fontname == "mathit";
+               mb.fontname == "mathit";
        std::string const font = italic_upcase_greek ? "cmm" : sym->inset;
-       Changer dummy = mi.base.changeFontSet(font);
-       mathed_string_dim(mi.base.font, sym->draw, dim);
+       Changer dummy = mb.changeFontSet(font);
+       mathed_string_dim(mb.font, sym->draw, dim);
 }
 
 
index 003631b8ae3bf0f2385b64c1ad5e11e05f7f059b..b7e3c7c39b850afacce113c7b8549cad1002f193 100644 (file)
@@ -18,6 +18,7 @@
 
 namespace lyx {
 
+class MetricsBase;
 class MetricsInfo;
 class PainterInfo;
 class FontInfo;
@@ -49,7 +50,7 @@ void mathed_string_dim(FontInfo const & font,
 
 int mathed_string_width(FontInfo const &, docstring const & s);
 
-void mathedSymbolDim(MetricsInfo & mi, Dimension & dim, latexkeys const * sym);
+void mathedSymbolDim(MetricsBase & mb, Dimension & dim, latexkeys const * sym);
 
 void mathedSymbolDraw(PainterInfo & pi, int x, int y, latexkeys const * sym);