]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetSpace.cpp
revert r37459 and add a note to the sources:
[lyx.git] / src / insets / InsetSpace.cpp
index 3d9f0abef85d7c114cc519aa30a4e11fc6c92786..023da440289f3b62150a7e214f37e9ad5ba981f6 100644 (file)
@@ -83,7 +83,7 @@ docstring InsetSpace::toolTip(BufferView const &, int, int) const
                message = _("Quad Space");
                break;
        case InsetSpaceParams::QQUAD:
-               message = _("QQuad Space");
+               message = _("Double Quad Space");
                break;
        case InsetSpaceParams::ENSPACE:
                message = _("Enspace");
@@ -141,9 +141,10 @@ docstring InsetSpace::toolTip(BufferView const &, int, int) const
 
 void InsetSpace::doDispatch(Cursor & cur, FuncRequest & cmd)
 {
-       switch (cmd.action) {
+       switch (cmd.action()) {
 
        case LFUN_INSET_MODIFY:
+               cur.recordUndo();
                string2params(to_utf8(cmd.argument()), params_);
                break;
 
@@ -161,15 +162,18 @@ void InsetSpace::doDispatch(Cursor & cur, FuncRequest & cmd)
 bool InsetSpace::getStatus(Cursor & cur, FuncRequest const & cmd,
        FuncStatus & status) const
 {
-       switch (cmd.action) {
+       switch (cmd.action()) {
        // we handle these
        case LFUN_INSET_MODIFY:
                if (cmd.getArg(0) == "space") {
                        InsetSpaceParams params;
                        string2params(to_utf8(cmd.argument()), params);
                        status.setOnOff(params_.kind == params.kind);
-               }
-               // fall through
+                       status.setEnabled(true);        
+               } else
+                       status.setEnabled(false);
+               return true;
+
        case LFUN_INSET_DIALOG_UPDATE:
                status.setEnabled(true);
                return true;
@@ -517,7 +521,7 @@ void InsetSpace::read(Lexer & lex)
 }
 
 
-int InsetSpace::latex(odocstream & os, OutputParams const & runparams) const
+int InsetSpace::latex(otexstream & os, OutputParams const & runparams) const
 {
        switch (params_.kind) {
        case InsetSpaceParams::NORMAL:
@@ -720,7 +724,7 @@ docstring InsetSpace::xhtml(XHTMLStream & xs, OutputParams const &) const
                break;
        }
        // don't escape the entities!
-       xs << XHTMLStream::NextRaw() << from_ascii(output);
+       xs << XHTMLStream::ESCAPE_NONE << from_ascii(output);
        return docstring();
 }
 
@@ -733,12 +737,19 @@ void InsetSpace::validate(LaTeXFeatures & features) const
 }
 
 
-void InsetSpace::tocString(odocstream & os) const
+void InsetSpace::toString(odocstream & os) const
 {
        plaintext(os, OutputParams(0));
 }
 
 
+void InsetSpace::forToc(docstring & os, size_t) const
+{
+       // There's no need to be cute here.
+       os += " ";
+}
+
+
 bool InsetSpace::isStretchableSpace() const
 {
        return params_.kind == InsetSpaceParams::HFILL
@@ -752,7 +763,7 @@ bool InsetSpace::isStretchableSpace() const
 }
 
 
-docstring InsetSpace::contextMenu(BufferView const &, int, int) const
+docstring InsetSpace::contextMenuName() const
 {
        return from_ascii("context-space");
 }