]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/MathFactory.cpp
use FileName::isDirectory()
[lyx.git] / src / mathed / MathFactory.cpp
index a034542f29e7ebe06e7958de2edb4e883970e98b..00e90f7785f3f2a289655a4aa3b84e2c9e0082eb 100644 (file)
@@ -87,7 +87,7 @@ WordList theWordList;
 
 bool math_font_available(docstring & name)
 {
-       LyXFont f;
+       Font f;
        augmentFont(f, name);
 
        // Do we have the font proper?
@@ -175,11 +175,12 @@ void initSymbols()
                        // create fallbacks if necessary
 
                        // store requirements as long as we can
-                       if (tmp.requires.empty() &&
-                           (tmp.inset == "msa" || tmp.inset == "msb"))
-                               tmp.requires = from_ascii("amssymb");
-                       else if (tmp.inset == "wasy")
-                               tmp.requires = from_ascii("wasysym");
+                       if (tmp.requires.empty()) {
+                               if (tmp.inset == "msa" || tmp.inset == "msb")
+                                       tmp.requires = from_ascii("amssymb");
+                               else if (tmp.inset == "wasy")
+                                       tmp.requires = from_ascii("wasysym");
+                       }
 
                        // symbol font is not available sometimes
                        docstring symbol_font = from_ascii("lyxsymbol");
@@ -259,7 +260,7 @@ MathAtom createInsetMath(char const * const s)
 
 MathAtom createInsetMath(docstring const & s)
 {
-       //lyxerr << "creating inset with name: '" << s << '\'' << endl;
+       //lyxerr << "creating inset with name: '" << to_utf8(s) << '\'' << endl;
        latexkeys const * l = in_word_set(s);
        if (l) {
                docstring const & inset = l->inset;
@@ -369,6 +370,15 @@ MathAtom createInsetMath(docstring const & s)
                return MathAtom(new InsetMathFrac(InsetMathFrac::OVER));
        if (s == "nicefrac")
                return MathAtom(new InsetMathFrac(InsetMathFrac::NICEFRAC));
+       if (s == "unitfrac")
+               return MathAtom(new InsetMathFrac(InsetMathFrac::UNITFRAC));
+       // This string value is only for math toolbar use. Not a LaTeX name
+       if (s == "unitfracthree")
+               return MathAtom(new InsetMathFrac(InsetMathFrac::UNITFRAC, 3));
+       if (s == "unitone")
+               return MathAtom(new InsetMathFrac(InsetMathFrac::UNIT, 1));
+       if (s == "unittwo")
+               return MathAtom(new InsetMathFrac(InsetMathFrac::UNIT));
        //if (s == "infer")
        //      return MathAtom(new MathInferInset);
        if (s == "atop")