]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetSpace.cpp
InsetTabular.cpp: fix #6585 also for wrapped floats - thanks Vincent
[lyx.git] / src / insets / InsetSpace.cpp
index 225e394cb34a20ea27ec2e3e58a7e1df3ad39e1c..16c3cd08d208fb617eaaa9630c529aec72340861 100644 (file)
@@ -26,6 +26,7 @@
 #include "Lexer.h"
 #include "MetricsInfo.h"
 #include "OutputParams.h"
+#include "output_xhtml.h"
 
 #include "support/debug.h"
 #include "support/docstream.h"
@@ -59,12 +60,6 @@ GlueLength InsetSpace::length() const
 }
 
 
-InsetSpace::~InsetSpace()
-{
-       hideDialogs("space", this);
-}
-
-
 docstring InsetSpace::toolTip(BufferView const &, int, int) const
 {
        docstring message;
@@ -88,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");
@@ -146,7 +141,7 @@ 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:
                string2params(to_utf8(cmd.argument()), params_);
@@ -166,7 +161,7 @@ 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") {
@@ -184,14 +179,6 @@ bool InsetSpace::getStatus(Cursor & cur, FuncRequest const & cmd,
 }
 
 
-bool InsetSpace::showInsetDialog(BufferView * bv) const
-{
-       bv->showDialog("space", params2string(params()),
-               const_cast<InsetSpace *>(this));
-       return true;
-}
-
-
 namespace {
 int const arrow_size = 8;
 }
@@ -688,31 +675,32 @@ int InsetSpace::docbook(odocstream & os, OutputParams const &) const
 }
 
 
-docstring InsetSpace::xhtml(odocstream & os, OutputParams const &) const
+docstring InsetSpace::xhtml(XHTMLStream & xs, OutputParams const &) const
 {
+       string output;
        switch (params_.kind) {
        case InsetSpaceParams::NORMAL:
-               os << " ";
+               output = " ";
                break;
        case InsetSpaceParams::ENSKIP:
        case InsetSpaceParams::ENSPACE:
-               os << "&ensp;";
+               output ="&ensp;";
                break;
        case InsetSpaceParams::QQUAD:
-               os << "&emsp;";
+               output ="&emsp;";
        case InsetSpaceParams::THICK:
        case InsetSpaceParams::QUAD:
-               os << "&emsp;";
+               output ="&emsp;";
                break;
        case InsetSpaceParams::THIN:
-               os << "&thinsp;";
+               output ="&thinsp;";
                break;
        case InsetSpaceParams::PROTECTED:
        case InsetSpaceParams::MEDIUM:
        case InsetSpaceParams::NEGTHIN:
        case InsetSpaceParams::NEGMEDIUM:
        case InsetSpaceParams::NEGTHICK:
-               os << "&nbsp;";
+               output ="&nbsp;";
                break;
        case InsetSpaceParams::HFILL:
        case InsetSpaceParams::HFILL_PROTECTED:
@@ -722,14 +710,17 @@ docstring InsetSpace::xhtml(odocstream & os, OutputParams const &) const
        case InsetSpaceParams::RIGHTARROWFILL:
        case InsetSpaceParams::UPBRACEFILL:
        case InsetSpaceParams::DOWNBRACEFILL:
-               // FIXME Can we do anything with those in HTML?
-               os << '\n';
+               // FIXME XHTML
+               // Can we do anything with those in HTML?
                break;
        case InsetSpaceParams::CUSTOM:
        case InsetSpaceParams::CUSTOM_PROTECTED:
-               // FIXME Probably we could do some sort of blank span?
-               os << '\n';
+               // FIXME XHTML
+               // Probably we could do some sort of blank span?
+               break;
        }
+       // don't escape the entities!
+       xs << XHTMLStream::NextRaw() << from_ascii(output);
        return docstring();
 }