]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathSpace.cpp
add busy.gif to resources (in line with cmake)
[lyx.git] / src / mathed / InsetMathSpace.cpp
index bd426008cdab96a9d78ff729a695a5caf4690754..cede32a7865a5860e24ba97dab56072e68fd50a6 100644 (file)
@@ -207,6 +207,40 @@ void InsetMathSpace::mathmlize(MathStream & ms) const
 }
 
        
+void InsetMathSpace::htmlize(HtmlStream & ms) const
+{
+       SpaceInfo const & si = space_info[space_];
+       switch (si.kind) {
+       case InsetSpaceParams::THIN:
+               ms << from_ascii("&thinsp;");
+               break;
+       case InsetSpaceParams::MEDIUM:
+               ms << from_ascii("&nbsp;");
+               break;
+       case InsetSpaceParams::THICK:
+               ms << from_ascii("&emsp;");
+               break;
+       case InsetSpaceParams::ENSKIP:
+               ms << from_ascii("&ensp;");
+               break;
+       case InsetSpaceParams::QUAD:
+               ms << from_ascii("&emsp;");
+               break;
+       case InsetSpaceParams::QQUAD:
+               ms << from_ascii("&emsp;&emsp;");
+               break;
+       case InsetSpaceParams::CUSTOM: {
+               string l = length_.asHTMLString();
+               ms << MTag("span", "width='" + l + "'") 
+                  << from_ascii("&nbsp;") << ETag("span");
+               break;
+       }
+       default:
+               break;
+       }
+}
+
+       
 void InsetMathSpace::normalize(NormalStream & os) const
 {
        os << "[space " << int(space_) << "] ";
@@ -234,7 +268,7 @@ InsetSpaceParams InsetMathSpace::params() const
 }
 
 
-docstring InsetMathSpace::contextMenu(BufferView const &, int, int) const
+docstring InsetMathSpace::contextMenuName() const
 {
        return from_ascii("context-mathspace");
 }
@@ -243,7 +277,7 @@ docstring InsetMathSpace::contextMenu(BufferView const &, int, int) const
 bool InsetMathSpace::getStatus(Cursor & cur, FuncRequest const & cmd,
                                FuncStatus & status) const
 {
-       switch (cmd.action) {
+       switch (cmd.action()) {
        // we handle these
        case LFUN_INSET_MODIFY:
        case LFUN_INSET_DIALOG_UPDATE:
@@ -261,11 +295,12 @@ bool InsetMathSpace::getStatus(Cursor & cur, FuncRequest const & cmd,
 
 void InsetMathSpace::doDispatch(Cursor & cur, FuncRequest & cmd)
 {
-       switch (cmd.action) {
+       switch (cmd.action()) {
        case LFUN_INSET_MODIFY:
                if (cmd.getArg(0) == "mathspace") {
                        MathData ar;
                        if (createInsetMath_fromDialogStr(cmd.argument(), ar)) {
+                               cur.recordUndo();
                                *this = *ar[0].nucleus()->asSpaceInset();
                                break;
                        }