X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FInsetPhantom.cpp;h=8a6d2e68dbe59cb426499ea75384801dfb949906;hb=142caff8336c54627606c09d3ce5bb7de7a8adb6;hp=234f5028329dc50e291f1838abbf2e94feba4cd4;hpb=4c9fe33c833fb7239a790acc847f45393983da2b;p=lyx.git diff --git a/src/insets/InsetPhantom.cpp b/src/insets/InsetPhantom.cpp index 234f502832..8a6d2e68db 100644 --- a/src/insets/InsetPhantom.cpp +++ b/src/insets/InsetPhantom.cpp @@ -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") { @@ -308,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; } @@ -367,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");