]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetPhantom.cpp
fix a crash when the inset containing the new word at cursor is deleted
[lyx.git] / src / insets / InsetPhantom.cpp
index 9ec662fef14729cb149669dee07db263a902ce46..27a68c0ba9e0c32ff48d45120e6a45021f67f8d5 100644 (file)
@@ -154,7 +154,7 @@ void InsetPhantom::draw(PainterInfo & pi, int x, int y) const
        ColorCode const origcol = pi.base.font.color();
        pi.base.font.setColor(Color_special);
        pi.base.font.setColor(origcol);
-       Dimension const dim = dimension(*pi.base.bv);
+       Dimension const dim = Inset::dimension(*pi.base.bv);
 
        if (params_.type == InsetPhantomParams::Phantom ||
                params_.type == InsetPhantomParams::VPhantom) {
@@ -261,6 +261,8 @@ void InsetPhantom::doDispatch(Cursor & cur, FuncRequest & cmd)
        case LFUN_INSET_MODIFY:
                cur.recordUndoInset(ATOMIC_UNDO, this);
                string2params(to_utf8(cmd.argument()), params_);
+               setButtonLabel();
+               cur.forceBufferUpdate();
                break;
 
        case LFUN_INSET_DIALOG_UPDATE:
@@ -305,7 +307,7 @@ docstring InsetPhantom::toolTip(BufferView const &, int, int) const
 }
 
 
-int InsetPhantom::latex(odocstream & os, OutputParams const & runparams) const
+int InsetPhantom::latex(otexstream & os, OutputParams const & runparams) const
 {
        if (params_.type == InsetPhantomParams::Phantom)
                os << "\\phantom{";