X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fxforms%2Fforms_gettext.C;h=1f8f5d1466bf10ca8e72f29902452b2187f62edf;hb=37e82a546392d43f787826b85481a11f2a27af15;hp=c8da06bc69b8428da9d5df97edae014aa83a9ed0;hpb=6fac1dc98003a6a6e02765f078b3d3426d426508;p=lyx.git diff --git a/src/frontends/xforms/forms_gettext.C b/src/frontends/xforms/forms_gettext.C index c8da06bc69..1f8f5d1466 100644 --- a/src/frontends/xforms/forms_gettext.C +++ b/src/frontends/xforms/forms_gettext.C @@ -1,51 +1,37 @@ /** * \file forms_gettext.C - * Read the file COPYING + * This file is part of LyX, the document processor. + * Licence details can be found in the file COPYING. * * \author Angus Leeming * - * Full author contact details are available in file CREDITS + * Full author contact details are available in file CREDITS. */ #include -#ifdef __GNUG__ -#pragma implementation -#endif - #include "forms_gettext.h" -#include FORMS_H_LOCATION +#include "support/lstrings.h" + +using std::string; -// Extract shortcut from | string -char const * flyx_shortcut_extract(char const * sc) +namespace lyx { +namespace frontend { + +// Extract shortcut from "|" 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 | string -char const * flyx_ident_extract(char const * sc) +// Extract identifier from "|" 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; } + +} // namespace frontend +} // namespace lyx