X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2FInsetMathNest.cpp;h=392e1ff8e8c389f27f0c31ed6495e160dfc2b034;hb=66fa801e74e1775b31008df548332436ce79e2e1;hp=74ee70d141097a11dafded8494dfcb77e0090733;hpb=c5782ff4bbf0129b8ef95c92b33560d67e593024;p=lyx.git diff --git a/src/mathed/InsetMathNest.cpp b/src/mathed/InsetMathNest.cpp index 74ee70d141..392e1ff8e8 100644 --- a/src/mathed/InsetMathNest.cpp +++ b/src/mathed/InsetMathNest.cpp @@ -54,6 +54,7 @@ #include "OutputParams.h" #include "Text.h" +#include "frontends/Application.h" #include "frontends/Clipboard.h" #include "frontends/Painter.h" #include "frontends/Selection.h" @@ -1551,7 +1552,7 @@ void InsetMathNest::lfunMousePress(Cursor & cur, FuncRequest & cmd) // cur.result().update(): don't overwrite previously set flags. cur.screenUpdateFlags(Update::Decoration | Update::FitCursor | cur.result().screenUpdate()); - } else if (cmd.button() == mouse_button::button2) { + } else if (cmd.button() == mouse_button::button2 && lyxrc.mouse_middlebutton_paste) { if (cap::selection()) { // See comment in Text::dispatch why we do this cap::copySelectionToStack(); @@ -2112,7 +2113,7 @@ MathCompletionList::MathCompletionList(Cursor const & cur) // fill in global macros macros.clear(); - MacroTable::globalMacros().getMacroNames(macros); + MacroTable::globalMacros().getMacroNames(macros, false); //lyxerr << "Globals completion macros: "; for (it = macros.begin(); it != macros.end(); ++it) { //lyxerr << "\\" + *it << " "; @@ -2197,7 +2198,7 @@ MathCompletionList::MathCompletionList(Cursor const & cur) MathWordList::const_iterator it2; //lyxerr << "Globals completion commands: "; for (it2 = words.begin(); it2 != words.end(); ++it2) { - if (it2->second.inset != "macro") { + if (it2->second.inset != "macro" && !it2->second.hidden) { // macros are already read from MacroTable::globalMacros() globals.push_back('\\' + it2->first); //lyxerr << '\\' + it2->first << ' '; @@ -2240,7 +2241,10 @@ std::string MathCompletionList::icon(size_t idx) const cmd = locals[idx]; // get the icon resource name by stripping the backslash - return "images/math/" + to_utf8(cmd.substr(1)) + ".png"; + docstring icon_name = frontend::Application::mathIcon(cmd.substr(1)); + if (icon_name.empty()) + return std::string(); + return "images/math/" + to_utf8(icon_name); } std::vector MathCompletionList::globals;