Ignore:
Timestamp:
Oct 1, 2006, 10:49:25 AM (15 years ago)
Author:
Eugene Romanenko
Message:

macro for .lng files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Lucide/SOURCE/gui/intern.cpp

    r133 r136  
    5858static map<string,string> *langCurrent = NULL;
    5959
    60 #define NUM_ESCAPES     2
    61 static const char *escapes[NUM_ESCAPES][2] = { { "\\t", "\t" }, { "\\r", "\r" } };
     60
     61#define NUM_ESCAPES 3
     62static const char *escapes[NUM_ESCAPES][2] = {
     63    { "\\t", "\t" }, { "\\r", "\r" }, { "%APPNAME%", appName } };
    6264
    6365static string unescapeControls( const char *s )
     
    6668    for ( int i = 0; i < NUM_ESCAPES; i++ )
    6769    {
    68         int startpos = 0;
    69         int findpos = -1;
    70         while ( ( findpos = r.find( escapes[i][0], startpos ) ) != -1 ) {
    71             r.replace( findpos, 2, escapes[i][1] );
     70        string::size_type startpos = 0;
     71        string::size_type findpos = string::npos;
     72        while ( ( findpos = r.find( escapes[i][0], startpos ) ) != string::npos ) {
     73            r.replace( findpos, strlen( escapes[i][0] ), escapes[i][1] );
    7274            startpos = findpos + 1;
    7375        }
Note: See TracChangeset for help on using the changeset viewer.