]> git.lyx.org Git - features.git/commitdiff
Use InsetLayout to style the XHTML output.
authorRichard Heck <rgheck@lyx.org>
Tue, 17 Apr 2012 13:11:28 +0000 (09:11 -0400)
committerRichard Heck <rgheck@lyx.org>
Tue, 17 Apr 2012 13:16:34 +0000 (09:16 -0400)
Note that we have also changed the layout name to uppercase, but
this should be fine, since it was so far unused.

lib/layouts/stdinsets.inc
src/insets/InsetScript.cpp
src/insets/InsetScript.h

index 2000172f23f963920478b8582070314687cb2067..1062b3485d2ef23a75da53add07cfde609c52816 100644 (file)
@@ -475,3 +475,15 @@ InsetLayout Preview
        Decoration            minimalistic
        MultiPar              true
 End
+
+InsetLayout Script:superscript
+       MultiPar false
+       HTMLTag sup
+       HTMLIsBlock 0
+End
+
+InsetLayout Script:subscript
+       MultiPar false
+       HTMLTag sub
+       HTMLIsBlock 0
+End
index 1328e3847a593e216a2b1d868f9f3a75102f0f5b..3aa1b41ec4bb59aadfdb54427e562be6323ab68b 100644 (file)
@@ -145,7 +145,7 @@ InsetScript::~InsetScript()
 
 docstring InsetScript::layoutName() const
 {
-       return from_ascii("script:" + scripttranslator().find(params_.type));
+       return from_ascii("Script:" + scripttranslator().find(params_.type));
 }
 
 
@@ -402,25 +402,6 @@ 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;
-}
-
-
 string InsetScript::contextMenuName() const
 {
        return "context-script";
index eaec3c97c981a3f74f8e21531ddf112840ffce9b..07e5af9ab0685d855f617687f2ea050a77f00c87 100644 (file)
@@ -94,8 +94,6 @@ public:
        ///
        int docbook(odocstream &, OutputParams const &) const;
        ///
-       docstring xhtml(XHTMLStream &, OutputParams const &) const;
-       ///
        void edit(Cursor & cur, bool front,
                  EntryDirection entry_from = ENTRY_DIRECTION_IGNORE);
        ///