X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FToolbarBackend.C;h=970829b1aa285dd0f0666597eba8a525ce29b2c1;hb=35204f8f33d7400a5fefeffea533fb4cb4097211;hp=a1f2ffa637870d2af7bd8dca0cbf089ccafa4c12;hpb=d3d22383ed46f2ede93c559dc3cfee43651e2f8a;p=lyx.git diff --git a/src/ToolbarBackend.C b/src/ToolbarBackend.C index a1f2ffa637..970829b1aa 100644 --- a/src/ToolbarBackend.C +++ b/src/ToolbarBackend.C @@ -23,11 +23,13 @@ #include "frontends/controllers/ControlMath.h" -using lyx::docstring; -using lyx::support::compare_ascii_no_case; -using lyx::support::getVectorFromString; -using lyx::support::libFileSearch; -using lyx::support::subst; + +namespace lyx { + +using support::compare_ascii_no_case; +using support::getVectorFromString; +using support::libFileSearch; +using support::subst; using std::endl; using std::make_pair; @@ -56,7 +58,7 @@ struct keyword_item toolTags[TO_LAST - 1] = { { "separator", TO_SEPARATOR } }; -} // end of anon namespace +} // namespace anon ToolbarBackend::ToolbarBackend() @@ -184,6 +186,8 @@ void ToolbarBackend::readToolbars(LyXLex & lex) flag = MATH; else if (!compare_ascii_no_case(*cit, "table")) flag = TABLE; + else if (!compare_ascii_no_case(*cit, "review")) + flag = REVIEW; else if (!compare_ascii_no_case(*cit, "top")) flag = TOP; else if (!compare_ascii_no_case(*cit, "bottom")) @@ -208,31 +212,31 @@ void ToolbarBackend::add(Toolbar & tb, FuncRequest const & func, docstring const & tooltip) { tb.items.push_back(make_pair(func, tooltip)); - tb.items.back().first.origin = FuncRequest::UI; + tb.items.back().first.origin = FuncRequest::TOOLBAR; } string const ToolbarBackend::getIcon(FuncRequest const & f) { - using lyx::frontend::find_xpm; + using frontend::find_xpm; string fullname; switch (f.action) { case LFUN_MATH_INSERT: if (!f.argument().empty()) - fullname = find_xpm(lyx::to_utf8(f.argument()).substr(1)); + fullname = find_xpm(to_utf8(f.argument()).substr(1)); break; case LFUN_MATH_DELIM: case LFUN_MATH_BIGDELIM: - fullname = find_xpm(lyx::to_utf8(f.argument())); + fullname = find_xpm(to_utf8(f.argument())); break; default: string const name = lyxaction.getActionName(f.action); string xpm_name(name); if (!f.argument().empty()) - xpm_name = subst(name + ' ' + lyx::to_utf8(f.argument()), ' ', '_'); + xpm_name = subst(name + ' ' + to_utf8(f.argument()), ' ', '_'); fullname = libFileSearch("images", xpm_name, "xpm"); @@ -250,6 +254,9 @@ string const ToolbarBackend::getIcon(FuncRequest const & f) lyxerr[Debug::GUI] << "Cannot find icon for command \"" << lyxaction.getActionName(f.action) - << '(' << lyx::to_utf8(f.argument()) << ")\"" << endl; + << '(' << to_utf8(f.argument()) << ")\"" << endl; return libFileSearch("images", "unknown", "xpm"); } + + +} // namespace lyx