]> git.lyx.org Git - lyx.git/blobdiff - src/ToolbarBackend.C
cleanup after svn hang-up, #undef CursorShape. Should be compilable ganin now.
[lyx.git] / src / ToolbarBackend.C
index dce01ff06351734e07bc340dff0a009b25fc9838..b4cd8042fe8bc3377b10e15b0e5c3e7943bc1786 100644 (file)
@@ -94,7 +94,7 @@ void ToolbarBackend::read(LyXLex & lex)
                switch (lex.lex()) {
                case TO_ADD:
                        if (lex.next(true)) {
-                               string const tooltip = _(lex.getString());
+                               string const tooltip = lyx::to_utf8(_(lex.getString()));
                                lex.next(true);
                                string const func_arg = lex.getString();
                                lyxerr[Debug::PARSER]
@@ -217,17 +217,21 @@ string const ToolbarBackend::getIcon(FuncRequest const & f)
 
        string fullname;
 
-       if (f.action == LFUN_MATH_INSERT) {
-               if (!f.argument.empty())
-                       fullname = find_xpm(f.argument.substr(1));
-       } else if (f.action == LFUN_MATH_DELIM) {
-               fullname = find_xpm(f.argument);
-       } else {
+       switch (f.action) {
+       case LFUN_MATH_INSERT:
+               if (!f.argument().empty())
+                       fullname = find_xpm(lyx::to_utf8(f.argument()).substr(1));
+               break;
+       case LFUN_MATH_DELIM:
+       case LFUN_MATH_BIGDELIM:
+               fullname = find_xpm(lyx::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 + ' ' + f.argument, ' ', '_');
+               if (!f.argument().empty())
+                       xpm_name = subst(name + ' ' + lyx::to_utf8(f.argument()), ' ', '_');
 
                fullname = libFileSearch("images", xpm_name, "xpm");
 
@@ -245,6 +249,6 @@ string const ToolbarBackend::getIcon(FuncRequest const & f)
 
        lyxerr[Debug::GUI] << "Cannot find icon for command \""
                           << lyxaction.getActionName(f.action)
-                          << '(' << f.argument << ")\"" << endl;
+                          << '(' << lyx::to_utf8(f.argument()) << ")\"" << endl;
        return libFileSearch("images", "unknown", "xpm");
 }