]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetPhantom.cpp
Remove hardcoded values
[lyx.git] / src / insets / InsetPhantom.cpp
index 040c596b8d69e6daea5fd716c05ea50765797025..8a156ea2f1f9064fe248db00dedce608d39b5558 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"
@@ -134,15 +135,6 @@ docstring InsetPhantom::layoutName() const
 }
 
 
-void InsetPhantom::metrics(MetricsInfo & mi, Dimension & dim) const
-{
-       InsetCollapsable::metrics(mi, dim);
-
-       // cache the inset dimension
-       setDimCache(mi, dim);
-}
-
-
 void InsetPhantom::draw(PainterInfo & pi, int x, int y) const
 {
        // draw the text
@@ -150,13 +142,13 @@ 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();
        pi.base.font.setColor(Color_special);
        pi.base.font.setColor(origcol);
-       Dimension const dim = Inset::dimension(*pi.base.bv);
+       Dimension const dim = dimension(*pi.base.bv);
 
        if (params_.type == InsetPhantomParams::Phantom ||
                params_.type == InsetPhantomParams::VPhantom) {
@@ -261,7 +253,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 +304,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:
@@ -359,13 +351,13 @@ 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 + ">";