]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetScript.cpp
Allow LyX format to be written to View>Source window.
[lyx.git] / src / insets / InsetScript.cpp
index 514445a943b35acf742132ac8bce0b3fa84c6dce..648b910e271381bfeba8e002c5d63012a4629d81 100644 (file)
@@ -143,9 +143,9 @@ InsetScript::~InsetScript()
 }
 
 
-docstring InsetScript::name() const 
+docstring InsetScript::layoutName() const
 {
-       return from_ascii("script:" + scripttranslator().find(params_.type));
+       return from_ascii("Script:" + scripttranslator().find(params_.type));
 }
 
 
@@ -214,6 +214,7 @@ void InsetScript::doDispatch(Cursor & cur, FuncRequest & cmd)
 {
        switch (cmd.action()) {
        case LFUN_INSET_MODIFY:
+               cur.recordUndoInset(ATOMIC_UNDO, this);
                string2params(to_utf8(cmd.argument()), params_);
                break;
        default:
@@ -325,31 +326,6 @@ docstring InsetScript::toolTip(BufferView const &, int, int) const
 }
 
 
-void InsetScript::validate(LaTeXFeatures & features) const
-{
-       if (params_.type == InsetScriptParams::Subscript)
-               features.require("subscript");
-       InsetText::validate(features);
-}
-
-
-int InsetScript::latex(odocstream & os, OutputParams const & runparams) const
-{
-       switch (params_.type) {
-       case InsetScriptParams::Subscript:
-               os << "\\textsubscript{";
-               break;
-       case InsetScriptParams::Superscript:
-               os << "\\textsuperscript{";
-               break;
-       }
-       int const i = InsetText::latex(os, runparams);
-       os << "}";
-
-       return i;
-}
-
-
 int InsetScript::plaintext(odocstream & os, OutputParams const & runparams) const
 {
        odocstringstream oss;
@@ -403,28 +379,9 @@ int InsetScript::docbook(odocstream & os, OutputParams const & runparams) const
 }
 
 
-docstring InsetScript::xhtml(XHTMLStream & xs, OutputParams const & runparams) const
-{
-       string cmdname;
-       switch (params_.type) {
-       case InsetScriptParams::Subscript:
-               cmdname = "sub";
-               break;
-       case InsetScriptParams::Superscript:
-               cmdname = "sup";
-               break;
-       }
-
-       xs << html::StartTag(cmdname);
-       docstring const ret = InsetText::xhtml(xs, runparams);
-       xs << html::EndTag(cmdname);
-       return ret;
-}
-
-
-docstring InsetScript::contextMenu(BufferView const &, int, int) const
+string InsetScript::contextMenuName() const
 {
-       return from_ascii("context-script");
+       return "context-script";
 }