X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FToolbarBackend.cpp;h=a406cb48ab25691453095343bb5f001bdf0874a6;hb=6c977615633e5e132494b9a7fa778588210f9c95;hp=8dbe44e7257e8b638ce6b16c9f6ac14810553eff;hpb=f1c1cba9c30729e219899fe7f5025cf180e01e5a;p=lyx.git diff --git a/src/ToolbarBackend.cpp b/src/ToolbarBackend.cpp index 8dbe44e725..a406cb48ab 100644 --- a/src/ToolbarBackend.cpp +++ b/src/ToolbarBackend.cpp @@ -14,32 +14,27 @@ #include "ToolbarBackend.h" #include "FuncRequest.h" #include "Lexer.h" -#include "debug.h" -#include "gettext.h" #include "LyXAction.h" #include "support/lstrings.h" -#include -#include +#include "support/debug.h" +#include "support/gettext.h" -namespace lyx { +#include -using support::compare_ascii_no_case; -using support::getVectorFromString; +#include -using std::endl; -using std::make_pair; -using std::string; -using std::vector; -using std::find_if; +using namespace std; +using namespace lyx::support; +namespace lyx { namespace { -class ToolbarNamesEqual : public std::unary_function { +class ToolbarNamesEqual +{ public: - ToolbarNamesEqual(string const & name) - : name_(name) {} + ToolbarNamesEqual(string const & name) : name_(name) {} bool operator()(ToolbarInfo const & tbinfo) const { return tbinfo.name == name_; @@ -104,8 +99,8 @@ ToolbarInfo & ToolbarInfo::read(Lexer & lex) //consistency check if (compare_ascii_no_case(lex.getString(), "toolbar")) { - lyxerr << "ToolbarInfo::read: ERROR wrong token:`" - << lex.getString() << '\'' << endl; + LYXERR0("ToolbarInfo::read: ERROR wrong token:`" + << lex.getString() << '\''); } lex.next(true); @@ -116,8 +111,8 @@ ToolbarInfo & ToolbarInfo::read(Lexer & lex) // FIXME what to do here? if (!lex) { - lyxerr << "ToolbarInfo::read: Malformed toolbar " - "description " << lex.getString() << endl; + LYXERR0("ToolbarInfo::read: Malformed toolbar " + "description " << lex.getString()); return *this; } @@ -135,9 +130,8 @@ ToolbarInfo & ToolbarInfo::read(Lexer & lex) docstring const tooltip = translateIfPossible(lex.getDocString()); lex.next(true); string const func_arg = lex.getString(); - LYXERR(Debug::PARSER) - << "ToolbarInfo::read TO_COMMAND func: `" - << func_arg << '\'' << endl; + LYXERR(Debug::PARSER, "ToolbarInfo::read TO_COMMAND func: `" + << func_arg << '\''); FuncRequest func = lyxaction.lookupFunc(func_arg); @@ -147,12 +141,12 @@ ToolbarInfo & ToolbarInfo::read(Lexer & lex) case TO_MINIBUFFER: add(ToolbarItem(ToolbarItem::MINIBUFFER, - FuncRequest(kb_action(ToolbarItem::MINIBUFFER)))); + FuncRequest(FuncCode(ToolbarItem::MINIBUFFER)))); break; case TO_SEPARATOR: add(ToolbarItem(ToolbarItem::SEPARATOR, - FuncRequest(kb_action(ToolbarItem::SEPARATOR)))); + FuncRequest(FuncCode(ToolbarItem::SEPARATOR)))); break; case TO_POPUPMENU: @@ -175,14 +169,14 @@ ToolbarInfo & ToolbarInfo::read(Lexer & lex) case TO_LAYOUTS: add(ToolbarItem(ToolbarItem::LAYOUTS, - FuncRequest(kb_action(ToolbarItem::LAYOUTS)))); + FuncRequest(FuncCode(ToolbarItem::LAYOUTS)))); break; case TO_TABLEINSERT: if (lex.next(true)) { docstring const tooltip = lex.getDocString(); add(ToolbarItem(ToolbarItem::TABLEINSERT, - FuncRequest(kb_action(ToolbarItem::TABLEINSERT)), tooltip)); + FuncRequest(FuncCode(ToolbarItem::TABLEINSERT)), tooltip)); } break; @@ -206,6 +200,7 @@ ToolbarInfo & ToolbarInfo::read(Lexer & lex) ToolbarBackend::ToolbarBackend() { + fullScreenWindows = 0; } @@ -224,8 +219,8 @@ void ToolbarBackend::readToolbars(Lexer & lex) //consistency check if (compare_ascii_no_case(lex.getString(), "toolbarset")) { - lyxerr << "ToolbarBackend::readToolbars: ERROR wrong token:`" - << lex.getString() << '\'' << endl; + LYXERR0("ToolbarBackend::readToolbars: ERROR wrong token:`" + << lex.getString() << '\''); } lex.pushTable(toolTags, TO_LAST - 1); @@ -260,8 +255,8 @@ void ToolbarBackend::readToolbarSettings(Lexer & lex) { //consistency check if (compare_ascii_no_case(lex.getString(), "toolbars")) { - lyxerr << "ToolbarBackend::readToolbarSettings: ERROR wrong token:`" - << lex.getString() << '\'' << endl; + LYXERR0("ToolbarBackend::readToolbarSettings: ERROR wrong token:`" + << lex.getString() << '\''); } lex.next(true); @@ -281,8 +276,7 @@ void ToolbarBackend::readToolbarSettings(Lexer & lex) } if (tcit == tend) { - lyxerr << "ToolbarBackend: undefined toolbar " - << name << endl; + LYXERR0("ToolbarBackend: undefined toolbar " << name); return; } @@ -304,6 +298,8 @@ void ToolbarBackend::readToolbarSettings(Lexer & lex) flag = ToolbarInfo::MATH; else if (!compare_ascii_no_case(*cit, "table")) flag = ToolbarInfo::TABLE; + else if (!compare_ascii_no_case(*cit, "mathmacrotemplate")) + flag = ToolbarInfo::MATHMACROTEMPLATE; else if (!compare_ascii_no_case(*cit, "review")) flag = ToolbarInfo::REVIEW; else if (!compare_ascii_no_case(*cit, "top")) @@ -314,9 +310,12 @@ void ToolbarBackend::readToolbarSettings(Lexer & lex) flag = ToolbarInfo::LEFT; else if (!compare_ascii_no_case(*cit, "right")) flag = ToolbarInfo::RIGHT; + else if (!compare_ascii_no_case(*cit, "auto")) + flag = ToolbarInfo::AUTO; else { - lyxerr << "ToolbarBackend::readToolbarSettings: unrecognised token:`" - << *cit << '\'' << endl; + LYXERR(Debug::ANY, + "ToolbarBackend::readToolbarSettings: unrecognised token:`" + << *cit << '\''); } tcit->flags = static_cast(tcit->flags | flag); }