X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fxforms%2Fxforms_helpers.C;h=67055a5c1a5425e78446ff0ce11ee70d4a986a95;hb=e8c9544a2d74248d6b64d4833f01874893aca2ee;hp=b55ee03351f9799872196fed8e604b3095ee3b10;hpb=99d1627a471b92f403598d03dfc861ddc3c11be0;p=lyx.git diff --git a/src/frontends/xforms/xforms_helpers.C b/src/frontends/xforms/xforms_helpers.C index b55ee03351..67055a5c1a 100644 --- a/src/frontends/xforms/xforms_helpers.C +++ b/src/frontends/xforms/xforms_helpers.C @@ -23,21 +23,33 @@ #include "support/filetools.h" #include "support/lstrings.h" // frontStrip, strip -#include #include -#include #include FORMS_H_LOCATION using std::ofstream; using std::pair; using std::vector; +using std::make_pair; bool isActive(FL_OBJECT * ob) { return ob && ob->active > 0; } +std::pair parse_shortcut(string const & str) +{ + string::size_type i = str.find_first_of("&"); + if (i == string::npos || i == str.length() - 1) + return make_pair(str, string()); + + // FIXME: handle && + + string::value_type c = str[i + 1]; + return make_pair(str.substr(0, i) + str.substr(i + 1), + string("#") + c); +} + // A wrapper for the xforms routine, but this one accepts uint args unsigned long fl_getmcolor(int i,