]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/xforms/xforms_helpers.C
xforms alert fixes
[lyx.git] / src / frontends / xforms / xforms_helpers.C
index 63048165986462eac8bb91ed77f387218f3ea28c..67055a5c1a5425e78446ff0ce11ee70d4a986a95 100644 (file)
@@ -10,9 +10,6 @@
 
 #include <config.h>
 
-#ifdef __GNUG__
-#pragma implementation
-#endif
 
 #include "xforms_helpers.h"
 
 #include "support/filetools.h"
 #include "support/lstrings.h" // frontStrip, strip
 
-#include <algorithm>
 #include <fstream>
-#include <vector>
 
 #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<string, string> 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,