]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/MathFactory.cpp
add busy.gif to resources (in line with cmake)
[lyx.git] / src / mathed / MathFactory.cpp
index 6a5112925c690ed7938c67a281646dfa742ab2cc..ab290cb369bd2733b798ffba230152a308131170 100644 (file)
@@ -44,6 +44,7 @@
 #include "InsetMathHull.h"
 #include "InsetMathXArrow.h"
 #include "InsetMathXYMatrix.h"
+#include "InsetMathDiagram.h"
 #include "MacroTable.h"
 #include "MathMacro.h"
 #include "MathMacroArgument.h"
@@ -417,6 +418,9 @@ MathAtom createInsetMath(docstring const & s, Buffer * buf)
                return MathAtom(new InsetMathXYMatrix(buf, spacing, spacing_code,
                        equal_spacing));
        }
+
+       if (s == "Diagram")
+               return MathAtom(new InsetMathDiagram(buf));
        if (s == "xrightarrow" || s == "xleftarrow")
                return MathAtom(new InsetMathXArrow(buf, s));
        if (s == "split" || s == "alignedat")
@@ -516,7 +520,7 @@ bool createInsetMath_fromDialogStr(docstring const & str, MathData & ar)
        if (name == "ref") {
                InsetCommandParams icp(REF_CODE);
                // FIXME UNICODE
-               InsetCommand::string2params("ref", to_utf8(str), icp);
+               InsetCommand::string2params(to_utf8(str), icp);
                Encoding const * const utf8 = encodings.fromLyXName("utf8");
                OutputParams op(utf8);
                mathed_parse_cell(ar, icp.getCommand(op));
@@ -524,11 +528,12 @@ bool createInsetMath_fromDialogStr(docstring const & str, MathData & ar)
                InsetSpaceParams isp(true);
                InsetSpace::string2params(to_utf8(str), isp);
                InsetSpace is(isp);
-               odocstringstream os;
+               odocstringstream ods;
+               otexstream os(ods);
                Encoding const * const ascii = encodings.fromLyXName("ascii");
                OutputParams op(ascii);
                is.latex(os, op);
-               mathed_parse_cell(ar, os.str());
+               mathed_parse_cell(ar, ods.str());
                if (ar.size() == 2) {
                        // remove "{}"
                        if (ar[1].nucleus()->asBraceInset())