]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetCommand.cpp
* src/insets/InsetListingsParams.cpp: fix user message
[lyx.git] / src / insets / InsetCommand.cpp
index ce6abb9f26db5fd6c04fd4324e969a5d30293740..ea52598dc1278919749d9626f877082622899773 100644 (file)
@@ -13,6 +13,7 @@
 
 #include "InsetCommand.h"
 
+#include "Buffer.h"
 #include "BufferView.h"
 #include "DispatchResult.h"
 #include "FuncRequest.h"
@@ -85,24 +86,24 @@ void InsetCommand::setParams(InsetCommandParams const & p)
 
 
 int InsetCommand::latex(Buffer const &, odocstream & os,
-                        OutputParams const &) const
+                       OutputParams const &) const
 {
        os << getCommand();
        return 0;
 }
 
 
-int InsetCommand::plaintext(Buffer const &, odocstream & os,
-                            OutputParams const &) const
+int InsetCommand::plaintext(Buffer const & buf, odocstream & os,
+                           OutputParams const &) const
 {
-       docstring const str = "[" + _("LaTeX Command: ") + from_utf8(getCmdName()) + "]";
+       docstring const str = "[" + buf.B_("LaTeX Command: ") + from_utf8(getCmdName()) + "]";
        os << str;
        return str.size();
 }
 
 
 int InsetCommand::docbook(Buffer const &, odocstream &,
-                          OutputParams const &) const
+                         OutputParams const &) const
 {
        return 0;
 }
@@ -132,7 +133,7 @@ void InsetCommand::doDispatch(Cursor & cur, FuncRequest & cmd)
        }
 
        case LFUN_MOUSE_RELEASE: {
-               if (!mailer_name_.empty())
+               if (!mailer_name_.empty() && !cur.selection())
                        InsetCommandMailer(mailer_name_, *this).showDialog(&cur.bv());
                break;
        }
@@ -202,7 +203,7 @@ void InsetCommandMailer::string2params(string const & name,
                return print_mailer_error("InsetCommandMailer", in, 1, name);
 
        // This is part of the inset proper that is usually swallowed
-       // by LyXText::readInset
+       // by Text::readInset
        string id;
        lex >> id;
        if (!lex || id != "LatexCommand")