]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetPhantom.cpp
Revert "Do not crash is release mode if we stumble across an unrealized font."
[lyx.git] / src / insets / InsetPhantom.cpp
index c1da30195755ea0195a4410ca796b8f858fd13d7..8fb9d949c74cb5ac08216b211f50bbf6f048d6d8 100644 (file)
@@ -28,6 +28,7 @@
 #include "Lexer.h"
 #include "MetricsInfo.h"
 #include "OutputParams.h"
+#include "texstream.h"
 #include "TextClass.h"
 
 #include "support/docstream.h"
@@ -150,7 +151,7 @@ void InsetPhantom::draw(PainterInfo & pi, int x, int y) const
 
        // draw the inset marker
        drawMarkers(pi, x, y);
-       
+
        // draw the arrow(s)
        static int const arrow_size = 4;
        ColorCode const origcol = pi.base.font.color();
@@ -261,7 +262,7 @@ void InsetPhantom::doDispatch(Cursor & cur, FuncRequest & cmd)
        switch (cmd.action()) {
 
        case LFUN_INSET_MODIFY:
-               cur.recordUndoInset(ATOMIC_UNDO, this);
+               cur.recordUndoInset(this);
                string2params(to_utf8(cmd.argument()), params_);
                setButtonLabel();
                cur.forceBufferUpdate();
@@ -312,7 +313,7 @@ docstring InsetPhantom::toolTip(BufferView const &, int, int) const
 void InsetPhantom::latex(otexstream & os, OutputParams const & runparams) const
 {
        if (runparams.moving_arg)
-               os << "\\protect";
+               os << "\\protect";
 
        switch (params_.type) {
        case InsetPhantomParams::Phantom:
@@ -339,12 +340,16 @@ int InsetPhantom::plaintext(odocstringstream & os,
        switch (params_.type) {
        case InsetPhantomParams::Phantom:
                os << '[' << buffer().B_("phantom") << ":";
+               break;
        case InsetPhantomParams::HPhantom:
                os << '[' << buffer().B_("hphantom") << ":";
+               break;
        case InsetPhantomParams::VPhantom:
                os << '[' << buffer().B_("vphantom") << ":";
+               break;
        default:
                os << '[' << buffer().B_("phantom") << ":";
+               break;
        }
        InsetCollapsable::plaintext(os, runparams, max_length);
        os << "]";
@@ -355,13 +360,14 @@ int InsetPhantom::plaintext(odocstringstream & os,
 
 int InsetPhantom::docbook(odocstream & os, OutputParams const & runparams) const
 {
-       string cmdname;
+       docstring cmdname;
        switch (params_.type) {
        case InsetPhantomParams::Phantom:
        case InsetPhantomParams::HPhantom:
        case InsetPhantomParams::VPhantom:
        default:
-               cmdname = "phantom";
+               cmdname = from_ascii("phantom");
+               break;
        }
        os << "<" + cmdname + ">";
        int const i = InsetCollapsable::docbook(os, runparams);