]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetPhantom.cpp
Simplify some of the tooltip stuff now.
[lyx.git] / src / insets / InsetPhantom.cpp
index ea4c7228a4d9ab6d9c3a25e4cbe760b3bc510743..a3c57359985e5fa8d8404ff995097a3ff2246edc 100644 (file)
@@ -112,7 +112,7 @@ void InsetPhantomParams::read(Lexer & lex)
 //
 /////////////////////////////////////////////////////////////////////
 
-InsetPhantom::InsetPhantom(Buffer const & buf, string const & label)
+InsetPhantom::InsetPhantom(Buffer * buf, string const & label)
        : InsetCollapsable(buf)
 {
        setDrawFrame(false);
@@ -126,12 +126,6 @@ InsetPhantom::~InsetPhantom()
 }
 
 
-docstring InsetPhantom::editMessage() const
-{
-       return _("Opened Phantom Inset");
-}
-
-
 docstring InsetPhantom::name() const 
 {
        return from_ascii("Phantom:" + phantomtranslator().find(params_.type));
@@ -262,11 +256,10 @@ bool InsetPhantom::showInsetDialog(BufferView * bv) const
 
 void InsetPhantom::doDispatch(Cursor & cur, FuncRequest & cmd)
 {
-       switch (cmd.action) {
+       switch (cmd.action()) {
 
        case LFUN_INSET_MODIFY:
                string2params(to_utf8(cmd.argument()), params_);
-               setLayout(buffer().params());
                break;
 
        case LFUN_INSET_DIALOG_UPDATE:
@@ -283,7 +276,7 @@ void InsetPhantom::doDispatch(Cursor & cur, FuncRequest & cmd)
 bool InsetPhantom::getStatus(Cursor & cur, FuncRequest const & cmd,
                FuncStatus & flag) const
 {
-       switch (cmd.action) {
+       switch (cmd.action()) {
 
        case LFUN_INSET_MODIFY:
                if (cmd.getArg(0) == "phantom") {
@@ -306,13 +299,10 @@ bool InsetPhantom::getStatus(Cursor & cur, FuncRequest const & cmd,
 
 docstring InsetPhantom::toolTip(BufferView const &, int, int) const
 {
-       OutputParams rp(&buffer().params().encoding());
-       odocstringstream ods;
-       InsetCollapsable::plaintext(ods, rp);
-       docstring content_tip = support::wrapParas(ods.str());
+       docstring const tip = InsetText::toolTipText();
        docstring res = phantomtranslator_loc().find(params_.type);
-       if (!content_tip.empty())
-               res += from_ascii(": ") + "\n" + content_tip;
+       if (!tip.empty())
+               res += from_ascii(": ") + "\n" + tip;
        return res;
 }
 
@@ -365,7 +355,7 @@ int InsetPhantom::docbook(odocstream & os, OutputParams const & runparams) const
 }
 
 
-docstring InsetPhantom::xhtml(odocstream &, OutputParams const &) const
+docstring InsetPhantom::xhtml(XHTMLStream &, OutputParams const &) const
 {
        return docstring();
 }