]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/xforms/forms_gettext.C
Tiny clean-ups.
[lyx.git] / src / frontends / xforms / forms_gettext.C
index 8126d6d00eedc4120310a60c2227afb14c0cef13..75cf0b6dfde7818349a24b4ef5c228c33d6bec94 100644 (file)
@@ -5,48 +5,30 @@
  *
  * \author Angus Leeming
  *
- * Full author contact details are available in file CREDITS
+ * Full author contact details are available in file CREDITS.
  */
 #include <config.h>
 
-#ifdef __GNUG__
-#pragma implementation
-#endif
-
 #include "forms_gettext.h"
 
-#include FORMS_H_LOCATION
+#include "support/lstrings.h"
+
+namespace support = lyx::support;
+
+using std::string;
+
 
-// Extract shortcut from <ident>|<shortcut> string
-char const * flyx_shortcut_extract(char const * sc)
+// Extract shortcut from "<identifier>|<shortcut>" string
+string const scex(string const & str)
 {
-       // Find '|' in the sc and return the string after that.
-       register char const * sd = sc;
-       while (sd[0]!= 0 && sd[0] != '|') ++sd;
-
-       if (sd[0] == '|') {
-               ++sd;
-               return sd;
-       }
-       return "";
+       return support::split(str, '|');
 }
 
 
-// Extract identifier from <ident>|<shortcut> string
-char const * flyx_ident_extract(char const * sc)
+// Extract identifier from "<identifier>|<shortcut>" string
+string const idex(string const & str)
 {
-       register char const * se = sc;
-       while (se[0]!= 0 && se[0] != '|') ++se;
-
-       if (se[0] == 0) return sc;
-
-       char * sb = new char[se - sc + 1];
-       int index = 0;
-       register char const * sd = sc;
-       while (sd != se) {
-               sb[index] = sd[0];
-               ++index; ++sd;
-       }
-       sb[index] = 0;
-       return sb;
+       string identifier;
+       support::split(str, identifier, '|');
+       return identifier;
 }