]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetPhantom.cpp
InsetBox.cpp: only shaded boxes can have multiple paragraphs when there is no inner box
[lyx.git] / src / insets / InsetPhantom.cpp
index 2be07faf9ce43d7bcde13887e8875e1ec741b3a3..8a6d2e68dbe59cb426499ea75384801dfb949906 100644 (file)
@@ -32,6 +32,7 @@
 
 #include "support/docstream.h"
 #include "support/gettext.h"
+#include "support/lstrings.h"
 #include "support/Translator.h"
 
 #include "frontends/Application.h"
@@ -111,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);
@@ -125,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));
@@ -261,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:
@@ -282,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") {
@@ -293,7 +287,6 @@ bool InsetPhantom::getStatus(Cursor & cur, FuncRequest const & cmd,
                flag.setEnabled(true);
                return true;
 
-       case LFUN_INSET_SETTINGS:
        case LFUN_INSET_DIALOG_UPDATE:
                flag.setEnabled(true);
                return true;
@@ -309,13 +302,10 @@ docstring InsetPhantom::toolTip(BufferView const &, int, int) const
        OutputParams rp(&buffer().params().encoding());
        odocstringstream ods;
        InsetCollapsable::plaintext(ods, rp);
-       docstring content_tip = ods.str();
-       // shorten it if necessary
-       if (content_tip.size() > 200)
-               content_tip = content_tip.substr(0, 200) + "...";
+       docstring content_tip = support::wrapParas(ods.str());
        docstring res = phantomtranslator_loc().find(params_.type);
        if (!content_tip.empty())
-               res += from_ascii(": ") + content_tip;
+               res += from_ascii(": ") + "\n" + content_tip;
        return res;
 }
 
@@ -368,6 +358,11 @@ int InsetPhantom::docbook(odocstream & os, OutputParams const & runparams) const
 }
 
 
+docstring InsetPhantom::xhtml(XHTMLStream &, OutputParams const &) const
+{
+       return docstring();
+}
+
 docstring InsetPhantom::contextMenu(BufferView const &, int, int) const
 {
        return from_ascii("context-phantom");