]> 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 16c3cd08d208fb617eaaa9630c529aec72340861..023da440289f3b62150a7e214f37e9ad5ba981f6 100644 (file)
@@ -144,6 +144,7 @@ void InsetSpace::doDispatch(Cursor & cur, FuncRequest & cmd)
        switch (cmd.action()) {
 
        case LFUN_INSET_MODIFY:
+               cur.recordUndo();
                string2params(to_utf8(cmd.argument()), params_);
                break;
 
@@ -168,8 +169,11 @@ bool InsetSpace::getStatus(Cursor & cur, FuncRequest const & cmd,
                        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");
 }